Capability Manager Enhanced - Version 1.4.1

Version Description

  • 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.)
Download this release

Release Info

Developer kevinB
Plugin Icon 128x128 Capability Manager Enhanced
Version 1.4.1
Comparing to
See all releases

Version 1.4.1

Files changed (72) hide show
  1. admin.css +122 -0
  2. capsman-enhanced.php +107 -0
  3. framework/.htaccess +4 -0
  4. framework/classes/abstract/component.php +182 -0
  5. framework/classes/abstract/module.php +718 -0
  6. framework/classes/abstract/plugin.php +473 -0
  7. framework/classes/abstract/theme.php +273 -0
  8. framework/classes/admin-notices.php +70 -0
  9. framework/classes/settings.php +330 -0
  10. framework/classes/template.php +380 -0
  11. framework/init.php +127 -0
  12. framework/lang/bg_BG.mo +0 -0
  13. framework/lang/bg_BG.po +352 -0
  14. framework/lang/ca.mo +0 -0
  15. framework/lang/ca.po +315 -0
  16. framework/lang/es_ES.mo +0 -0
  17. framework/lang/es_ES.po +316 -0
  18. framework/lang/framework.pot +317 -0
  19. framework/lang/it_IT.mo +0 -0
  20. framework/lang/it_IT.po +417 -0
  21. framework/lib/filesystem.php +198 -0
  22. framework/lib/formating.php +179 -0
  23. framework/lib/modules.php +207 -0
  24. framework/lib/objects.php +110 -0
  25. framework/lib/plugins.php +33 -0
  26. framework/lib/system.php +36 -0
  27. framework/lib/themes.php +251 -0
  28. framework/lib/users.php +142 -0
  29. framework/license.txt +280 -0
  30. framework/loader.php +71 -0
  31. framework/samples/alkivia.ini +33 -0
  32. framework/samples/alkivia.php +42 -0
  33. framework/styles/.htaccess +4 -0
  34. framework/styles/admin.css +173 -0
  35. framework/styles/images/alkivia.png +0 -0
  36. framework/styles/images/dl-bg-gray.png +0 -0
  37. framework/styles/images/docs.png +0 -0
  38. framework/styles/images/help.png +0 -0
  39. framework/styles/images/paypal.png +0 -0
  40. framework/vendor/upload/class.upload.php +4752 -0
  41. images/capsman.png +0 -0
  42. images/cman32.png +0 -0
  43. includes/admin.php +578 -0
  44. includes/author-widget.php +40 -0
  45. includes/backup.php +81 -0
  46. includes/manager.php +704 -0
  47. lang/capsman-by_BY.mo +0 -0
  48. lang/capsman-by_BY.po +281 -0
  49. lang/capsman-ca.mo +0 -0
  50. lang/capsman-ca.po +384 -0
  51. lang/capsman-de_DE.mo +0 -0
  52. lang/capsman-de_DE.po +281 -0
  53. lang/capsman-es_ES.mo +0 -0
  54. lang/capsman-es_ES.po +392 -0
  55. lang/capsman-it_IT.mo +0 -0
  56. lang/capsman-it_IT.po +281 -0
  57. lang/capsman-ru_RU.mo +0 -0
  58. lang/capsman-ru_RU.po +281 -0
  59. lang/capsman-sv_SE.mo +0 -0
  60. lang/capsman-sv_SE.po +240 -0
  61. lang/capsman.mo +0 -0
  62. lang/capsman.po +854 -0
  63. lang/capsman.pot +738 -0
  64. readme.txt +165 -0
  65. samples/alkivia.ini +18 -0
  66. screenshot-1.jpg +0 -0
  67. screenshot-2.jpg +0 -0
  68. screenshot-3.jpg +0 -0
  69. screenshot-4.jpg +0 -0
  70. screenshot-5.jpg +0 -0
  71. screenshot-6.jpg +0 -0
  72. screenshot-7.png +0 -0
admin.css ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Settings for admin dashboard.
3
+ * Based on the styles for Maintenance Mode plugin by Michael Wöhrer
4
+ *
5
+ * @version $Rev: 198515 $
6
+ * @author Jordi Canals
7
+ * @copyright Copyright (C) 2009, 2010 Jordi Canals
8
+ * @license GNU General Public License version 2
9
+ * @link http://alkivia.org
10
+ * @package Alkivia
11
+ * @subpackage CapsMan
12
+ *
13
+
14
+ Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
15
+
16
+ This program is free software; you can redistribute it and/or
17
+ modify it under the terms of the GNU General Public License
18
+ version 2 as published by the Free Software Foundation.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+
29
+ /* =========================================================== SETTINGS */
30
+
31
+ #icon-capsman-admin {
32
+ background: transparent url('images/cman32.png') no-repeat;
33
+ }
34
+
35
+ /* ====================================================== SIDEBAR ICONS */
36
+
37
+ td.sidebar a.capsman {
38
+ background-image: url('images/capsman.png');
39
+ }
40
+
41
+ a.cap_type {
42
+ text-decoration: none;
43
+ }
44
+
45
+ a.cap_type:hover {
46
+ text-decoration: underline;
47
+ }
48
+
49
+ ul.cme-listhoriz li {
50
+ text-align: center;
51
+ padding-right: 2em;
52
+ }
53
+
54
+ ul.cme-listhoriz li table{
55
+ text-align: center;
56
+ }
57
+
58
+
59
+ ul.cme-listhoriz {
60
+ width: 100%;
61
+ clear: both;
62
+ float: left;
63
+ margin: 0;
64
+ padding: 0;
65
+ }
66
+
67
+ ul.cme-listhoriz li {
68
+ list-style: none;
69
+ float: left;
70
+ margin: 0;
71
+ }
72
+
73
+
74
+ div.cme-listhoriz h3 {
75
+ margin: 0.2em;
76
+ }
77
+
78
+ table .cme-typecaps {
79
+ border: 1px solid black;
80
+ }
81
+
82
+ table .cme-typecaps td {
83
+ text-align: center;
84
+ height: 2em;
85
+ }
86
+
87
+ table .cme-typecaps th {
88
+ padding-left: 0.5em;
89
+ padding-right: 0.5em;
90
+ }
91
+
92
+ td.cap_yes {
93
+ color:green;font-weight:bold;
94
+ }
95
+
96
+ td.cap_no {
97
+ color:red;
98
+ }
99
+
100
+ #akmin input.button {
101
+ margin-top: 5px;
102
+ }
103
+
104
+ #akmin td.sidebar {
105
+ width: 300px;
106
+ }
107
+
108
+ #akmin input.regular-text {
109
+ width: 200px;
110
+ }
111
+
112
+ .cme-subtext {
113
+ color: #686868;
114
+ font-style: italic;
115
+ margin-top:5px;
116
+ }
117
+
118
+ #wpbody-content{
119
+ padding-bottom: 30px;
120
+ }
121
+
122
+ /* EOF */
capsman-enhanced.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Capability Manager Enhanced
4
+ Plugin URI: http://presspermit.com/capability-manager
5
+ Description: Manage WordPress role definitions. Organizes available capabilities by post type, status and source.
6
+ Version: 1.4.1
7
+ Author: Jordi Canals, Kevin Behrens
8
+ Author URI: http://agapetry.net
9
+ */
10
+
11
+ /**
12
+ * Capability Manager. Main Plugin File.
13
+ * Plugin to create and manage Roles and Capabilities.
14
+ *
15
+ * @author Jordi Canals, Kevin Behrens
16
+ * @copyright Copyright (C) 2009, 2010 Jordi Canals; modifications Copyright (C) 2012 Kevin Behrens
17
+ * @license GNU General Public License version 3
18
+ * @link http://agapetry.net
19
+ *
20
+
21
+ Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
22
+ Modifications Copyright 2012, Kevin Behrens <kevin@agapetry.net>
23
+
24
+ This program is free software; you can redistribute it and/or
25
+ modify it under the terms of the GNU General Public License
26
+ version 3 as published by the Free Software Foundation.
27
+
28
+ This program is distributed in the hope that it will be useful,
29
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
30
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31
+ GNU General Public License for more details <http://www.gnu.org/licenses/>.
32
+ */
33
+
34
+ if ( ! defined( 'CAPSMAN_VERSION' ) ) {
35
+ define( 'CAPSMAN_VERSION', '1.4.1' );
36
+ define( 'CAPSMAN_ENH_VERSION', '1.4.1' );
37
+ }
38
+
39
+ if ( cme_is_plugin_active( 'capsman.php' ) ) {
40
+ $message = __( '<strong>Error:</strong> Capability Manager Extended cannot function because another copy of Capability Manager is active.', 'capsman' );
41
+ add_action('admin_notices', create_function('', 'echo \'<div id="message" class="error fade" style="color: black">' . $message . '</div>\';'));
42
+ return;
43
+ } else {
44
+ define ( 'AK_CMAN_PATH', dirname(__FILE__) );
45
+ define ( 'AK_CMAN_LIB', AK_CMAN_PATH . '/includes' );
46
+
47
+ /**
48
+ * Sets an admin warning regarding required PHP version.
49
+ *
50
+ * @hook action 'admin_notices'
51
+ * @return void
52
+ */
53
+ function _cman_php_warning() {
54
+ $data = get_plugin_data(__FILE__);
55
+ load_plugin_textdomain('capsman', false, basename(dirname(__FILE__)) .'/lang');
56
+
57
+ echo '<div class="error"><p><strong>' . __('Warning:', 'capsman') . '</strong> '
58
+ . sprintf(__('The active plugin %s is not compatible with your PHP version.', 'capsman') .'</p><p>',
59
+ '&laquo;' . $data['Name'] . ' ' . $data['Version'] . '&raquo;')
60
+ . sprintf(__('%s is required for this plugin.', 'capsman'), 'PHP-5 ')
61
+ . '</p></div>';
62
+ }
63
+
64
+ // ============================================ START PROCEDURE ==========
65
+
66
+ // Check required PHP version.
67
+ if ( version_compare(PHP_VERSION, '5.0.0', '<') ) {
68
+ // Send an armin warning
69
+ add_action('admin_notices', '_cman_php_warning');
70
+ } else {
71
+ 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']) ) ) {
72
+ // Run the plugin
73
+ include_once ( AK_CMAN_PATH . '/framework/loader.php' );
74
+ include ( AK_CMAN_LIB . '/manager.php' );
75
+ ak_create_object('capsman', new CapabilityManager(__FILE__, 'capsman'));
76
+ } else {
77
+ load_plugin_textdomain('capsman', false, basename(dirname(__FILE__)) .'/lang');
78
+ add_action( 'admin_menu', 'cme_submenus' );
79
+ }
80
+ }
81
+ }
82
+
83
+ // perf enchancement: display submenu links without loading framework and plugin code
84
+ function cme_submenus() {
85
+ if ( defined( 'PP_VERSION' ) ) // Press Permit integrates into Permissions menu
86
+ add_action( 'pp_permissions_menu', '_cme_pp_menu' );
87
+ else
88
+ add_users_page( __('Capability Manager', 'capsman'), __('Role Capabilities', 'capsman'), 'manage_capabilities', 'capsman', 'cme_fakefunc');
89
+
90
+ add_management_page(__('Capability Manager', 'capsman'), __('Capability Manager', 'capsman'), 'manage_capabilities', 'capsman' . '-tool', 'cme_fakefunc');
91
+ }
92
+
93
+ function _cme_pp_menu() {
94
+ add_submenu_page( $GLOBALS['pp_admin']->get_menu('options'), __('Capability Manager', 'capsman'), __('Role Capabilities', 'capsman'), 'manage_capabilities', 'capsman', 'cme_fakefunc' );
95
+ }
96
+
97
+ function cme_is_plugin_active($check_plugin_file) {
98
+ if ( ! $check_plugin_file )
99
+ return false;
100
+
101
+ $plugins = get_option('active_plugins');
102
+
103
+ foreach ( $plugins as $plugin_file ) {
104
+ if ( false !== strpos($plugin_file, $check_plugin_file) )
105
+ return $plugin_file;
106
+ }
107
+ }
framework/.htaccess ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ # Prevent running or accessing any file directly.
2
+
3
+ Order Deny,Allow
4
+ Deny from all
framework/classes/abstract/component.php ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Component.
4
+ * Manages the main functionality for all components.
5
+ *
6
+ * @version $Rev: 203758 $
7
+ * @author Jordi Canals
8
+ * @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
9
+ * @license GNU General Public License version 2
10
+ * @link http://alkivia.org
11
+ * @package Alkivia
12
+ * @subpackage Framework
13
+ *
14
+
15
+ Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
16
+
17
+ This program is free software; you can redistribute it and/or
18
+ modify it under the terms of the GNU General Public License
19
+ version 2 as published by the Free Software Foundation.
20
+
21
+ This program is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
+
26
+ You should have received a copy of the GNU General Public License
27
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
28
+ */
29
+
30
+ require_once ( AK_CLASSES . '/abstract/module.php' );
31
+
32
+ /**
33
+ * Abtract class to be used as a component template.
34
+ * There are some special functions thay can declared in implementations to perform main actions:
35
+ * - componentActivate: (Protected) Actions to run when activating the component.
36
+ * - componentDeactivate: (Hook, must be public) Actions to run when deactivating the component.
37
+ * - componentUpdate: (Protected) Actions to update the component to a new version. (Updating version on DB is done after this).
38
+ * - componentsLoaded: (Protected) Actions to run when components initialization is performed (In plugins loaded).
39
+ * - registerWidgets: (Protected) Actions to init plugin widgets (In widgets_init).
40
+ *
41
+ * @since 0.7
42
+ * @author Jordi Canals
43
+ * @package AOC
44
+ * @subpackage Library
45
+ * @link http://alkivia.org
46
+ */
47
+ abstract class akComponentAbstract extends akModuleAbstract
48
+ {
49
+ /**
50
+ * Parent plugin slug.
51
+ * This is used on menus and form actions.
52
+ *
53
+ * @var string
54
+ */
55
+ protected $slug;
56
+
57
+ /**
58
+ * Class constructor.
59
+ * Calls the implementated method 'startUp' if it exists. This is done at plugins loading time.
60
+ * Prepares admin menus by seting an action for the implemented method '_adminMenus' if it exists.
61
+ *
62
+ * @param string $file The main file to run the component.
63
+ * @return aocComponent The component object.
64
+ */
65
+ final function __construct ( $file )
66
+ {
67
+ parent::__construct('component', '', $file);
68
+ $this->slug = ak_get_object($this->PID)->getSlug();
69
+
70
+ // Activating and deactivating hooks.
71
+ add_action('ak_activate_' . $this->ID, array($this, 'activate'));
72
+ add_action('ak_deactivate_' . $this->ID, array($this, 'componentDeactivate'));
73
+
74
+ add_action('ak_' . $this->PID . '_components_init', array($this, 'init'));
75
+ add_action('ak_' . $this->PID . '_widgets_init', array($this, 'widgetsInit'));
76
+ }
77
+
78
+ /**
79
+ * Fires on plugin activation.
80
+ * @return void
81
+ */
82
+ protected function componentActivate () {}
83
+
84
+ /**
85
+ * Fires on plugin deactivation.
86
+ * @return void
87
+ */
88
+ public function componentDeactivate () {}
89
+
90
+ /**
91
+ * Updates the plugin to a new version.
92
+ * @param string $version Old component version.
93
+ * @return void
94
+ */
95
+ protected function componentUpdate ( $version ) {}
96
+
97
+ /**
98
+ * Fires when plugins have been loaded.
99
+ * @return void
100
+ */
101
+ protected function componentsLoaded () {}
102
+
103
+ /**
104
+ * Fires on Widgets init.
105
+ * @return void
106
+ */
107
+ protected function registerWidgets () {}
108
+
109
+ /**
110
+ * Activates the Component.
111
+ * Sets the plugin version in the component settings to be saved to DB.
112
+ *
113
+ * @hook action aoc_activate_$component
114
+ * @access private
115
+ * @return void
116
+ */
117
+ final function activate()
118
+ {
119
+ $this->componentActivate();
120
+ add_option($this->ID . '_version', $this->version);
121
+ }
122
+
123
+ /**
124
+ * Inits the component.
125
+ * Here whe call the 'update' and 'init' functions. This is done after the components are loaded.
126
+ * Also the component version is updated here.
127
+ *
128
+ * @hook action aoc_components_init
129
+ * @access private
130
+ * @return void
131
+ */
132
+ final function init ()
133
+ {
134
+ if ( $this->needs_update ) {
135
+ $this->componentUpdate( $this->getOption('version') );
136
+ update_option($this->ID . '_version', $this->version);
137
+ }
138
+
139
+ // Call the custom init for the component.
140
+ $this->componentsLoaded();
141
+ }
142
+
143
+ /**
144
+ * Inits the widgets (In action 'widgets_init')
145
+ * Before loading the widgets, we check that standard sidebar is present.
146
+ *
147
+ * @hook action 'widgets_init'
148
+ * @return void
149
+ */
150
+ final function widgetsInit()
151
+ {
152
+ if ( class_exists('WP_Widget') && function_exists('register_widget') && function_exists('unregister_widget') ) {
153
+ $this->registerWidgets();
154
+ } else {
155
+ add_action('admin_notices', array($this, 'noSidebarWarning'));
156
+ }
157
+ }
158
+
159
+ /**
160
+ * Loads component data.
161
+ * As it is a child component, data is loaded into akModuleAbstract::child_data
162
+ *
163
+ * @return void
164
+ */
165
+ final protected function loadData()
166
+ {
167
+ if ( empty( $this->child_data) ) {
168
+ $component_data = ak_component_data($this->mod_file, true);
169
+ $readme_data = ak_module_readme_data($this->mod_file);
170
+ $this->child_data = array_merge($readme_data, $component_data);
171
+
172
+ $this->PID = $this->child_data['Parent'];
173
+ $this->mod_data = ak_get_object($this->PID)->getModData();
174
+
175
+ if ( empty( $this->child_data['Version']) ) {
176
+ $this->version = $this->mod_data['Version'];
177
+ } else {
178
+ $this->version = $this->child_data['Version'];
179
+ }
180
+ }
181
+ }
182
+ }
framework/classes/abstract/module.php ADDED
@@ -0,0 +1,718 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class for Modules management.
4
+ * Modules are Plugins, Themes and plugin components.
5
+ *
6
+ * @version $Rev: 203758 $
7
+ * @author Jordi Canals
8
+ * @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
9
+ * @license GNU General Public License version 2
10
+ * @link http://alkivia.org
11
+ * @package Alkivia
12
+ * @subpackage Framework
13
+ *
14
+
15
+ Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
16
+
17
+ This program is free software; you can redistribute it and/or
18
+ modify it under the terms of the GNU General Public License
19
+ version 2 as published by the Free Software Foundation.
20
+
21
+ This program is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
+
26
+ You should have received a copy of the GNU General Public License
27
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
28
+ */
29
+
30
+ /**
31
+ * Abtract class to be used as a theme template.
32
+ * Must be implemented before using this class.
33
+ * There are some special functions that have to be declared in implementations to perform main actions:
34
+ * - moduleLoad (Protected) Additional actions to be run at module load time.
35
+ * - defaultOptions (Protected) Returns the module default options.
36
+ * - widgetsInit (Public) Runs at 'widgets_init' action.
37
+ * - wpInit (Public) Runs at 'init' action.
38
+ * - adminMenus (Public) Runs at 'admin_menus' option, used to set admin menus and page options.
39
+ *
40
+ * @author Jordi Canals
41
+ * @package Alkivia
42
+ * @subpackage Framework
43
+ * @link http://wiki.alkivia.org/framework/classes/module
44
+ *
45
+ * @uses akSettings
46
+ */
47
+
48
+ abstract class akModuleAbstract
49
+ {
50
+ /**
51
+ * Module ID. Is the module internal short name.
52
+ * Filled in constructor (as a constructor param). Used for translations textdomain.
53
+ *
54
+ * @var string
55
+ */
56
+ public $ID;
57
+
58
+ /**
59
+ * Component parent ID.
60
+ * Used only for components.
61
+ *
62
+ * @var string
63
+ */
64
+ public $PID = '';
65
+
66
+ /**
67
+ * Module version number.
68
+ *
69
+ * @since 0.8
70
+ *
71
+ * @var string
72
+ */
73
+ public $version;
74
+
75
+ /**
76
+ * Module Type using a class constant: self::PLUGIN, self::COMPONENT, seelf::THEME, self::CHILD_THEME
77
+ * By default is set to 0 (unknown).
78
+ *
79
+ * @var int
80
+ */
81
+ protected $mod_type = 0;
82
+
83
+ /**
84
+ * Full path to module main file.
85
+ * Main file is 'style.css' for themes and the php file with data header for plugins and components.
86
+ *
87
+ * @var string
88
+ */
89
+ protected $mod_file;
90
+
91
+ /**
92
+ * URL to the module folder.
93
+ *
94
+ * @var string
95
+ */
96
+ protected $mod_url;
97
+
98
+ /**
99
+ * Module data. Readed from the main plugin file header and the readme file.
100
+ * Filled in loadModuleData(). Called in constructor.
101
+ * From the filename:
102
+ * - 'ID' - Module internal short name. Taken from main module's file name.
103
+ * From themes style.css file header:
104
+ * - 'Name' - Name of the theme.
105
+ * - 'Title' - Long title for the theme. As WP 2.8 is the same as 'Name'.
106
+ * - 'URI' - Theme's page URI.
107
+ * - 'Description' - Description of theme's features.
108
+ * - 'Author' - Author name and link (to author home).
109
+ * - 'Version' - Theme Version number.
110
+ * - 'Template' - The parent theme (If this is a child theme).
111
+ * - 'Tags' - An array of theme tags features.
112
+ * From plugins file header:
113
+ * - 'Name' - Name of the plugin, must be unique.
114
+ * - 'Title' - Title of the plugin and the link to the plugin's web site.
115
+ * - 'Description' - Description of what the plugin does and/or notes from the author.
116
+ * - 'Author' - The author's name
117
+ * - 'AuthorURI' - The author's web site address.
118
+ * - 'Version' - The plugin's version number.
119
+ * - 'PluginURI' - Plugin's web site address.
120
+ * - 'TextDomain' - Plugin's text domain for localization.
121
+ * - 'DomainPath' - Plugin's relative directory path to .mo files.
122
+ * From readme.txt file :
123
+ * - 'Contributors' - An array with all contributors nicknames.
124
+ * - 'Tags' - An array with all plugin tags.
125
+ * - 'DonateURI' - The donations page address.
126
+ * - 'Requires' - Minimum required WordPress version.
127
+ * - 'Tested' - Higher WordPress version this plugin has been tested.
128
+ * - 'Stable' - Last stable tag when this was released.
129
+ *
130
+ * @var array
131
+ */
132
+ protected $mod_data;
133
+
134
+ /**
135
+ * Same as $mod_data but for child themes and components.
136
+ *
137
+ * From the Component file:
138
+ * - 'File' - FileName of the component (relative to plugin's folder).
139
+ * From componets file header:
140
+ * - 'File' - The component filename, relative to the plugin folder.
141
+ * - 'Component' - The component short name or ID.
142
+ * - 'Name' - Descriptive name for the component.
143
+ * - 'Description' - A descriptive text about the component.
144
+ * - 'Author' - Component author name
145
+ * - 'URL' - Author homepage URL.
146
+ * - 'Link' - Author anchor to home page.
147
+ * - 'Core' - If this is a core compoment or not.
148
+ * - 'Version' - Component version number.
149
+ * From readme.txt file:
150
+ * - Same as seen on akModuleAbstract::mod_data.
151
+ * From child themes file header:
152
+ * - Same as seen on akModuleAbstract::mod_data for themes.
153
+ *
154
+ * @var array
155
+ */
156
+ protected $child_data = array();
157
+
158
+ /**
159
+ * Theme saved data.
160
+ * - 'post' - Saves the current post.
161
+ * - 'more' - Saves the read more status.
162
+ *
163
+ * @var array
164
+ */
165
+ protected $saved;
166
+
167
+ /**
168
+ * Holds a reference to the global 'settings' object.
169
+ * This object has been created on the framework loader.
170
+ *
171
+ * @var akSettings
172
+ */
173
+ protected $cfg;
174
+
175
+ /**
176
+ * Flag to see if we are installing (activating for first time) or reactivating the module.
177
+ *
178
+ * @var boolean
179
+ */
180
+ protected $installing = false;
181
+
182
+ /**
183
+ * Flag to see if module needs to be updated.
184
+ *
185
+ * @var boolean
186
+ */
187
+ protected $needs_update = false;
188
+
189
+ /** Constant used to define module as plugin. */
190
+ const PLUGIN = 10;
191
+
192
+ /** Constant used to define module as component. */
193
+ const COMPONENT = 15;
194
+
195
+ /** Constant used to define module as theme. */
196
+ const THEME = 20;
197
+
198
+ /** Constant used to define module as child theme. */
199
+ const CHILD_THEME = 25;
200
+
201
+ /**
202
+ * Class constructor.
203
+ * Calls the implementated method 'startUp' if it exists. This is done at theme's loading time.
204
+ * Prepares admin menus by setting an action for the implemented method '_adminMenus' if it exists.
205
+ *
206
+ * @param string $type Module type. Must be one of 'plugin', 'component', 'theme'. (child themes are detected).
207
+ * @param string $ID Theme internal short name (known as theme ID).
208
+ * @param string $file Module file. Only for plugins and components. (For themes style.css is always used).
209
+ * @return akTheme
210
+ */
211
+ public function __construct ( $type = '', $ID = '', $file = '' )
212
+ {
213
+ $this->cfg =& ak_settings_object();
214
+
215
+ switch ( strtolower($type) ) {
216
+ case 'plugin' :
217
+ $this->mod_type = self::PLUGIN;
218
+ $this->mod_file = trim($file);
219
+ break;
220
+ case 'component' :
221
+ $this->mod_type = self::COMPONENT;
222
+ $this->mod_file = trim($file);
223
+ break;
224
+ case 'theme' :
225
+ $this->mod_type = self::THEME;
226
+ $this->mod_file = STYLESHEETPATH . '/style.css';
227
+ break;
228
+ default:
229
+ $this->mod_type = 0; // Unknown.
230
+ }
231
+
232
+ $this->loadModuleData($ID);
233
+ if ( $this->isCompatible() ) {
234
+ add_action('init', array($this, 'systemInit'));
235
+ add_action('plugins_loaded', array($this, 'pluginsInit'));
236
+ add_action('widgets_init', array($this, 'widgetsInit'));
237
+
238
+ if ( ! apply_filters('ak_' . $this->ID . '_disable_admin', $this->getOption('disable-admin-page')) ) {
239
+ add_action('admin_menu', array($this, 'adminMenus'), 5); // execute prior to PP, to use menu hook
240
+ }
241
+
242
+ // Load styles
243
+ if ( is_admin() ) {
244
+ add_action('admin_print_styles', array($this, 'adminStyles'));
245
+ } else {
246
+ add_action('wp_print_styles', array($this, 'enqueueStyles'));
247
+ }
248
+
249
+ $this->moduleLoad();
250
+ }
251
+ }
252
+
253
+ /**
254
+ * Executes as soon as module class is loaded.
255
+ *
256
+ * @return void
257
+ */
258
+ protected function moduleLoad() {}
259
+
260
+ /**
261
+ * Prepares and returns default module options.
262
+ *
263
+ * @return array Options array
264
+ */
265
+ protected function defaultOptions()
266
+ {
267
+ return array();
268
+ }
269
+
270
+ /**
271
+ * Fires at 'widgets_init' action hook
272
+ *.
273
+ * @return void
274
+ */
275
+ public function widgetsInit () {}
276
+
277
+ /**
278
+ * Fires at 'init' action hook.
279
+ *
280
+ * @return void
281
+ */
282
+ protected function wpInit () {}
283
+
284
+ /**
285
+ * Fires at 'admin_menus' action hook.
286
+ *
287
+ * @return void
288
+ */
289
+ public function adminMenus () {}
290
+
291
+ /**
292
+ * Dummy method provided to check additional WP compatibility on inplementations.
293
+ * This is mostly used on plugins to check for WordPress required version.
294
+ *
295
+ * @return boolean
296
+ */
297
+ public function isCompatible ()
298
+ {
299
+ return true;
300
+ }
301
+
302
+ /**
303
+ * Loads module data.
304
+ * Loads different data for Plugin, Theme or Component.
305
+ *
306
+ * @return void
307
+ */
308
+ abstract protected function loadData ();
309
+
310
+ /**
311
+ * Functions to execute at system Init.
312
+ *
313
+ * @hook action 'init'
314
+ * @access private
315
+ *
316
+ * @return void
317
+ */
318
+ final function systemInit ()
319
+ {
320
+ switch ( $this->mod_type ) {
321
+ case self::CHILD_THEME :
322
+ load_theme_textdomain('akchild', STYLESHEETPATH . '/lang');
323
+ case self::THEME :
324
+ load_theme_textdomain('aktheme', TEMPLATEPATH . '/lang');
325
+ break;
326
+ }
327
+
328
+ $this->wpInit();
329
+ }
330
+
331
+ /**
332
+ * Functions to execute after loading plugins.
333
+ *
334
+ * @return void
335
+ */
336
+ final function pluginsInit ()
337
+ {
338
+ switch ( $this->mod_type ) {
339
+ case self::PLUGIN :
340
+ load_plugin_textdomain($this->ID, false, basename(dirname($this->mod_file)) . '/lang');
341
+ break;
342
+ case self::COMPONENT :
343
+ // TODO: Manage components translations.
344
+ break;
345
+ }
346
+
347
+ }
348
+
349
+ /**
350
+ * Enqueues additional administration styles.
351
+ * Send the framework admin.css file and additionally any other admin.css file
352
+ * found on the module direcotry.
353
+ *
354
+ * @hook action 'admin_print_styles'
355
+ * @uses apply_filters() Calls the 'ak_framework_style_admin' filter on the framework style url.
356
+ * @uses apply_filters() Calls the 'ak_<Mod_ID>_style_admin' filter on the style url.
357
+ * @access private
358
+ *
359
+ * @return void
360
+ */
361
+ final function adminStyles()
362
+ {
363
+ // FRAMEWORK admin styles.
364
+ $url = apply_filters('ak_framework_style_admin', AK_STYLES_URL . '/admin.css');
365
+ if ( ! empty($url) ) {
366
+ wp_register_style('ak_framework_admin', $url, false, get_option('ak_framework_version'));
367
+ wp_enqueue_style('ak_framework_admin');
368
+ }
369
+
370
+ // MODULE admin styles.
371
+ if ( $this->isChildTheme() && file_exists(STYLESHEETPATH . '/admin.css') ) {
372
+ $url = get_stylesheet_directory_uri() . '/admin.css';
373
+ } elseif ( $this->isTheme() && file_exists(TEMPLATEPATH . '/admin.css') ) {
374
+ $url = get_template_directory_uri() . '/admin.css';
375
+ } elseif ( file_exists(dirname($this->mod_file) . '/admin.css') ) {
376
+ $url = $this->mod_url . '/admin.css';
377
+ } else {
378
+ $url = '';
379
+ }
380
+
381
+ $url = apply_filters('ak_' . $this->ID . '_style_admin', $url);
382
+ if ( ! empty($url) ) {
383
+ wp_register_style('ak_' . $this->ID . '_admin', $url, array('ak_framework_admin'), $this->version);
384
+ wp_enqueue_style('ak_' . $this->ID . '_admin');
385
+ }
386
+ }
387
+
388
+ /**
389
+ * Enqueues additional styles for plugins and components.
390
+ * For themes no styles are enqueued as them are already sent by WP.
391
+ *
392
+ * @hook action 'wp_print_styles'
393
+ * @uses apply_filters() Calls the 'ak_<Mod_ID>_style_url' filter on the style url.
394
+ * @access private
395
+ *
396
+ * @return void
397
+ */
398
+ final function enqueueStyles()
399
+ {
400
+ if ( $this->isTheme() || $this->getOption('disable-module-styles') ) {
401
+ return;
402
+ }
403
+
404
+ $url = $this->getOption('style-url', false);
405
+ if ( false === $url ) {
406
+ if ( file_exists(dirname($this->mod_file) . '/style.css') ) {
407
+ $url = $this->mod_url . '/style.css';
408
+ } else {
409
+ $url = '';
410
+ }
411
+ }
412
+
413
+ $url = apply_filters('ak_' . $this->ID . '_style_url', $url);
414
+ if ( ! empty($url) ) {
415
+ wp_register_style('ak_' . $this->ID, $url, false, $this->version);
416
+ wp_enqueue_style('ak_' . $this->ID);
417
+ }
418
+ }
419
+
420
+ /**
421
+ * Checks if current module is a Plugin.
422
+ * @return boolean
423
+ */
424
+ final public function isPlugin()
425
+ {
426
+ return ( self::PLUGIN == $this->mod_type ) ? true : false;
427
+ }
428
+
429
+ /**
430
+ * Checks if current module is a Component.
431
+ * @return boolean
432
+ */
433
+ final public function isComponent()
434
+ {
435
+ return ( self::COMPONENT == $this->mod_type ) ? true : false;
436
+ }
437
+
438
+ /**
439
+ * Checks if current module is a Theme (or child)
440
+ * @return boolean
441
+ */
442
+ final public function isTheme()
443
+ {
444
+ return ( self::THEME == $this->mod_type || self::CHILD_THEME == $this->mod_type ) ? true : false;
445
+ }
446
+
447
+ /**
448
+ * Checks if current module is a child theme.
449
+ * @return boolean
450
+ */
451
+ final public function isChildTheme()
452
+ {
453
+ return ( self::CHILD_THEME == $this->mod_type ) ? true : false;
454
+ }
455
+
456
+ /**
457
+ * Returns a module option.
458
+ * If no specific option is requested, returns all options.
459
+ * If requested a non existent settings, returns $default.
460
+ *
461
+ * @param $name Name for the option to return.
462
+ * @param $default Default value to use if the option does not exists.
463
+ * @return mixed The option's value or an array with all options.
464
+ */
465
+ final public function getOption ( $name = '', $default = false )
466
+ {
467
+ return $this->cfg->getSetting($this->ID, $name, $default);
468
+ }
469
+
470
+ /**
471
+ * Updates a module option.
472
+ *
473
+ * @param string $name Option Name
474
+ * @param mixed $value Option value
475
+ * @return void
476
+ */
477
+ final public function updateOption ( $name, $value )
478
+ {
479
+ $this->cfg->updateOption($this->ID, $name, $value );
480
+ }
481
+
482
+ /**
483
+ * Deletes a module option.
484
+ *
485
+ * @param string $name Option Name
486
+ * @return void
487
+ */
488
+ final public function deleteOption( $name )
489
+ {
490
+ $this->cfg->deleteOption($this->ID, $name);
491
+ }
492
+
493
+ /**
494
+ * Merges new options into module settings.
495
+ * Replaces exsisting ones and adds new ones.
496
+ *
497
+ * @since 0.7
498
+ *
499
+ * @param array $options New options to merge into settings.
500
+ * @return void
501
+ */
502
+ final protected function mergeOptions ( $options )
503
+ {
504
+ $current = $this->cfg->getSetting($this->ID);
505
+ $new_opt = array_merge($current, $options);
506
+ $this->cfg->replaceOptions($this->ID, $new_opt);
507
+ }
508
+
509
+ /**
510
+ * Replaces ALL module options by new ones.
511
+ *
512
+ * @param array $options Array with all options pairs (name=>value)
513
+ * @return void
514
+ */
515
+ final public function setNewOptions ( $options )
516
+ {
517
+ $this->cfg->replaceOptions($this->ID, $options);
518
+ }
519
+
520
+ /**
521
+ * Returns current module default options.
522
+ *
523
+ * @since 0.7
524
+ *
525
+ * @return array Default module options.
526
+ */
527
+ final protected function getDefaults ()
528
+ {
529
+ $this->cfg->getDefaults($this->ID);
530
+ }
531
+
532
+ /**
533
+ * Replaces current module defaults by new ones.
534
+ *
535
+ * @since 0.7
536
+ *
537
+ * @param array $options New default options-
538
+ * @return void
539
+ */
540
+ final protected function setDefaults ( $options )
541
+ {
542
+ $this->cfg->setDefaults($this->ID, $options);
543
+ }
544
+
545
+ /**
546
+ * Merges new options into module defaults.
547
+ * Replaces exsisting ones and adds new ones.
548
+ *
549
+ * @since 0.7
550
+ *
551
+ * @param array $options New options to merge into defaults.
552
+ * @return void
553
+ */
554
+ final protected function mergeDefaults ( $options )
555
+ {
556
+ $defaults = $this->cfg->getDefaults($this->ID);
557
+ $new_def = array_merge($defaults, $options);
558
+ $this->cfg->setDefaults($this->ID, $new_def);
559
+ }
560
+
561
+ /**
562
+ * Returns module data.
563
+ * This data is loaded from the main module file.
564
+ *
565
+ * @see akModuleAbstract::$mod_data
566
+ * @return mixed The parameter requested or an array wil all data.
567
+ */
568
+ final public function getModData ( $name = '' )
569
+ {
570
+ if ( empty($name) ) {
571
+ return $this->mod_data;
572
+ } elseif ( isset( $this->mod_data[$name]) ) {
573
+ return $this->mod_data[$name];
574
+ } else {
575
+ return false;
576
+ }
577
+ }
578
+
579
+ /**
580
+ * Returns child module data.
581
+ * This data is loaded from the child module file.
582
+ *
583
+ * @see akModuleAbstract::$child_data
584
+ * @return mixed The parameter requested or an array wil all data.
585
+ */
586
+ final public function getChildData ( $name = '' )
587
+ {
588
+ if ( empty($name) ) {
589
+ return $this->child_data;
590
+ } elseif ( isset( $this->child_data[$name]) ) {
591
+ return $this->child_data[$name];
592
+ } else {
593
+ return false;
594
+ }
595
+ }
596
+
597
+ /**
598
+ * Checks if an option can be maneged on settings page.
599
+ * Looks at the alkivia.ini file and if set there, the option will be disabled.
600
+ *
601
+ * @param string|array $options Options names.
602
+ * @param boolean $show_notice Show a notice if disabled.
603
+ * @return boolean If administration is allowed or not.
604
+ */
605
+ final public function allowAdmin( $options, $show_notice = true )
606
+ {
607
+ foreach ( (array) $options as $option ) {
608
+ if ( ! $this->cfg->isForced($this->ID, $option) ) {
609
+ return true;
610
+ }
611
+ }
612
+
613
+ if ( $show_notice ) {
614
+ echo '<em>' . __('Option blocked by administrator.', 'akfw') . '</em>';
615
+ }
616
+ return false;
617
+ }
618
+
619
+ /**
620
+ * Loads module data and settings.
621
+ * Data is loaded from the module file headers. Settings from Database and alkivia.ini.
622
+ *
623
+ * @return void
624
+ */
625
+ final private function loadModuleData ( $id )
626
+ {
627
+ $this->loadData();
628
+ switch ( $this->mod_type ) {
629
+ case self::PLUGIN :
630
+ $this->mod_url = plugins_url() . '/' . basename(dirname($this->mod_file));
631
+ $this->ID = ( empty($id) ) ? strtolower(basename($this->mod_file, '.php')) : trim($id) ;
632
+ break;
633
+ case self::THEME :
634
+ case self::CHILD_THEME :
635
+ $this->mod_url = get_stylesheet_directory_uri();
636
+ $this->ID = ( empty($id) ) ? strtolower(basename(TEMPLATEPATH)) : trim($id) ;
637
+ break;
638
+ case self::COMPONENT :
639
+ $this->mod_url = ak_get_object($this->PID)->getUrl() . 'components/' . basename(dirname($this->mod_file));
640
+ $this->ID = $this->PID . '_' . $this->child_data['Component'];
641
+ break;
642
+ }
643
+ $this->cfg->setDefaults($this->ID, $this->defaultOptions());
644
+
645
+ $old_version = get_option($this->ID . '_version');
646
+ if ( false === $old_version ) {
647
+ $this->installing = true;
648
+ } elseif ( version_compare($old_version, $this->version, 'ne') ) {
649
+ $this->needs_update = true;
650
+ }
651
+ }
652
+
653
+ /**
654
+ * Saves the current post state.
655
+ * Used if we are looping a new query to reset previous state.
656
+ *
657
+ * @return void
658
+ */
659
+ final public function savePost()
660
+ {
661
+ global $post, $more;
662
+
663
+ $this->saved['post'] = $post;
664
+ $this->saved['more'] = $more;
665
+ }
666
+
667
+ /**
668
+ * Restores the current post state.
669
+ * Saved in savePost()
670
+ *
671
+ * @return void
672
+ */
673
+ final public function restorePost()
674
+ {
675
+ global $post, $more;
676
+
677
+ $more = $this->saved['more'];
678
+ $post = $this->saved['post'];
679
+ if ( $post ) {
680
+ setup_postdata($post);
681
+ }
682
+ }
683
+
684
+ /**
685
+ * Returns the URL to the module folder.
686
+ *
687
+ * @return string Absolute URL to the module folder.
688
+ */
689
+ final public function getURL()
690
+ {
691
+ return trailingslashit($this->mod_url);
692
+ }
693
+
694
+ /**
695
+ * Returns the absolute path to module direcotory.
696
+ *
697
+ * @since 0.7
698
+ *
699
+ * @return string Full absolute path to module directory.
700
+ */
701
+ final public function getPath()
702
+ {
703
+ return trailingslashit(dirname($this->mod_file));
704
+ }
705
+
706
+ /**
707
+ * Returns the basename for the plugin folder.
708
+ *
709
+ * @since 0.7
710
+ *
711
+ * @return string Plugin folder name (Relative to wp-content/plugins or wp-content/themes.
712
+ */
713
+ final public function getSlug()
714
+ {
715
+ $folder = basename(dirname($this->mod_file));
716
+ return $folder;
717
+ }
718
+ }
framework/classes/abstract/plugin.php ADDED
@@ -0,0 +1,473 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugins related functions and classes.
4
+ *
5
+ * @version $Rev: 203758 $
6
+ * @author Jordi Canals
7
+ * @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
8
+ * @license GNU General Public License version 2
9
+ * @link http://alkivia.org
10
+ * @package Alkivia
11
+ * @subpackage Framework
12
+ *
13
+
14
+ Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
15
+
16
+ This program is free software; you can redistribute it and/or
17
+ modify it under the terms of the GNU General Public License
18
+ version 2 as published by the Free Software Foundation.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+
29
+ require_once ( AK_CLASSES . '/abstract/module.php' );
30
+
31
+ /**
32
+ * Abtract class to be used as a plugin template.
33
+ * Must be implemented before using this class and it's recommended to prefix the class to prevent collissions.
34
+ * There are some special functions that have to be declared in implementations to perform main actions:
35
+ * - pluginActivate (Protected) Actions to run when activating the plugin.
36
+ * - pluginDeactivate (Protected) Actions to run when deactivating the plugin.
37
+ * - pluginUpdate (Protected) Actions to update the plugin to a new version. (Updating version on DB is done after this).
38
+ * Takes plugin running version as a parameter.
39
+ * - pluginsLoaded (Protected) Runs at 'plugins_loaded' action hook.
40
+ * - registerWidgets (Protected) Runs at 'widgets_init' action hook.
41
+ *
42
+ * @author Jordi Canals
43
+ * @package Alkivia
44
+ * @subpackage Framework
45
+ * @link http://wiki.alkivia.org/framework/classes/plugin
46
+ */
47
+ abstract class akPluginAbstract extends akModuleAbstract
48
+ {
49
+ /**
50
+ * Holds the installed and active components.
51
+ * @var array
52
+ */
53
+ private $components = false;
54
+
55
+ /**
56
+ * Class constructor.
57
+ * Calls the implementated method 'startUp' if it exists. This is done at plugins loading time.
58
+ * Prepares admin menus by seting an action for the implemented method '_adminMenus' if it exists.
59
+ *
60
+ * @param string $mod_file Full main plugin's filename (absolute to root).
61
+ * @param string $ID Plugin short name (known as plugin ID).
62
+ * @return spostsPlugin|false The plugin object or false if not compatible.
63
+ */
64
+ public function __construct( $mod_file, $ID = '' )
65
+ {
66
+ parent::__construct('plugin', $ID, $mod_file);
67
+
68
+ if ( $this->isCompatible() ) {
69
+ // Activation and deactivation hooks.
70
+ register_activation_hook($this->mod_file, array($this, 'activate'));
71
+ register_deactivation_hook($this->mod_file, array($this, 'deactivate'));
72
+
73
+ add_action('plugins_loaded', array($this, 'init'));
74
+ }
75
+ }
76
+
77
+ /**
78
+ * Fires on plugin activation.
79
+ * @return void
80
+ */
81
+ protected function pluginActivate () {}
82
+
83
+ /**
84
+ * Fires on plugin deactivation.
85
+ * @return void
86
+ */
87
+ protected function pluginDeactivate () {}
88
+
89
+ /**
90
+ * Updates the plugin to a new version.
91
+ * @param string $version Old plugin version.
92
+ * @return void
93
+ */
94
+ protected function pluginUpdate ( $version ) {}
95
+
96
+ /**
97
+ * Fires when plugins have been loaded.
98
+ * @return void
99
+ */
100
+ protected function pluginsLoaded () {}
101
+
102
+ /**
103
+ * Fires on Widgets init.
104
+ * @return void
105
+ */
106
+ protected function registerWidgets () {}
107
+
108
+ /**
109
+ * Allows to check if plugin is ready to load components on implementations.
110
+ * Overwrite this method and return true to load components, false to omit components load.
111
+ *
112
+ * @return boolean If components can be loaded or not.
113
+ */
114
+ protected function readyForComponents ()
115
+ {
116
+ return false;
117
+ }
118
+
119
+ /**
120
+ * Activates the plugin. Only runs on first activation.
121
+ * Saves the plugin version in DB, and calls the 'pluginActivate' method.
122
+ *
123
+ * @uses do_action() Calls 'ak_activate_<modID>_plugin' action hook.
124
+ * @hook register_activation_hook
125
+ * @access private
126
+ * @return void
127
+ */
128
+ final function activate()
129
+ {
130
+ $this->pluginActivate();
131
+
132
+ // Save options and version
133
+ $this->cfg->saveOptions($this->ID);
134
+ add_option($this->ID . '_version', $this->version);
135
+
136
+ // Load and activate plugin components.
137
+ $this->components = ak_get_installed_components($this->componentsPath(), true);
138
+ if ( empty($this->components) ) {
139
+ $this->components = false;
140
+ } else {
141
+ foreach ( $this->components as $id => $component ) {
142
+ if ( $component['Core'] ) {
143
+ require_once( $component['File'] );
144
+ do_action('ak_activate_' . $this->ID . '_' . $id);
145
+ $this->components[$id]['active'] = 1;
146
+ } else {
147
+ $this->components[$id]['active'] = 0;
148
+ }
149
+ }
150
+ update_option($this->ID . '_components', $this->components);
151
+ }
152
+
153
+ // Do activated hook.
154
+ do_action('ak_activate_' . $this->ID . '_plugin');
155
+ }
156
+
157
+ /**
158
+ * Deactivates the plugin.
159
+ *
160
+ * @uses do_action() Calls 'ak_deactivate_<modID>_plugin' action hook.
161
+ * @hook register_deactivation_hook
162
+ * @access private
163
+ * @return void
164
+ */
165
+ final function deactivate()
166
+ {
167
+ $this->pluginDeactivate();
168
+ do_action('ak_deactivate_' . $this->ID . '_plugin');
169
+ }
170
+
171
+ /**
172
+ * Init the plugin (In action 'plugins_loaded')
173
+ * Here whe call the 'pluginUpdate' and 'pluginsLoaded' methods.
174
+ * Also the plugin version and settings are updated here.
175
+ *
176
+ * @hook action plugins_loaded
177
+ * @uses do_action() Calls the 'ak_<modID>_updated' action hook.
178
+ *
179
+ * @access private
180
+ * @return void
181
+ */
182
+ final function init()
183
+ {
184
+ // First, check if the plugin needs to be updated.
185
+ if ( $this->needs_update ) {
186
+ $version = get_option($this->ID . '_version');
187
+ $this->pluginUpdate($version);
188
+
189
+ $this->cfg->saveOptions($this->ID);
190
+ update_option($this->ID . '_version', $this->version);
191
+
192
+ $this->searchNewComponents();
193
+ do_action('ak_' . $this->ID . '_updated');
194
+ }
195
+
196
+ $this->pluginsLoaded();
197
+ $this->loadComponents();
198
+ }
199
+
200
+ /**
201
+ * Loads plugin components if found.
202
+ *
203
+ * @return void
204
+ */
205
+ final function loadComponents()
206
+ {
207
+ if ( ! $this->readyForComponents() ) {
208
+ return;
209
+ }
210
+
211
+ $this->components = get_option($this->ID . '_components');
212
+ if ( ! is_array($this->components) ) {
213
+ return;
214
+ }
215
+
216
+ foreach ( $this->components as $component ) {
217
+ if ( $component['active'] ) {
218
+ require_once ( $component['File']);
219
+ }
220
+ }
221
+
222
+ do_action('ak_' . $this->ID . '_components_init');
223
+ }
224
+
225
+ /**
226
+ * Reloads and updates installed components.
227
+ * If a new core component is found, it will be activated automatically.
228
+ *
229
+ * @return void
230
+ */
231
+ private function searchNewComponents ()
232
+ {
233
+ $components = ak_get_installed_components($this->componentsPath(), true);
234
+ if ( empty($components) ) {
235
+ $this->components = false;
236
+ return;
237
+ }
238
+
239
+ $installed = array();
240
+ $core = array();
241
+ $optional = array();
242
+
243
+ // Sort components by core and optional. Then by name.
244
+ foreach ( $components as $id => $component ) {
245
+ if ( $component['Core'] ) {
246
+ $core[$id] = $component;
247
+ } else {
248
+ $optional[$id] = $component;
249
+ }
250
+ }
251
+ ksort($core); ksort($optional); // Sort components by ID.
252
+ $components = array_merge($core, $optional);
253
+
254
+ // Now, activate new core components, and set activation for optional.
255
+ $this->components = get_option($this->ID . '_components');
256
+ foreach ( $components as $id => $component ) {
257
+ $installed[$id] = $component;
258
+ if ( $component['Core'] ) {
259
+ $installed[$id]['active'] = 1;
260
+ if ( ! isset($this->components[$id]) || ! $this->components[$id]['active'] ) {
261
+ require_once( $component['File']);
262
+ do_action('ak_activate_' . $this->ID . '_' . $id);
263
+ }
264
+ } else {
265
+ if ( isset($this->components[$id]['active']) ) {
266
+ $installed[$id]['active'] = $this->components[$id]['active'];
267
+ } else {
268
+ $installed[$id]['active'] = 0;
269
+ }
270
+ }
271
+ }
272
+
273
+ $this->components = $installed;
274
+ update_option($this->ID . '_components', $this->components);
275
+ }
276
+
277
+ /**
278
+ * Checks if a component is installed and active.
279
+ *
280
+ * @return boolean If the component is active or not.
281
+ */
282
+ public function activeComponent ( $name )
283
+ {
284
+ if ( ! is_array($this->components) ) {
285
+ return false;
286
+ }
287
+
288
+ $name = strtolower($name);
289
+ if ( isset($this->components[$name]) && $this->components[$name]['active'] ) {
290
+ return true;
291
+ } else {
292
+ return false;
293
+ }
294
+ }
295
+
296
+ /**
297
+ * Inits the widgets (In action 'widgets_init')
298
+ * Before loading the widgets, we check that standard sidebar is present.
299
+ *
300
+ * @hook action 'widgets_init'
301
+ * @return void
302
+ */
303
+ final function widgetsInit()
304
+ {
305
+ if ( class_exists('WP_Widget') && function_exists('register_widget') && function_exists('unregister_widget') ) {
306
+ $this->registerWidgets();
307
+ do_action('ak_' . $this->ID . '_widgets_init');
308
+ } else {
309
+ add_action('admin_notices', array($this, 'noSidebarWarning'));
310
+ }
311
+ }
312
+
313
+ /**
314
+ * Checks if the plugin is compatible with the current WordPress version.
315
+ * If it's not compatible, sets an admin warning.
316
+ *
317
+ * @return boolean Plugin is compatible with this WordPress version or not.
318
+ */
319
+ final public function isCompatible()
320
+ {
321
+ global $wp_version;
322
+
323
+ if ( version_compare($wp_version, $this->mod_data['Requires'] , '>=') ) {
324
+ return true;
325
+ } elseif ( ! has_action('admin_notices', array($this, 'noCompatibleWarning')) ) {
326
+ add_action('admin_notices', array($this, 'noCompatibleWarning'));
327
+ }
328
+
329
+ return false;
330
+ }
331
+
332
+ /**
333
+ * Shows a warning message when the plugin is not compatible with current WordPress version.
334
+ * This is used by calling the action 'admin_notices' in isCompatible()
335
+ *
336
+ * @hook action admin_notices
337
+ * @access private
338
+ * @return void
339
+ */
340
+ final function noCompatibleWarning()
341
+ {
342
+ $this->loadTranslations(); // We have not loaded translations yet.
343
+
344
+ echo '<div class="error"><p><strong>' . __('Warning:', 'akfw') . '</strong> '
345
+ . sprintf(__('The active plugin %s is not compatible with your WordPress version.', 'akfw'),
346
+ '&laquo;' . $this->mod_data['Name'] . ' ' . $this->version . '&raquo;')
347
+ . '</p><p>' . sprintf(__('WordPress %s is required to run this plugin.', 'akfw'), $this->mod_data['Requires'])
348
+ . '</p></div>';
349
+ }
350
+
351
+ /**
352
+ * Shows an admin warning when not using the WordPress standard sidebar.
353
+ * This is done by calling the action 'admin_notices' in isStandardSidebar()
354
+ *
355
+ * @hook action admin_notices
356
+ * @access private
357
+ * @return void
358
+ */
359
+ final function noSidebarWarning()
360
+ {
361
+ $this->loadTranslations(); // We have not loaded translations yet.
362
+
363
+ echo '<div class="error"><p><strong>' . __('Warning:', $this->ID) . '</strong> '
364
+ . __('Standard sidebar functions are not present.', $this->ID) . '</p><p>'
365
+ . sprintf(__('It is required to use the standard sidebar to run %s', $this->ID),
366
+ '&laquo;' . $this->mod_data['Name'] . ' ' . $this->version . '&raquo;')
367
+ . '</p></div>';
368
+ }
369
+
370
+ /**
371
+ * Loads plugins data.
372
+ *
373
+ * @return void
374
+ */
375
+ final protected function loadData()
376
+ {
377
+ if ( empty($this->mod_data) ) {
378
+ if ( ! function_exists('get_plugin_data') ) {
379
+ require_once ( ABSPATH . 'wp-admin/includes/plugin.php' );
380
+ }
381
+
382
+ $plugin_data = get_plugin_data($this->mod_file);
383
+ $readme_data = ak_module_readme_data($this->mod_file);
384
+ $this->mod_data = array_merge($readme_data, $plugin_data);
385
+
386
+ $this->version = $this->mod_data['Version'];
387
+ }
388
+ }
389
+
390
+ /**
391
+ * Returns the path to plugin components.
392
+ *
393
+ * @uses apply_filters() Applies the ak_<plugin>_components_path filter on default path.
394
+ * @return string Path to components directory.
395
+ */
396
+ final protected function componentsPath ()
397
+ {
398
+ $path = dirname($this->mod_file) . '/components';
399
+ return apply_filters('ak_' . $this->ID . '_components_path', $path);
400
+ }
401
+
402
+ /**
403
+ * Form part to activate/deactivate plugin components.
404
+ * To be included on other configuration or settings form.
405
+ * String for component name and description have to be included on plugin text_domain.
406
+ *
407
+ * @return void
408
+ */
409
+ final protected function componentActivationForm ()
410
+ {
411
+ if ( $this->getOption('disable-components-activation') ) {
412
+ return;
413
+ }
414
+
415
+ $this->searchNewComponents();
416
+ ?>
417
+ <dl>
418
+ <dt><?php _e('Activate Components', 'akfw'); ?></dt>
419
+ <dd>
420
+ <?php wp_nonce_field('ak-component-activation', '_aknonce', false); ?>
421
+ <table width="100%" class="form-table">
422
+ <?php foreach ( $this->components as $c) :
423
+ if ( ! $c['Core'] ) : ?>
424
+ <tr>
425
+ <th scope="row"><?php _e($c['Name'], $this->ID) ?>:</th>
426
+ <td>
427
+ <input type="radio" name="components[<?php echo $c['Component']; ?>]" value="1" <?php checked(1, $c['active']); ?> /> <?php _e('Yes', 'akfw'); ?> &nbsp;&nbsp;
428
+ <input type="radio" name="components[<?php echo $c['Component']; ?>]" value="0" <?php checked(0, $c['active']); ?> /> <?php _e('No', 'akfw'); ?> &nbsp;&nbsp;
429
+ <span class="setting-description"><?php _e($c['Description'], $this->ID); ?></span>
430
+ </td>
431
+ </tr>
432
+ <?php endif;
433
+ endforeach; ?>
434
+ </table>
435
+ </dd>
436
+ </dl>
437
+ <?php
438
+ }
439
+
440
+ /**
441
+ * Saves data from componets activation form.
442
+ * Activates or deactivates components as requested by user.
443
+ *
444
+ * @return void
445
+ */
446
+ final protected function saveActivationForm ()
447
+ {
448
+ if ( $this->getOption('disable-components-activation') ) {
449
+ return;
450
+ }
451
+
452
+ check_admin_referer('ak-component-activation', '_aknonce');
453
+ if ( isset($_POST['action']) && 'update' == $_POST['action'] ) {
454
+ $post = stripslashes_deep($_POST['components'] );
455
+ $this->components = get_option($this->ID . '_components');
456
+ $this->searchNewComponents();
457
+
458
+ foreach ( $post as $name => $activate ) {
459
+ if ( $activate && ! $this->components[$name]['active'] ) {
460
+ require_once( $this->components[$name]['File']);
461
+ do_action('ak_activate_' . $this->ID . '_' . $name);
462
+ } elseif ( ! $activate && $this->components[$name]['active'] ) {
463
+ require_once( $this->components[$name]['File']);
464
+ do_action('ak_deactivate_' . $this->ID . '_' . $name);
465
+ }
466
+ $this->components[$name]['active'] = $activate;
467
+ }
468
+ update_option($this->ID . '_components', $this->components);
469
+ } else {
470
+ wp_die('Bad form received.', $this->ID);
471
+ }
472
+ }
473
+ }
framework/classes/abstract/theme.php ADDED
@@ -0,0 +1,273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class for Themes management.
4
+ *
5
+ * @version $Rev: 203758 $
6
+ * @author Jordi Canals
7
+ * @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
8
+ * @license GNU General Public License version 2
9
+ * @link http://alkivia.org
10
+ * @package Alkivia
11
+ * @subpackage Framework
12
+ *
13
+
14
+ Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
15
+
16
+ This program is free software; you can redistribute it and/or
17
+ modify it under the terms of the GNU General Public License
18
+ version 2 as published by the Free Software Foundation.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+
29
+ require_once ( AK_CLASSES . '/abstract/module.php' );
30
+
31
+ /**
32
+ * Abtract class to be used as a theme template.
33
+ * Must be implemented before using this class.
34
+ * There are some special functions that have to be declared in implementations to perform main actions:
35
+ * - themeInit (Protected) Runs as soon as theme has been loaded.
36
+ * - themeInstall (Protected) Runs at theme install time and fires on the 'init' action hook.
37
+ * - themeUpdate (Proetected) Runs at theme update and fires on the 'init' action hook.
38
+ * - themeSideBars (Protected) Runs at theme load time and used to register the theme sidebars.
39
+ *
40
+ * @author Jordi Canals
41
+ * @package Alkivia
42
+ * @subpackage Framework
43
+ * @link http://wiki.alkivia.org/framework/classes/theme
44
+ *
45
+ * @uses akSettings
46
+ */
47
+
48
+ abstract class akThemeAbstract extends akModuleAbstract
49
+ {
50
+ /**
51
+ * Class constructor.
52
+ * Calls the implementated method 'startUp' if it exists. This is done at theme's loading time.
53
+ * Prepares admin menus by setting an action for the implemented method '_adminMenus' if it exists.
54
+ *
55
+ * @uses do_action() Calls the 'ak_theme_loaded' action hook.
56
+ * @param string $ID Theme internal short name (known as theme ID).
57
+ * @return akTheme
58
+ */
59
+ public function __construct ( $ID = '' )
60
+ {
61
+ parent::__construct('theme', $ID);
62
+
63
+ if ( $this->installing ) {
64
+ $this->install();
65
+ }
66
+
67
+ if ( function_exists('register_sidebars') ) {
68
+ $this->themeSideBars();
69
+ }
70
+
71
+ $this->configureTheme();
72
+ do_action('ak_theme_loaded');
73
+ }
74
+
75
+ /**
76
+ * Inits the theme at WordPress 'init' action hook
77
+ * @return void
78
+ */
79
+ protected function themeInit () {}
80
+
81
+ /**
82
+ * Installs the theme.
83
+ * @return void
84
+ */
85
+ protected function themeInstall () {}
86
+
87
+ /**
88
+ * Performs additional actions to update the theme.
89
+ * @param string $version Theme current installed version.
90
+ * @return void
91
+ */
92
+ protected function themeUpdate ( $version ) {}
93
+
94
+ /**
95
+ * Registers and sets theme sidebars.
96
+ * @return void
97
+ */
98
+ protected function themeSideBars () {}
99
+
100
+ /**
101
+ * Configure the theme based on theme settings.
102
+ *
103
+ * @uses do_action() Calls the 'ak_theme_options_set' action hook.
104
+ * @return void
105
+ */
106
+ final private function configureTheme()
107
+ {
108
+ // Set metatags
109
+ add_action('wp_head', array($this, 'metaTags') );
110
+
111
+ // Set the theme favicon
112
+ if ( ! $this->getOption('disable-favicon') ) {
113
+ add_action('wp_head', array($this, 'favicon'));
114
+ add_action('admin_head', array($this, 'favicon'));
115
+ }
116
+
117
+ // Enable self ping.
118
+ if ( ! $this->getOption('enable-selfping') ) {
119
+ add_action('pre_ping', array($this, 'disableSelfPing'));
120
+ }
121
+
122
+ do_action('ak_theme_options_set');
123
+ }
124
+
125
+ /**
126
+ * Installs the theme.
127
+ * Saves the theme version in DB, and calls the 'install' method.
128
+ *
129
+ * @uses do_action() Calls the 'ak_theme_installed' action hook.
130
+ * @return void
131
+ */
132
+ final private function install ()
133
+ {
134
+ // If there is an additional function to perform on installation.
135
+ $this->themeInstall();
136
+
137
+ // Save options and version
138
+ $this->cfg->saveOptions($this->ID);
139
+ add_option($this->ID . '_version', $this->version);
140
+
141
+ do_action('ak_theme_installed');
142
+ }
143
+
144
+ /**
145
+ * Init the theme (In action 'init')
146
+ * Here whe call the 'themeUpdate' and 'themeInit' methods. This is done after the plugins are loaded.
147
+ * Also the theme version and settings are updated here.
148
+ *
149
+ * @uses do_action() Calls the 'ak_theme_updated' action hook.
150
+ * @hook action 'init'
151
+ * @access private
152
+ * @return void
153
+ */
154
+ final function wpInit ()
155
+ {
156
+ // Check if the module needs to be updated.
157
+ if ( $this->needs_update ) {
158
+ $version = get_option($this->ID . '_version');
159
+ $this->themeUpdate($version);
160
+
161
+ $this->cfg->saveOptions($this->ID);
162
+ update_option($this->ID . '_version', $this->version);
163
+
164
+ do_action('ak_theme_updated');
165
+ }
166
+
167
+ // Call the custom init for the theme when system is loaded.
168
+ $this->themeInit();
169
+ }
170
+
171
+ /**
172
+ * Inits the widgets (In action 'widgets_init')
173
+ * In own themes standard sidebar always will be present (No check needed).
174
+ *
175
+ * @hook action 'widgets_init'
176
+ * @access private
177
+ * @return void
178
+ */
179
+ final function widgetsInit ()
180
+ {
181
+ do_action('ak_theme_widgets_init');
182
+ }
183
+
184
+ /**
185
+ * Disables self pings.
186
+ * This will disable sending pings to our own blog.
187
+ *
188
+ * @author Michael D. Adams
189
+ * @link http://blogwaffe.com/2006/10/04/421/
190
+ * @version 0.2
191
+ * @hook action 'pre_ping'
192
+ * @param array $links Link list of URLs to ping.
193
+ */
194
+ final function disableSelfPing( &$links )
195
+ {
196
+ $home = get_option( 'home' );
197
+ foreach ( $links as $l => $link ) {
198
+ if ( 0 === strpos( $link, $home ) ) {
199
+ unset($links[$l]);
200
+ }
201
+ }
202
+ }
203
+
204
+ /**
205
+ * Sets the favicon for the theme.
206
+ *
207
+ * @uses apply_filters() Calls apply_filters with the 'ak_theme_favicon' hook and the favicon url as content.
208
+ * @hook actions 'wp_head' and 'admin_head'
209
+ * @access private
210
+ * @return void
211
+ */
212
+ final function favicon ()
213
+ {
214
+ $file = '/images/favicon.ico';
215
+ $favicon = $this->getOption('favicon-url');
216
+
217
+ if ( false === $favicon ) {
218
+ if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists(STYLESHEETPATH . $file) ) {
219
+ $favicon = get_stylesheet_directory_uri() . $file;
220
+ } elseif ( file_exists(TEMPLATEPATH . $file) ) {
221
+ $favicon = get_template_directory_uri() . $file;
222
+ } else {
223
+ $favicon = '';
224
+ }
225
+ }
226
+
227
+ $favicon = apply_filters('ak_theme_favicon', $favicon);
228
+ if ( ! empty($favicon) ) {
229
+ echo '<link rel="shortcut icon" href="' . $favicon . '" />' . PHP_EOL;
230
+ }
231
+ }
232
+
233
+ /**
234
+ * Adds meta names for parent and child themes to head.
235
+ *
236
+ * @hook action 'wp_head'
237
+ * @access private
238
+ * @return void
239
+ */
240
+ final function metaTags()
241
+ {
242
+ echo '<meta name="theme" content="'
243
+ . $this->getModData('Name') . ' ' . $this->getModData('Version') . '" />' . PHP_EOL;
244
+
245
+ if ( $this->isChildTheme() ) {
246
+ echo '<meta name="child_theme" content="'
247
+ . $this->getChildData('Name') . ' ' . $this->getChildData('Version') . '" />' . PHP_EOL;
248
+ }
249
+ }
250
+
251
+ /**
252
+ * Loads theme (and child) data.
253
+ *
254
+ * @return void
255
+ */
256
+ final protected function loadData()
257
+ {
258
+ $readme_data = ak_module_readme_data(TEMPLATEPATH . '/readme.txt');
259
+ if ( empty($this->mod_data) ) {
260
+ $theme_data = get_theme_data(TEMPLATEPATH . '/style.css');
261
+ $this->mod_data = array_merge($readme_data, $theme_data);
262
+ }
263
+
264
+ if ( TEMPLATEPATH !== STYLESHEETPATH && empty($this->child_data) ) {
265
+ $this->mod_type = self::CHILD_THEME;
266
+ $child_data = get_theme_data(STYLESHEETPATH . '/style.css');
267
+ $child_readme_data = ak_module_readme_data(STYLESHEETPATH . '/readme.txt');
268
+ $this->child_data = array_merge($readme_data, $child_readme_data, $child_data);
269
+ }
270
+
271
+ $this->version = $this->mod_data['Version'];
272
+ }
273
+ }
framework/classes/admin-notices.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Admin notices (or warnings).
4
+ *
5
+ * @version $Rev: 198515 $
6
+ * @author Jordi Canals
7
+ * @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
8
+ * @license GNU General Public License version 2
9
+ * @link http://alkivia.org
10
+ * @package Alkivia
11
+ * @subpackage Framework
12
+ *
13
+
14
+ Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
15
+
16
+ This program is free software; you can redistribute it and/or
17
+ modify it under the terms of the GNU General Public License
18
+ version 2 as published by the Free Software Foundation.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+
29
+ /**
30
+ * Class to show admin warnings (or notices)
31
+ * Throws the hook 'admin_notices' to show the warning only on allowed places.
32
+ * To use the class, just have to instantiate it as new akcAdminNotice('message').
33
+ *
34
+ * @author Jordi Canals
35
+ * @package Alkivia
36
+ * @subpackage Framework
37
+ *
38
+ * @link http://wiki.alkivia.org/framework/classes/admin-notice
39
+ */
40
+ class akAdminNotice
41
+ {
42
+ /**
43
+ * Warning message to be shown.
44
+ * @var string
45
+ */
46
+ private $message;
47
+
48
+ /**
49
+ * Class constructor.
50
+ * Gets the message, and sets the admin_notices hook.
51
+ *
52
+ * @param $message Message to show.
53
+ * @return aocAdminNotice
54
+ */
55
+ public function __construct( $message )
56
+ {
57
+ $this->message = $message;
58
+ add_action('admin_notices', array($this, '_showMessage') );
59
+ }
60
+
61
+ /**
62
+ * The hook function to display the warning.
63
+ *
64
+ * @return void
65
+ */
66
+ public function _showMessage()
67
+ {
68
+ echo '<div id="error" class="error"><p><strong>' . $this->message . '</strong></p></div>';
69
+ }
70
+ }
framework/classes/settings.php ADDED
@@ -0,0 +1,330 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Alkivia Settings Manager
4
+ *
5
+ * @version $Rev: 203758 $
6
+ * @author Jordi Canals
7
+ * @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
8
+ * @license GNU General Public License version 2
9
+ * @link http://alkivia.org
10
+ * @package Alkivia
11
+ * @subpackage Framework
12
+ *
13
+
14
+ Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
15
+
16
+ This program is free software; you can redistribute it and/or
17
+ modify it under the terms of the GNU General Public License
18
+ version 2 as published by the Free Software Foundation.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+
29
+ /**
30
+ * Class to manage settings.
31
+ * It is expected to receive all settings properly filtered.
32
+ *
33
+ * @author Jordi Canals
34
+ * @package Alkivia
35
+ * @subpackage Framework
36
+ * @link http://wiki.alkivia.org/framework/classes/settings
37
+ */
38
+ final class akSettings
39
+ {
40
+
41
+ /**
42
+ * Settings from alkivia.ini file
43
+ * This settings will be forced and cannot be set on the admin panel.
44
+ *
45
+ * @var array
46
+ */
47
+ private $forced = array();
48
+
49
+ /**
50
+ * Global settings for all Alkivia modules.
51
+ * This is a merge from the settings on db and settings on the ini file.
52
+ *
53
+ * @var array
54
+ */
55
+ private $settings = array();
56
+
57
+ /**
58
+ * Options retrieved from database and merged with defaults.
59
+ * This is what needs to be saved to database at end.
60
+ *
61
+ * @var array
62
+ */
63
+ private $options = array();
64
+
65
+ /**
66
+ * Default settings for all alkivia modules.
67
+ * This options are set at module startup and used if no other setting is found.
68
+ *
69
+ * @var array
70
+ */
71
+ private $defaults = array();
72
+
73
+ /**
74
+ * Flags to know if a setting has been updated or not.
75
+ * This is an array of flags, one item per module.
76
+ *
77
+ * @var array
78
+ */
79
+ private $updated = array();
80
+
81
+ /**
82
+ * Settings prefix and sufix for database entry.
83
+ */
84
+ const prefix = '';
85
+ const sufix = '_settings';
86
+
87
+ /**
88
+ * Class constructor.
89
+ * Loads settings from ini file.
90
+ *
91
+ * @return akSettings
92
+ */
93
+ public function __construct()
94
+ {
95
+ if ( defined('AK_INI_FILE') && file_exists(AK_INI_FILE) ) {
96
+ $this->forced = parse_ini_file(AK_INI_FILE, true);
97
+ }
98
+
99
+ add_action('shutdown', array($this, 'saveOptions'));
100
+ }
101
+
102
+ /**
103
+ * Populates module settings array.
104
+ * Merges into settings array, defaults and options retrieved from DB.
105
+ *
106
+ * @param string $module Module name to load.
107
+ * @return void
108
+ */
109
+ private function populateSettings ( $module )
110
+ {
111
+ if ( ! isset($this->defaults[$module]) ) {
112
+ $this->defaults[$module] = array();
113
+ }
114
+
115
+ if ( ! isset($this->options[$module]) ) {
116
+ $options = apply_filters('ak_' . $module . '_options', get_option(self::prefix . $module . self::sufix));
117
+
118
+ if ( is_array($options) ) {
119
+ $this->options[$module] = $options;
120
+ } else {
121
+ $this->options[$module] = array();
122
+ }
123
+ }
124
+
125
+ if ( ! isset($this->forced[$module]) ) {
126
+ $this->forced[$module] = array();
127
+ }
128
+
129
+ if ( ! isset($this->updated[$module]) ) {
130
+ $this->updated[$module] = false;
131
+ }
132
+
133
+ $this->options[$module] = array_merge(
134
+ $this->defaults[$module],
135
+ $this->options[$module]);
136
+
137
+ $this->settings[$module] = array_merge(
138
+ $this->options[$module],
139
+ $this->forced[$module]);
140
+ }
141
+
142
+ /**
143
+ * Sets default values for a module and fills missing settings with them.
144
+ *
145
+ * @uses apply_filters() Calls the 'ak_<module>_defaults' filter on new defaults.
146
+ * @param string $module Module name.
147
+ * @param array $options Default settings array.
148
+ * @return void
149
+ */
150
+ public function setDefaults ( $module, $options )
151
+ {
152
+ if ( ! is_array($options) ) { // Must be an array of options.
153
+ $options = array();
154
+ }
155
+
156
+ $this->defaults[$module] = apply_filters('ak_' . $module . '_defaults', $options);
157
+ $this->populateSettings($module);
158
+ }
159
+
160
+ /**
161
+ * Returns an array with default values for a module.
162
+ *
163
+ * @param $module Module name
164
+ * @return array Default values for this module.
165
+ */
166
+ public function getDefaults ( $module )
167
+ {
168
+ if ( isset($this->defaults[$module]) && is_array($this->defaults[$module]) ) {
169
+ return $this->defaults[$module];
170
+ } else {
171
+ return array();
172
+ }
173
+ }
174
+
175
+ /**
176
+ * Gets a setting for a module.
177
+ * If $option is empty, will return all settings for a module in an array.
178
+ *
179
+ * @param string $module Module internal name.
180
+ * @param string $option Setting name.
181
+ * @param mixed $default Default value if setting not found.
182
+ * @return mixed Returns the setting value or $default if not defined.
183
+ */
184
+ public function getSetting ( $module, $option = '', $default = false )
185
+ {
186
+ if ( ! isset($this->settings[$module]) ) {
187
+ $this->populateSettings($module);
188
+ }
189
+
190
+ if ( empty($option) ) {
191
+ return $this->settings[$module];
192
+ } elseif ( isset($this->settings[$module][$option]) ) {
193
+ return $this->settings[$module][$option];
194
+ } else {
195
+ return $default;
196
+ }
197
+ }
198
+
199
+ /**
200
+ * Checks if an option is forced in the ini file.
201
+ * It is forced if it was defined on the ini file.
202
+ *
203
+ * @param string $module Module internal name.
204
+ * @param string $option Setting name.
205
+ * @return boolean
206
+ */
207
+ public function isForced ( $module, $option )
208
+ {
209
+ if ( isset($this->forced[$module][$option]) ) {
210
+ return true;
211
+ } else {
212
+ return false;
213
+ }
214
+ }
215
+
216
+ /**
217
+ * Adds a new module setting only if it does not exists.
218
+ * Does not save them to database. After adding all new settings, must call akSettings::saveSettings()
219
+ *
220
+ * @param string $module Module name.
221
+ * @param string $option Setting name.
222
+ * @param mixed $value Setting value
223
+ * @return boolean Returns true if settings has been added, false otherwise.
224
+ */
225
+ public function addOption ( $module, $option, $value )
226
+ {
227
+ if ( ! isset($this->options[$module]) ) {
228
+ $this->populateSettings($module);
229
+ }
230
+
231
+ if ( isset($this->options[$module][$option]) ) {
232
+ return false;
233
+ } else {
234
+ $this->options[$module][$option] = $value;
235
+ }
236
+
237
+ $this->populateSettings($module);
238
+ $this->updated[$module] = true;
239
+
240
+ return true;
241
+ }
242
+
243
+ /**
244
+ * Updates a module setting. If the setting does not exists, it is created.
245
+ * Does not save them to database. After adding all new settings, must call akSettings::saveSettings()
246
+ *
247
+ * @param string $module Module name.
248
+ * @param string $option Setting name.
249
+ * @param mixed $value Setting value
250
+ * @return void
251
+ */
252
+ public function updateOption ( $module, $option, $value )
253
+ {
254
+ if ( ! isset($this->options[$module]) ) {
255
+ $this->populateSettings($module);
256
+ }
257
+
258
+ $this->options[$module][$option] = $value;
259
+ $this->populateSettings($module);
260
+ $this->updated[$module] = true;
261
+ }
262
+
263
+ /**
264
+ * Deletes an option from a module.
265
+ * Only if the option existed.
266
+ *
267
+ * @param string $module Module name.
268
+ * @param string $option Setting name.
269
+ * @return void
270
+ */
271
+ public function deleteOption ( $module, $option )
272
+ {
273
+ if ( ! isset($this->options[$module]) ) {
274
+ $this->populateSettings($module);
275
+ }
276
+
277
+ if ( isset($this->options[$module][$option]) ) {
278
+ unset($this->options[$module][$option]);
279
+ }
280
+ $this->populateSettings($module);
281
+ $this->updated[$module] = true;
282
+ }
283
+
284
+ /**
285
+ * Replaces all settings for a module and saves them to database.
286
+ * If settings does not exist, them are created.
287
+ *
288
+ * @uses apply_filters() Calls the 'ak_<module>_replace_options' filter on new options.
289
+ * @param string $module Module name.
290
+ * @param array $settings New module settings.
291
+ * @return boolean Returns true if settings have been replaced.
292
+ */
293
+ public function replaceOptions ( $module, $settings )
294
+ {
295
+ if ( ! is_array($settings) ) {
296
+ return false;
297
+ }
298
+
299
+ $this->options[$module] = apply_filters('ak_' . $module . '_replace_options', $settings);
300
+ $this->populateSettings($module);
301
+ $this->updated[$module] = true;
302
+
303
+ return $this->saveOptions($module);
304
+ }
305
+
306
+ /**
307
+ * Saves settings to database.
308
+ * If a module name is provided saves only this module settings, if not, saves all settings.
309
+ *
310
+ * @param string $module Module name to save.
311
+ * @return boolean Returns true is settings have been saved, false otherwise.
312
+ */
313
+ public function saveOptions ( $module = '' )
314
+ {
315
+ if ( empty($module) ) {
316
+ foreach ( $this->options as $module => $value ) {
317
+ if ( $this->updated[$module] ) {
318
+ update_option(self::prefix . $module . self::sufix, $value);
319
+ $this->updated[$module] = false;
320
+ }
321
+ }
322
+ return true;
323
+ } elseif ( isset($this->options[$module]) && $this->updated[$module]) {
324
+ update_option(self::prefix . $module . self::sufix, $this->options[$module]);
325
+ return true;
326
+ } else {
327
+ return false;
328
+ }
329
+ }
330
+ }
framework/classes/template.php ADDED
@@ -0,0 +1,380 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class to manage simple templates for HTML output.
4
+ *
5
+ * @version $Rev: 203758 $
6
+ * @author Jordi Canals
7
+ * @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
8
+ * @license GNU General Public License version 2
9
+ * @link http://alkivia.org
10
+ * @package Alkivia
11
+ * @subpackage Framework
12
+ *
13
+
14
+ Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
15
+
16
+ This program is free software; you can redistribute it and/or
17
+ modify it under the terms of the GNU General Public License
18
+ version 2 as published by the Free Software Foundation.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+
29
+ /**
30
+ * A very simple class for an easy tenplate management.
31
+ * This is an abstract class that have to be extended for use.
32
+ *
33
+ * TODO: Provide some sort of caching template contents.
34
+ *
35
+ * @package Alkivia
36
+ * @subpackage Framework
37
+ */
38
+ class akTemplate
39
+ {
40
+ /**
41
+ * Templates folder (Slash ended).
42
+ * @var string
43
+ */
44
+ protected $tpl_dir = array();
45
+
46
+ /**
47
+ * Config files folder (Slah ended).
48
+ * @var string
49
+ */
50
+ private $cfg_dir = array();
51
+
52
+ /**
53
+ * Variables and values available to template.
54
+ * - 'var_name' => 'value'
55
+ * @var array
56
+ */
57
+ protected $vars = array();
58
+
59
+ /**
60
+ * Data readed from template config files.
61
+ * @var array
62
+ */
63
+ private $config = array();
64
+
65
+ /**
66
+ * Holds notice messages to be shown in output.
67
+ * On the template the method displayMessages() must be called.
68
+ * @var array
69
+ */
70
+ private $notices = array();
71
+
72
+ /**
73
+ * Holds error messages to be shown in output.
74
+ * On the template the method displayMessages() must be called.
75
+ * @var array
76
+ */
77
+ private $errors = array();
78
+
79
+ /**
80
+ * Class constructor.
81
+ *
82
+ * @param array|string $tpl_dir Full paths to template folders.
83
+ * @param string $cfg_dir Full path to config files.
84
+ * @return TemplateAbstract The class object or false if $tpl_dir is not a directory.
85
+ */
86
+ public function __construct ( $tpl_dir, $cfg_dir = '' )
87
+ {
88
+ $this->tpl_dir = $this->checkDirectories($tpl_dir);
89
+ if ( empty($this->tpl_dir) ) {
90
+ wp_die(__('Template class: Received template paths are not valid directories.'));
91
+ }
92
+
93
+ if ( empty($cfg_dir) ) {
94
+ $this->cfg_dir = $this->tpl_dir;
95
+ } else {
96
+ $this->cfg_dir = $this->checkDirectories($cfg_dir);
97
+ if ( empty($this->tpl_dir) ) {
98
+ wp_die(__('Template class: Received config paths are not valid directories.'));
99
+ }
100
+ }
101
+
102
+ }
103
+
104
+ /**
105
+ * Checks an array of paths are valid directories.
106
+ *
107
+ * @since 0.8
108
+ *
109
+ * @param array|string $directories Absolute paths array
110
+ * @return array An array with only valid directories, wrong directories are removed.
111
+ */
112
+ private function checkDirectories ( $directories )
113
+ {
114
+ $valid = array();
115
+ foreach ( (array) $directories as $path ) {
116
+ if ( is_dir($path) ) {
117
+ $valid[] = trailingslashit($path);
118
+ }
119
+ }
120
+
121
+ return $valid;
122
+ }
123
+
124
+ /**
125
+ * Assigns the translation textDomain as an available variable name.
126
+ * This will be available in template as $i18n.
127
+ *
128
+ * @param $context Translation context textDomain.
129
+ * @return void
130
+ */
131
+ final public function textDomain ( $context )
132
+ {
133
+ $this->vars['i18n'] = $context;
134
+ }
135
+
136
+ /**
137
+ * Assigns a variable name with it's value.
138
+ * Reserved vars names: i18n, tpl, cfg.
139
+ *
140
+ * @param $name Variable name.
141
+ * @param $value Value of the variable.
142
+ * @return void
143
+ */
144
+ final public function assign ( $name, $value )
145
+ {
146
+ $this->checkReserved($name);
147
+ $this->vars[$name] = $value;
148
+ }
149
+
150
+ /**
151
+ * Assigns a variable name with it's value by reference.
152
+ *
153
+ * @param $name Variable name.
154
+ * @param $value Value of the variable, received by reference.
155
+ * @return void
156
+ */
157
+ public function assignByRef( $name, &$value )
158
+ {
159
+ $this->checkReserved($name);
160
+ $this->vars[$name] =& $value;
161
+ }
162
+
163
+ /**
164
+ * Checks if a template var name is reserved and dies if yes.
165
+ *
166
+ * @since 0.8
167
+ *
168
+ * @param string $name Variable name to check.
169
+ * @return void
170
+ */
171
+ private function checkReserved ( $name )
172
+ {
173
+ if ( in_array($name, array('i18n', '_template', '_default', '_config', '_filename')) ) {
174
+ wp_die( sprintf(__('Template class: %s is a reserved template variable.'), $name) );
175
+ }
176
+ }
177
+
178
+ /**
179
+ * Loads an INI file from config folder, and merges the content with previous read files.
180
+ *
181
+ * @param $file File name (With no extension)
182
+ * @return void
183
+ */
184
+ final public function loadConfig ( $file )
185
+ {
186
+ foreach ( $this->cfg_dir as $path ) {
187
+ $filename = $path . $name . '.ini';
188
+ if ( file_exists($filename) ) {
189
+ $config = parse_ini_file( $filename, true);
190
+ $this->config = array_merge($this->config, $config);
191
+ }
192
+ }
193
+ }
194
+
195
+ /**
196
+ * Sets config values to empty.
197
+ * Can be used to start over loading new INI files.
198
+ *
199
+ * @return void
200
+ */
201
+ final public function resetConfig ()
202
+ {
203
+ $this->config = array();
204
+ }
205
+
206
+ /**
207
+ * Sets template vars to empty.
208
+ * Can be used to start over with a new template.
209
+ *
210
+ * @return void
211
+ */
212
+ final public function resetVars ()
213
+ {
214
+ $this->vars = array();
215
+ }
216
+
217
+ /**
218
+ * Sets config and vars to empty.
219
+ * Used to start a new clean template.
220
+ *
221
+ * @return void
222
+ */
223
+ final public function resetAll ()
224
+ {
225
+ $this->config = array();
226
+ $this->vars = array();
227
+ }
228
+
229
+ /**
230
+ * Adds an error to the erros queue.
231
+ * Only adds it if error does not already exists on errors queue.
232
+ *
233
+ * @param string $message Message to be added to the queue.
234
+ * @return void
235
+ */
236
+ final public function addError ( $message )
237
+ {
238
+ if ( ! empty($message) && ! in_array($message, $this->errors)) {
239
+ $this->errors[] = $message;
240
+ }
241
+ }
242
+
243
+ /**
244
+ * Chechs if errors were found and have to be displayed.
245
+ *
246
+ * @return boolean Found errors.
247
+ */
248
+ final public function foundErrors()
249
+ {
250
+ return ! empty($this->errors);
251
+ }
252
+
253
+ /**
254
+ * Adds a notice to the notices queue.
255
+ * Only adds the notice if it does not alredy exists on notices queue.
256
+ *
257
+ * @param string $message Message to be added to the queue.
258
+ * @return void
259
+ */
260
+ final public function addNotice ( $message )
261
+ {
262
+ if ( ! empty($message) && ! in_array($message, $this->notices)) {
263
+ $this->notices[] = $message;
264
+ }
265
+ }
266
+
267
+ /**
268
+ * Empties all messages queues (notices and errors).
269
+ *
270
+ * @return void
271
+ */
272
+ final public function resetMessages ()
273
+ {
274
+ $this->errors = array();
275
+ $this->notices = array();
276
+ }
277
+
278
+ /**
279
+ * Displays notices and/or error messages and empties the messages queue.
280
+ * This function should only be called within a template.
281
+ *
282
+ * @return void
283
+ */
284
+ final public function displayMessages ()
285
+ {
286
+ if ( ! empty($this->errors) ) {
287
+ $errors = implode('<br />' . PHP_EOL, $this->errors);
288
+ echo '<div id="message" class="error">' . $errors . '</div>' . PHP_EOL;
289
+ }
290
+
291
+ if ( ! empty($this->notices) ) {
292
+ $notices = implode('<br />' . PHP_EOL, $this->notices);
293
+ echo '<div id="message" class="notice">' . $notices . '</div>' . PHP_EOL;
294
+ }
295
+
296
+ $this->resetMessages();
297
+ }
298
+
299
+ /**
300
+ * Checks if a template file is available.
301
+ *
302
+ * @since 0.8
303
+ *
304
+ * @param string $template Template name (With no .php extension)
305
+ * @return boolean If template file was found or not.
306
+ */
307
+ final public function available( $template )
308
+ {
309
+ return ( false === $this->locateFile($template) ) ? false : true;
310
+ }
311
+
312
+ /**
313
+ * Displays a template from the templates folder.
314
+ * Inside the template all assigned vars will be available.
315
+ * Also 'cfg' and 'tpl' vars will be available:
316
+ * - cfg is an array which cointains all config values.
317
+ * - tpl is an string cointaining template absolute name.
318
+ *
319
+ * TODO: Load config file with same name as template.
320
+ *
321
+ * @param string $_template Template name with no extension.
322
+ * @param string $_default Alternate default template name.
323
+ * @return void.
324
+ */
325
+ final public function display ( $_template, $_default = '' )
326
+ {
327
+ $_filename = $this->locateFile($_template);
328
+ if ( false === $_filename && ! empty($_default) ) {
329
+ $_filename = $this->locateFile($_default);
330
+ }
331
+
332
+ if ( $_filename ) {
333
+ $_config =& $this->config;
334
+ extract($this->vars);
335
+ include ( $_filename );
336
+
337
+ } else {
338
+ wp_die(sprintf(__('Template file %1$s not found. Default template %2$s not found.'), $_template, $_default));
339
+ }
340
+ }
341
+
342
+ /**
343
+ * Returns the template contents after processing it.
344
+ * Calls to TemplateAbstract::display() for template processing.
345
+ *
346
+ * @param string $template Template name with no extension.
347
+ * @param string $default Alternate default template name.
348
+ * @return string|false The template contents or false if failed processing.
349
+ */
350
+ final public function getDisplay ( $template, $default = '' )
351
+ {
352
+ if ( ob_start() ) {
353
+ $this->display($template, $default);
354
+ $content = ob_get_contents();
355
+ ob_end_clean();
356
+ return $content;
357
+ } else {
358
+ return false;
359
+ }
360
+ }
361
+
362
+ /**
363
+ * Locates the path for a template filename.
364
+ * If template is not found, returns false.
365
+ *
366
+ * @param string $name Template name (with no .php extension)
367
+ * @return string|false Absolute path to template file. False if not found.
368
+ */
369
+ private function locateFile( $name )
370
+ {
371
+ foreach ( $this->tpl_dir as $path ) {
372
+ $template = $path . $name . '.php';
373
+ if ( file_exists($template) ) {
374
+ return $template;
375
+ }
376
+ }
377
+
378
+ return false;
379
+ }
380
+ }
framework/init.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Framework Initialization.
4
+ * This file is called at framework load time.
5
+ *
6
+ * @version $Rev: 199485 $
7
+ * @author Jordi Canals
8
+ * @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
9
+ * @license GNU General Public License version 2
10
+ * @link http://alkivia.org
11
+ * @package Alkivia
12
+ * @subpackage Framework
13
+ *
14
+
15
+ Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
16
+
17
+ This program is free software; you can redistribute it and/or
18
+ modify it under the terms of the GNU General Public License
19
+ version 2 as published by the Free Software Foundation.
20
+
21
+ This program is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
+
26
+ You should have received a copy of the GNU General Public License
27
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
28
+ */
29
+
30
+ /**
31
+ * Creates and returns the framework URL.
32
+ *
33
+ * @return string Framework URL
34
+ */
35
+ function ak_styles_url ()
36
+ {
37
+ $dir = str_replace('\\', '/', WP_CONTENT_DIR);
38
+ $fmw = str_replace('\\', '/', AK_FRAMEWORK);
39
+
40
+ return str_replace($dir, content_url(), $fmw) . '/styles';
41
+ }
42
+
43
+ // ================================================= SET GLOBAL CONSTANTS =====
44
+
45
+ if ( ! defined('AK_STYLES_URL') ) {
46
+ /** Define the framework URL */
47
+ define ( 'AK_STYLES_URL', ak_styles_url() );
48
+ }
49
+
50
+ if ( ! defined('AK_INI_FILE') ) {
51
+ /** Define the alkivia.ini filename and absoilute location */
52
+ define ( 'AK_INI_FILE', WP_CONTENT_DIR . '/alkivia.ini');
53
+ }
54
+
55
+ if ( ! defined('AK_CLASSES') ) {
56
+ /** Define the classes folder */
57
+ define ( 'AK_CLASSES', AK_FRAMEWORK . '/classes');
58
+ }
59
+
60
+ if ( ! defined('AK_LIB') ) {
61
+ /** Library folder for functions files */
62
+ define ( 'AK_LIB', AK_FRAMEWORK . '/lib');
63
+ }
64
+
65
+ if ( ! defined('AK_VENDOR') ) {
66
+ /** Vendor classes and libs */
67
+ define ('AK_VENDOR', AK_FRAMEWORK . '/vendor');
68
+ }
69
+
70
+ $akf_uploads = wp_upload_dir();
71
+ if ( ! defined('AK_UPLOAD_DIR') ) {
72
+ /** Absolute path to upload folder */
73
+ define ( 'AK_UPLOAD_DIR', $akf_uploads['basedir'] . '/alkivia');
74
+ }
75
+ if ( ! defined('AK_UPLOAD_URL') ) {
76
+ /** URL to upload folder. This could be replaced by a download manager. */
77
+ define ( 'AK_UPLOAD_URL', $akf_uploads['baseurl'] . '/alkivia');
78
+ }
79
+
80
+ // ============================================== SET GLOBAL ACTION HOOKS =====
81
+
82
+ /**
83
+ * Adds meta name for Alkivia Framework to head.
84
+ *
85
+ * @hook action 'wp_head'
86
+ * @access private
87
+ * @return void
88
+ */
89
+ function _ak_framework_meta_tags() {
90
+ echo '<meta name="framework" content="Alkivia Framework ' . get_option('ak_framework_version') . '" />' . PHP_EOL;
91
+ }
92
+ add_action('wp_head', '_ak_framework_meta_tags');
93
+
94
+ /**
95
+ * Loads the framework translations.
96
+ * Sets the translation text domain to 'akvf'.
97
+ *
98
+ * @return bool true on success, false on failure
99
+ */
100
+ function _ak_framework_translation()
101
+ {
102
+ $locale = get_locale();
103
+ $mofile = AK_FRAMEWORK . "/lang/$locale.mo";
104
+
105
+ return load_textdomain('akfw', $mofile);
106
+ }
107
+ add_action('init', '_ak_framework_translation');
108
+
109
+ // ================================================ INCLUDE ALL LIBRARIES =====
110
+
111
+ // Create the upload folder if does not exist.
112
+ if ( ! is_dir(AK_UPLOAD_DIR) ) {
113
+ wp_mkdir_p(AK_UPLOAD_DIR);
114
+ }
115
+
116
+ // Prepare the settings and objects libraries.
117
+ require_once ( AK_CLASSES . '/settings.php');
118
+
119
+ require_once ( AK_LIB . '/filesystem.php' );
120
+ require_once ( AK_LIB . '/formating.php' );
121
+ require_once ( AK_LIB . '/modules.php' );
122
+ require_once ( AK_LIB . '/objects.php' );
123
+ require_once ( AK_LIB . '/system.php' );
124
+ require_once ( AK_LIB . '/themes.php' );
125
+ require_once ( AK_LIB . '/users.php' );
126
+
127
+ do_action('ak_framework_loaded');
framework/lang/bg_BG.mo ADDED
Binary file
framework/lang/bg_BG.po ADDED
@@ -0,0 +1,352 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Petar Toushkov <pt.launchpad@gmail.com>, 2010.
2
+ msgid ""
3
+ msgstr ""
4
+ "Project-Id-Version: Alkivia SidePosts\n"
5
+ "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2010-02-06 01:15+0100\n"
7
+ "PO-Revision-Date: 2010-02-06 01:15+0100\n"
8
+ "Last-Translator: Jordi Canals <devel@jcanals.cat>\n"
9
+ "Language-Team: Bulgarian <dict@fsa-bg.org>\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_c\n"
16
+ "X-Poedit-Basepath: .\n"
17
+ "X-Generator: Lokalize 1.0\n"
18
+ "X-Poedit-SearchPath-0: ..\n"
19
+
20
+ #: ../classes/abstract/module.php:599
21
+ msgid "Option blocked by administrator."
22
+ msgstr "Опцията е блокирана от администратора."
23
+
24
+ #: ../classes/abstract/plugin.php:344
25
+ #: ../classes/abstract/plugin.php:363
26
+ msgid "Warning:"
27
+ msgstr "Предупреждение: "
28
+
29
+ #: ../classes/abstract/plugin.php:345
30
+ #, php-format
31
+ msgid "The active plugin %s is not compatible with your WordPress version."
32
+ msgstr "Активната приставка %s е несъвместима с вашата версия на WordPress."
33
+
34
+ #: ../classes/abstract/plugin.php:347
35
+ #, php-format
36
+ msgid "WordPress %s is required to run this plugin."
37
+ msgstr "ЗА работата на тази приставка се изисква WordPress %s."
38
+
39
+ #: ../classes/abstract/plugin.php:364
40
+ msgid "Standard sidebar functions are not present."
41
+ msgstr "Стандартните функция за страничната лента не са налични."
42
+
43
+ #: ../classes/abstract/plugin.php:365
44
+ #, php-format
45
+ msgid "It is required to use the standard sidebar to run %s"
46
+ msgstr "За да работи %s трябва да работи стандартната странична лента."
47
+
48
+ #: ../classes/abstract/plugin.php:412
49
+ msgid "Activate Components"
50
+ msgstr ""
51
+
52
+ #: ../classes/abstract/plugin.php:421
53
+ msgid "Yes"
54
+ msgstr ""
55
+
56
+ #: ../classes/abstract/plugin.php:422
57
+ msgid "No"
58
+ msgstr ""
59
+
60
+ #: ../lib/formating.php:52
61
+ msgid "Settings saved."
62
+ msgstr "Настройките бяха запазени."
63
+
64
+ #: ../lib/formating.php:160
65
+ msgid "Just Now"
66
+ msgstr "Току-що"
67
+
68
+ #: ../lib/formating.php:163
69
+ #, php-format
70
+ msgid "1 minute ago"
71
+ msgid_plural "%d minutes ago"
72
+ msgstr[0] "преди 1 минута"
73
+ msgstr[1] "преди %d минути"
74
+
75
+ #: ../lib/formating.php:166
76
+ #, php-format
77
+ msgid "1 hour ago"
78
+ msgid_plural "%d hours ago"
79
+ msgstr[0] "преди един час"
80
+ msgstr[1] "преди %d часа"
81
+
82
+ #: ../lib/formating.php:170
83
+ #, php-format
84
+ msgid "Today at %s"
85
+ msgstr "Днес в %s"
86
+
87
+ #: ../lib/formating.php:170
88
+ #, php-format
89
+ msgid "Yesterday at %s"
90
+ msgstr "Вчера в %s"
91
+
92
+ #: ../lib/themes.php:160
93
+ msgid "Plugin Homepage"
94
+ msgstr ""
95
+
96
+ #: ../lib/themes.php:164
97
+ msgid "Theme Homepage"
98
+ msgstr ""
99
+
100
+ #: ../lib/themes.php:168
101
+ msgid "Documentation"
102
+ msgstr ""
103
+
104
+ #: ../lib/themes.php:172
105
+ msgid "Support Forum"
106
+ msgstr ""
107
+
108
+ #: ../lib/themes.php:176
109
+ msgid "Author Homepage"
110
+ msgstr ""
111
+
112
+ #: ../lib/themes.php:180
113
+ msgid "Donate to project"
114
+ msgstr ""
115
+
116
+ #: ../vendor/upload/class.upload.php:2171
117
+ msgid "File error. Please try again."
118
+ msgstr "Грешка във файла. Моля, опитайте отново."
119
+
120
+ #: ../vendor/upload/class.upload.php:2172
121
+ msgid "Local file doesn't exist."
122
+ msgstr "Локалният файл не съществува."
123
+
124
+ #: ../vendor/upload/class.upload.php:2173
125
+ msgid "Local file is not readable."
126
+ msgstr "Локалният файл не може да бъде прочетен."
127
+
128
+ #: ../vendor/upload/class.upload.php:2174
129
+ msgid "File upload error (the uploaded file exceeds the upload_max_filesize directive in php.ini)."
130
+ msgstr "Грешка при качването на файла (каченият файл надхвърля upload_max_filesize директивата в php.ini)."
131
+
132
+ #: ../vendor/upload/class.upload.php:2175
133
+ msgid "File upload error (the uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form)."
134
+ msgstr "Грешка при качването на файла (каченият файл надхвърля MAX_FILE_SIZE директивата, указана в HTML формата)."
135
+
136
+ #: ../vendor/upload/class.upload.php:2176
137
+ msgid "File upload error (the uploaded file was only partially uploaded)."
138
+ msgstr "Грешка при качването на файла (файлът беше качен частично)."
139
+
140
+ #: ../vendor/upload/class.upload.php:2177
141
+ msgid "File upload error (no file was uploaded)."
142
+ msgstr "Грешка при качването на файла (не беше качен файл)."
143
+
144
+ #: ../vendor/upload/class.upload.php:2178
145
+ msgid "File upload error (missing a temporary folder)."
146
+ msgstr "Грешка при качването на файла (отсъства временна директория)."
147
+
148
+ #: ../vendor/upload/class.upload.php:2179
149
+ msgid "File upload error (failed to write file to disk)."
150
+ msgstr "Грешка при качването на файла (неуспех при запис върху диска)."
151
+
152
+ #: ../vendor/upload/class.upload.php:2180
153
+ msgid "File upload error (file upload stopped by extension)."
154
+ msgstr "Грешка при качването на файла (качването беше преустановено от приставката)."
155
+
156
+ #: ../vendor/upload/class.upload.php:2181
157
+ msgid "File upload error (unknown error code)."
158
+ msgstr "Грешка при качването на файла (неизвестен код за грешка)."
159
+
160
+ #: ../vendor/upload/class.upload.php:2182
161
+ msgid "File upload error. Please try again."
162
+ msgstr "Грешка при качването на файла. Моля, опитайте отново."
163
+
164
+ #: ../vendor/upload/class.upload.php:2183
165
+ msgid "File too big."
166
+ msgstr "Файлът е прекалено голям."
167
+
168
+ #: ../vendor/upload/class.upload.php:2184
169
+ msgid "MIME type can't be detected."
170
+ msgstr "Неустановен тип (MIME type)."
171
+
172
+ #: ../vendor/upload/class.upload.php:2185
173
+ msgid "Incorrect type of file."
174
+ msgstr "Неправилен файлов тип."
175
+
176
+ #: ../vendor/upload/class.upload.php:2186
177
+ msgid "Image too wide."
178
+ msgstr "Изображението е прекалено широко."
179
+
180
+ #: ../vendor/upload/class.upload.php:2187
181
+ msgid "Image too narrow."
182
+ msgstr "Изображението е прекалено тясно."
183
+
184
+ #: ../vendor/upload/class.upload.php:2188
185
+ msgid "Image too high."
186
+ msgstr "Изображението е прекалено високо."
187
+
188
+ #: ../vendor/upload/class.upload.php:2189
189
+ msgid "Image too short."
190
+ msgstr "Изображението е прекалено ниско."
191
+
192
+ #: ../vendor/upload/class.upload.php:2190
193
+ msgid "Image ratio too high (image too wide)."
194
+ msgstr "Съотношението на изображението е прекалено високо (изображението е прекалено широко)."
195
+
196
+ #: ../vendor/upload/class.upload.php:2191
197
+ msgid "Image ratio too low (image too high)."
198
+ msgstr "Съотношението на изображението е прекалено ниско (изображението е прекалено високо)."
199
+
200
+ #: ../vendor/upload/class.upload.php:2192
201
+ msgid "Image has too many pixels."
202
+ msgstr "Изображението има прекалено много пиксели."
203
+
204
+ #: ../vendor/upload/class.upload.php:2193
205
+ msgid "Image has not enough pixels."
206
+ msgstr "Изображението няма достатъчно пиксели."
207
+
208
+ #: ../vendor/upload/class.upload.php:2194
209
+ msgid "File not uploaded. Can't carry on a process."
210
+ msgstr "Файлът не беше качен. Процесът не може да продължи."
211
+
212
+ #: ../vendor/upload/class.upload.php:2195
213
+ #, php-format
214
+ msgid "%s already exists. Please change the file name."
215
+ msgstr "%s вече съществува. Моля, преименувайте."
216
+
217
+ #: ../vendor/upload/class.upload.php:2196
218
+ msgid "No correct temp source file. Can't carry on a process."
219
+ msgstr "Неправилен временен файлов източник. Процесът не може да продължи."
220
+
221
+ #: ../vendor/upload/class.upload.php:2197
222
+ msgid "No correct uploaded source file. Can't carry on a process."
223
+ msgstr "Неправилен файлов източник за качване. Процесът не може да продължи."
224
+
225
+ #: ../vendor/upload/class.upload.php:2198
226
+ msgid "Destination directory can't be created. Can't carry on a process."
227
+ msgstr "Целевата директория не може да бъде създадена. Процесът не може да продължи."
228
+
229
+ #: ../vendor/upload/class.upload.php:2199
230
+ msgid "Destination directory doesn't exist. Can't carry on a process."
231
+ msgstr "Целевата директория не съществува. Процесът не може да продължи."
232
+
233
+ #: ../vendor/upload/class.upload.php:2200
234
+ msgid "Destination path is not a directory. Can't carry on a process."
235
+ msgstr "Целевият път не е директория. Процесът не може да продължи."
236
+
237
+ #: ../vendor/upload/class.upload.php:2201
238
+ msgid "Destination directory can't be made writeable. Can't carry on a process."
239
+ msgstr "Целевата директория не може да получи права за запис. Процесът не може да продължи."
240
+
241
+ #: ../vendor/upload/class.upload.php:2202
242
+ msgid "Destination path is not a writeable. Can't carry on a process."
243
+ msgstr "Целевият път е недостъпен за запис. Процесът не може да продължи."
244
+
245
+ #: ../vendor/upload/class.upload.php:2203
246
+ msgid "Can't create the temporary file. Can't carry on a process."
247
+ msgstr "Неуспех при създаването на временния файл. Процесът не може да продължи."
248
+
249
+ #: ../vendor/upload/class.upload.php:2204
250
+ msgid "Source file is not readable. Can't carry on a process."
251
+ msgstr "Файловият източник не може да бъде прочетен. Процесът не може да продължи."
252
+
253
+ #: ../vendor/upload/class.upload.php:2205
254
+ #, php-format
255
+ msgid "No create from %s support."
256
+ msgstr "Няма поддръжка за създаване от %s."
257
+
258
+ #: ../vendor/upload/class.upload.php:2206
259
+ #, php-format
260
+ msgid "Error in creating %s image from source."
261
+ msgstr "Грешка при създаването на %s изображение от източника."
262
+
263
+ #: ../vendor/upload/class.upload.php:2207
264
+ msgid "Can't read image source. Not an image?."
265
+ msgstr "Неуспех при четенето на източника на изображението. Изображение ли е?"
266
+
267
+ #: ../vendor/upload/class.upload.php:2208
268
+ msgid "GD doesn't seem to be present."
269
+ msgstr "Изглежда, GD не е налично."
270
+
271
+ #: ../vendor/upload/class.upload.php:2209
272
+ #, php-format
273
+ msgid "No create from %s support, can't read watermark."
274
+ msgstr "Няма поддръжка за създаване от %s, неуспех при четенето на водния знак."
275
+
276
+ #: ../vendor/upload/class.upload.php:2210
277
+ #, php-format
278
+ msgid "No %s read support, can't create watermark."
279
+ msgstr "Няма поддръжка за четене на %s, неуспех при четенето на водния знак."
280
+
281
+ #: ../vendor/upload/class.upload.php:2211
282
+ msgid "Unknown image format, can't read watermark."
283
+ msgstr "Неизвестен формат на изображението, неуспех при четенето на водния знак."
284
+
285
+ #: ../vendor/upload/class.upload.php:2212
286
+ #, php-format
287
+ msgid "No %s create support."
288
+ msgstr "Няма поддръжка за създаване на %s."
289
+
290
+ #: ../vendor/upload/class.upload.php:2213
291
+ msgid "No conversion type defined."
292
+ msgstr "Няма дефиниран тип преобразуване."
293
+
294
+ #: ../vendor/upload/class.upload.php:2214
295
+ msgid "Error copying file on the server. copy() failed."
296
+ msgstr "Грешка при копирането на файла на сървъра. copy() failed."
297
+
298
+ #: ../vendor/upload/class.upload.php:2215
299
+ msgid "Error reading the file."
300
+ msgstr "Грешка при четенето на файла."
301
+
302
+ #~ msgid "The active plugin %s is not compatible with your PHP version."
303
+ #~ msgstr "Активната приставка %s е несъвместима с вашата PHP версия."
304
+ #~ msgid "%s is required for this plugin."
305
+ #~ msgstr "За тази приставка се изисква %s."
306
+ #~ msgid "A widget to move posts to the sidebar."
307
+ #~ msgstr "Джаджа за прехвърляне на публикации в страничната лента."
308
+ #~ msgid "Category not selected."
309
+ #~ msgstr "Не е избрана категория."
310
+ #~ msgid "Read more &raquo;"
311
+ #~ msgstr "Прочетете още &raquo;"
312
+ #~ msgid "No Comments"
313
+ #~ msgstr "Няма коментари"
314
+ #~ msgid "1 Comment"
315
+ #~ msgstr "1 коментар"
316
+ #~ msgid "% Comments"
317
+ #~ msgstr "% коментари"
318
+ #~ msgid "Comments closed"
319
+ #~ msgstr "Коментарите са забранени"
320
+ #~ msgid "Archive for"
321
+ #~ msgstr "Архив за"
322
+ #~ msgid "Title:"
323
+ #~ msgstr "Заглавие:"
324
+ #~ msgid "Category:"
325
+ #~ msgstr "Категория:"
326
+ #~ msgid "-- PRIVATE POSTS --"
327
+ #~ msgstr "-- ЛИЧНИ ПУБЛИКАЦИИ --"
328
+ #~ msgid "Number of posts:"
329
+ #~ msgstr "Брой на публикациите:"
330
+ #~ msgid "(At most %d)"
331
+ #~ msgstr "(Най-много %d)"
332
+ #~ msgid "Show:"
333
+ #~ msgstr "Показване:"
334
+ #~ msgid "Full Post"
335
+ #~ msgstr "Цялата публикация"
336
+ #~ msgid "Post Excerpt"
337
+ #~ msgstr "Извадка от публикацията"
338
+ #~ msgid "Excerpts with thumbnails"
339
+ #~ msgstr "Извадки с умалени изображения"
340
+ #~ msgid "Photo Blog"
341
+ #~ msgstr "Фото блог"
342
+ #~ msgid "Only Post Title"
343
+ #~ msgstr "Само заглавието на публикацията"
344
+ #~ msgid "Show category on all feeds"
345
+ #~ msgstr "Показване на категорията във всички емисии"
346
+ #~ msgid "Image width:"
347
+ #~ msgstr "Ширина на изображението:"
348
+ #~ msgid "pixels"
349
+ #~ msgstr "пиксела"
350
+ #~ msgid "Align thumbnail to right"
351
+ #~ msgstr "Подравняване на изображението надясно"
352
+
framework/lang/ca.mo ADDED
Binary file
framework/lang/ca.po ADDED
@@ -0,0 +1,315 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Alkivia Framework\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-02-08 13:50+0100\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Jordi Canals <devel@jcanals.cat>\n"
8
+ "Language-Team: Jordi Canals | http://alkivia.org <devel@jcanals.cat>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
+ "X-Poedit-Language: Catalan\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+
16
+ #: ../classes/template.php:90
17
+ msgid "Template class: Received template paths are not valid directories."
18
+ msgstr "Classe 'Template': Les rutes de plantilla rebudes no són directoris vàlids."
19
+
20
+ #: ../classes/template.php:98
21
+ msgid "Template class: Received config paths are not valid directories."
22
+ msgstr "Classe 'Template': Les rutes de configuració rebudes no són directoris vàlids."
23
+
24
+ #: ../classes/template.php:174
25
+ #, php-format
26
+ msgid "Template class: %s is a reserved template variable."
27
+ msgstr "Classe 'Template': %s és una variable reservada."
28
+
29
+ #: ../classes/template.php:338
30
+ #, php-format
31
+ msgid "Template file %1$s not found. Default template %2$s not found."
32
+ msgstr "L'arxiu de plantilla %1$s no s'ha trobat. Tampoc s'ha trobat la plantilla predeterminada %2$s."
33
+
34
+ #: ../classes/abstract/module.php:614
35
+ msgid "Option blocked by administrator."
36
+ msgstr "Opció desactivada per l'administrador."
37
+
38
+ #: ../classes/abstract/plugin.php:344
39
+ #: ../classes/abstract/plugin.php:363
40
+ msgid "Warning:"
41
+ msgstr "Atenció:"
42
+
43
+ #: ../classes/abstract/plugin.php:345
44
+ #, php-format
45
+ msgid "The active plugin %s is not compatible with your WordPress version."
46
+ msgstr "L'extensió activa %s no és compatible amb la vostra versió de WordPress."
47
+
48
+ #: ../classes/abstract/plugin.php:347
49
+ #, php-format
50
+ msgid "WordPress %s is required to run this plugin."
51
+ msgstr "Aquesta extensió requereix WordPress %s."
52
+
53
+ #: ../classes/abstract/plugin.php:364
54
+ msgid "Standard sidebar functions are not present."
55
+ msgstr "No s'han trobat les funcions necessàries de la barra lateral estàndard."
56
+
57
+ #: ../classes/abstract/plugin.php:365
58
+ #, php-format
59
+ msgid "It is required to use the standard sidebar to run %s"
60
+ msgstr "La barra lateral estàndard és necessària per executar %s."
61
+
62
+ #: ../classes/abstract/plugin.php:418
63
+ msgid "Activate Components"
64
+ msgstr "Activa Components"
65
+
66
+ #: ../classes/abstract/plugin.php:427
67
+ msgid "Yes"
68
+ msgstr "Sí"
69
+
70
+ #: ../classes/abstract/plugin.php:428
71
+ msgid "No"
72
+ msgstr "No"
73
+
74
+ #: ../lib/formating.php:52
75
+ msgid "Settings saved."
76
+ msgstr "Opcions desades."
77
+
78
+ #: ../lib/formating.php:160
79
+ msgid "Just Now"
80
+ msgstr "Ara mateix"
81
+
82
+ #: ../lib/formating.php:163
83
+ #, php-format
84
+ msgid "1 minute ago"
85
+ msgid_plural "%d minutes ago"
86
+ msgstr[0] "Fa 1 minut"
87
+ msgstr[1] "Fa %d minuts"
88
+
89
+ #: ../lib/formating.php:166
90
+ #, php-format
91
+ msgid "1 hour ago"
92
+ msgid_plural "%d hours ago"
93
+ msgstr[0] "Fa 1 hora"
94
+ msgstr[1] "Fa %d hores"
95
+
96
+ #: ../lib/formating.php:170
97
+ #, php-format
98
+ msgid "Today at %s"
99
+ msgstr "Avui a les %s"
100
+
101
+ #: ../lib/formating.php:170
102
+ #, php-format
103
+ msgid "Yesterday at %s"
104
+ msgstr "Ahir a les %s"
105
+
106
+ #: ../lib/themes.php:160
107
+ msgid "Plugin Homepage"
108
+ msgstr "Pàgina de l'extensió"
109
+
110
+ #: ../lib/themes.php:164
111
+ msgid "Theme Homepage"
112
+ msgstr "Pàgina web del tema"
113
+
114
+ #: ../lib/themes.php:168
115
+ msgid "Documentation"
116
+ msgstr "Documentació"
117
+
118
+ #: ../lib/themes.php:172
119
+ msgid "Support Forum"
120
+ msgstr "Fòrum d'Ajuda"
121
+
122
+ #: ../lib/themes.php:176
123
+ msgid "Author Homepage"
124
+ msgstr "Lloc web de l'autor"
125
+
126
+ #: ../lib/themes.php:180
127
+ msgid "Donate to project"
128
+ msgstr "Fes un donatiu"
129
+
130
+ #: ../vendor/upload/class.upload.php:2171
131
+ msgid "File error. Please try again."
132
+ msgstr "Error de fitxer. Si us plau, torneu-ho a provar."
133
+
134
+ #: ../vendor/upload/class.upload.php:2172
135
+ msgid "Local file doesn't exist."
136
+ msgstr "El fitxer local no existeix."
137
+
138
+ #: ../vendor/upload/class.upload.php:2173
139
+ msgid "Local file is not readable."
140
+ msgstr "El fitxer local no es pot llegir."
141
+
142
+ #: ../vendor/upload/class.upload.php:2174
143
+ msgid "File upload error (the uploaded file exceeds the upload_max_filesize directive in php.ini)."
144
+ msgstr "Error de pujada de fitxer (El fitxer pujat excedeix de la directiva upload_max_filesize de php.ini)."
145
+
146
+ #: ../vendor/upload/class.upload.php:2175
147
+ msgid "File upload error (the uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form)."
148
+ msgstr "Error pujant el fitxer (el fitxer pujat excedeix la directiva MAX_FILE_SIZE que s'ha especificat al formulari HTML)."
149
+
150
+ #: ../vendor/upload/class.upload.php:2176
151
+ msgid "File upload error (the uploaded file was only partially uploaded)."
152
+ msgstr "Error pujant el fitxer (El fitxer només s'ha rebut parcialment)."
153
+
154
+ #: ../vendor/upload/class.upload.php:2177
155
+ msgid "File upload error (no file was uploaded)."
156
+ msgstr "Error pujant el fitxer (No s'ha rebut cap fitxer)."
157
+
158
+ #: ../vendor/upload/class.upload.php:2178
159
+ msgid "File upload error (missing a temporary folder)."
160
+ msgstr "Error pujant el fitxer (manca la carpeta temporal)."
161
+
162
+ #: ../vendor/upload/class.upload.php:2179
163
+ msgid "File upload error (failed to write file to disk)."
164
+ msgstr "Error pujant el fitxer (No s'ha pogut escriure al disc)."
165
+
166
+ #: ../vendor/upload/class.upload.php:2180
167
+ msgid "File upload error (file upload stopped by extension)."
168
+ msgstr "Error pujant el fitxer (El fitxer s'ha bloquejat per extensió)."
169
+
170
+ #: ../vendor/upload/class.upload.php:2181
171
+ msgid "File upload error (unknown error code)."
172
+ msgstr "Error pujant el fitxer (Codi d'error desconegut)."
173
+
174
+ #: ../vendor/upload/class.upload.php:2182
175
+ msgid "File upload error. Please try again."
176
+ msgstr "S'ha produït un error pujant el fitxer. Torneu-ho a provar d'aquí una estona."
177
+
178
+ #: ../vendor/upload/class.upload.php:2183
179
+ msgid "File too big."
180
+ msgstr "Fitxer massa gran."
181
+
182
+ #: ../vendor/upload/class.upload.php:2184
183
+ msgid "MIME type can't be detected."
184
+ msgstr "No es pot detectar el tipus MIME."
185
+
186
+ #: ../vendor/upload/class.upload.php:2185
187
+ msgid "Incorrect type of file."
188
+ msgstr "Tipus d'arxiu invàlid"
189
+
190
+ #: ../vendor/upload/class.upload.php:2186
191
+ msgid "Image too wide."
192
+ msgstr "Imatge massa ample."
193
+
194
+ #: ../vendor/upload/class.upload.php:2187
195
+ msgid "Image too narrow."
196
+ msgstr "Imatge massa estreta."
197
+
198
+ #: ../vendor/upload/class.upload.php:2188
199
+ msgid "Image too high."
200
+ msgstr "Imatge massa alta."
201
+
202
+ #: ../vendor/upload/class.upload.php:2189
203
+ msgid "Image too short."
204
+ msgstr "Imatge massa baixa."
205
+
206
+ #: ../vendor/upload/class.upload.php:2190
207
+ msgid "Image ratio too high (image too wide)."
208
+ msgstr "Ratio d'imatge massa gran (Imatge massa ample)."
209
+
210
+ #: ../vendor/upload/class.upload.php:2191
211
+ msgid "Image ratio too low (image too high)."
212
+ msgstr "Ratio d'imatge massa baix (Imatge massa alta)."
213
+
214
+ #: ../vendor/upload/class.upload.php:2192
215
+ msgid "Image has too many pixels."
216
+ msgstr "La imatge té massa píxels."
217
+
218
+ #: ../vendor/upload/class.upload.php:2193
219
+ msgid "Image has not enough pixels."
220
+ msgstr "La imatge no té prou píxels."
221
+
222
+ #: ../vendor/upload/class.upload.php:2194
223
+ msgid "File not uploaded. Can't carry on a process."
224
+ msgstr "No s'ha pujat el fitxer. No s'ha pogut executar el procés."
225
+
226
+ #: ../vendor/upload/class.upload.php:2195
227
+ #, php-format
228
+ msgid "%s already exists. Please change the file name."
229
+ msgstr "El fitxer %s ja existeix. Si en plau canvieu-ne el nom."
230
+
231
+ #: ../vendor/upload/class.upload.php:2196
232
+ msgid "No correct temp source file. Can't carry on a process."
233
+ msgstr "El fitxer temporal no es correcte. No es pot executar el procés."
234
+
235
+ #: ../vendor/upload/class.upload.php:2197
236
+ msgid "No correct uploaded source file. Can't carry on a process."
237
+ msgstr "El fitxer original no es correcte. No es pot executar el procés."
238
+
239
+ #: ../vendor/upload/class.upload.php:2198
240
+ msgid "Destination directory can't be created. Can't carry on a process."
241
+ msgstr "No es pot crear el directori de destí. No es pot executar el procés."
242
+
243
+ #: ../vendor/upload/class.upload.php:2199
244
+ msgid "Destination directory doesn't exist. Can't carry on a process."
245
+ msgstr "El directori de destí no existeix. No es pot executar el procés."
246
+
247
+ #: ../vendor/upload/class.upload.php:2200
248
+ msgid "Destination path is not a directory. Can't carry on a process."
249
+ msgstr "La ruta de destí no és un directori. No es pot executar el procés."
250
+
251
+ #: ../vendor/upload/class.upload.php:2201
252
+ msgid "Destination directory can't be made writeable. Can't carry on a process."
253
+ msgstr "No es pot canviar a 'escriure' els drets del directori de destí. No es pot executar el procés."
254
+
255
+ #: ../vendor/upload/class.upload.php:2202
256
+ msgid "Destination path is not a writeable. Can't carry on a process."
257
+ msgstr "No es pot escriure en el directori de destí. No es pot executar el procés."
258
+
259
+ #: ../vendor/upload/class.upload.php:2203
260
+ msgid "Can't create the temporary file. Can't carry on a process."
261
+ msgstr "No es pot crear un fitxer temporal. No es pot executar el procés."
262
+
263
+ #: ../vendor/upload/class.upload.php:2204
264
+ msgid "Source file is not readable. Can't carry on a process."
265
+ msgstr "El fitxer d'origen no es pot llegir. No es pot executar el procés."
266
+
267
+ #: ../vendor/upload/class.upload.php:2205
268
+ #, php-format
269
+ msgid "No create from %s support."
270
+ msgstr "No hi ha funcions per crear des de %s."
271
+
272
+ #: ../vendor/upload/class.upload.php:2206
273
+ #, php-format
274
+ msgid "Error in creating %s image from source."
275
+ msgstr "Error creant la imatge %s des de l'original."
276
+
277
+ #: ../vendor/upload/class.upload.php:2207
278
+ msgid "Can't read image source. Not an image?."
279
+ msgstr "No es pot llegir la imatge original. És una imatge?"
280
+
281
+ #: ../vendor/upload/class.upload.php:2208
282
+ msgid "GD doesn't seem to be present."
283
+ msgstr "No sembla que la llibreria GD estigui present."
284
+
285
+ #: ../vendor/upload/class.upload.php:2209
286
+ #, php-format
287
+ msgid "No create from %s support, can't read watermark."
288
+ msgstr "No hi ha funcions per crear des de %s, no es pot llegir la marca a l'aigua."
289
+
290
+ #: ../vendor/upload/class.upload.php:2210
291
+ #, php-format
292
+ msgid "No %s read support, can't create watermark."
293
+ msgstr "No hi ha funcions per llegir %s, no es pot crear la marca a l'aigua."
294
+
295
+ #: ../vendor/upload/class.upload.php:2211
296
+ msgid "Unknown image format, can't read watermark."
297
+ msgstr "Format d'imatge desconegut, no es pot llegir la marca a l'aigua."
298
+
299
+ #: ../vendor/upload/class.upload.php:2212
300
+ #, php-format
301
+ msgid "No %s create support."
302
+ msgstr "No hi ha funcions per crear %s."
303
+
304
+ #: ../vendor/upload/class.upload.php:2213
305
+ msgid "No conversion type defined."
306
+ msgstr "No s'ha definit cap tipus de conversió."
307
+
308
+ #: ../vendor/upload/class.upload.php:2214
309
+ msgid "Error copying file on the server. copy() failed."
310
+ msgstr "Error copiant el fitxer al serivor. copy() ha fallat."
311
+
312
+ #: ../vendor/upload/class.upload.php:2215
313
+ msgid "Error reading the file."
314
+ msgstr "Error llegint el fitxer."
315
+
framework/lang/es_ES.mo ADDED
Binary file
framework/lang/es_ES.po ADDED
@@ -0,0 +1,316 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Alkivia Framework\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-02-08 13:50+0100\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Jordi Canals <devel@jcanals.cat>\n"
8
+ "Language-Team: Jordi Canals | http://alkivia.org <devel@jcanals.cat>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
+ "X-Poedit-Language: Spanish\n"
14
+ "X-Poedit-Country: SPAIN\n"
15
+ "X-Poedit-SourceCharset: utf-8\n"
16
+
17
+ #: ../classes/template.php:90
18
+ msgid "Template class: Received template paths are not valid directories."
19
+ msgstr "Clase 'Template': Las rutas de platilla recibidas no son directorios válidos."
20
+
21
+ #: ../classes/template.php:98
22
+ msgid "Template class: Received config paths are not valid directories."
23
+ msgstr "Clase 'Template': Las rutas de configuración recibidas no son directorios válidos."
24
+
25
+ #: ../classes/template.php:174
26
+ #, php-format
27
+ msgid "Template class: %s is a reserved template variable."
28
+ msgstr "Clase 'Template': %s es una variable reservada."
29
+
30
+ #: ../classes/template.php:338
31
+ #, php-format
32
+ msgid "Template file %1$s not found. Default template %2$s not found."
33
+ msgstr "El archivo de plantilla %1$s no existe. Tampoco se encontró la plantilla predeterminada %2$s."
34
+
35
+ #: ../classes/abstract/module.php:614
36
+ msgid "Option blocked by administrator."
37
+ msgstr "Opción bloqueada por el administrador."
38
+
39
+ #: ../classes/abstract/plugin.php:344
40
+ #: ../classes/abstract/plugin.php:363
41
+ msgid "Warning:"
42
+ msgstr "Atención:"
43
+
44
+ #: ../classes/abstract/plugin.php:345
45
+ #, php-format
46
+ msgid "The active plugin %s is not compatible with your WordPress version."
47
+ msgstr "El plugin activo %s no es compatible con tu versión de WordPress."
48
+
49
+ #: ../classes/abstract/plugin.php:347
50
+ #, php-format
51
+ msgid "WordPress %s is required to run this plugin."
52
+ msgstr "Para ejecutar este plugin se require WordPress %s."
53
+
54
+ #: ../classes/abstract/plugin.php:364
55
+ msgid "Standard sidebar functions are not present."
56
+ msgstr "No se encontraron las funciones de la barra lateral estandar."
57
+
58
+ #: ../classes/abstract/plugin.php:365
59
+ #, php-format
60
+ msgid "It is required to use the standard sidebar to run %s"
61
+ msgstr "Se requiere la barra lateral estandar para ejecutar %s"
62
+
63
+ #: ../classes/abstract/plugin.php:418
64
+ msgid "Activate Components"
65
+ msgstr "Activar Componentes"
66
+
67
+ #: ../classes/abstract/plugin.php:427
68
+ msgid "Yes"
69
+ msgstr "Si"
70
+
71
+ #: ../classes/abstract/plugin.php:428
72
+ msgid "No"
73
+ msgstr "No"
74
+
75
+ #: ../lib/formating.php:52
76
+ msgid "Settings saved."
77
+ msgstr "Parámetros guardados."
78
+
79
+ #: ../lib/formating.php:160
80
+ msgid "Just Now"
81
+ msgstr "Ahora mismo"
82
+
83
+ #: ../lib/formating.php:163
84
+ #, php-format
85
+ msgid "1 minute ago"
86
+ msgid_plural "%d minutes ago"
87
+ msgstr[0] "Hace 1 minuto"
88
+ msgstr[1] "Hace %d minutos"
89
+
90
+ #: ../lib/formating.php:166
91
+ #, php-format
92
+ msgid "1 hour ago"
93
+ msgid_plural "%d hours ago"
94
+ msgstr[0] "Hace una hora"
95
+ msgstr[1] "Hace %d horas"
96
+
97
+ #: ../lib/formating.php:170
98
+ #, php-format
99
+ msgid "Today at %s"
100
+ msgstr "Hoy a las %s"
101
+
102
+ #: ../lib/formating.php:170
103
+ #, php-format
104
+ msgid "Yesterday at %s"
105
+ msgstr "Ayer a las %s"
106
+
107
+ #: ../lib/themes.php:160
108
+ msgid "Plugin Homepage"
109
+ msgstr "Página del plugin"
110
+
111
+ #: ../lib/themes.php:164
112
+ msgid "Theme Homepage"
113
+ msgstr "Página del tema"
114
+
115
+ #: ../lib/themes.php:168
116
+ msgid "Documentation"
117
+ msgstr "Documentación"
118
+
119
+ #: ../lib/themes.php:172
120
+ msgid "Support Forum"
121
+ msgstr "Foro de soporte"
122
+
123
+ #: ../lib/themes.php:176
124
+ msgid "Author Homepage"
125
+ msgstr "Página del autor"
126
+
127
+ #: ../lib/themes.php:180
128
+ msgid "Donate to project"
129
+ msgstr "Haz un donativo"
130
+
131
+ #: ../vendor/upload/class.upload.php:2171
132
+ msgid "File error. Please try again."
133
+ msgstr "Error de archivo. Por favor, reintentalo de nuevo."
134
+
135
+ #: ../vendor/upload/class.upload.php:2172
136
+ msgid "Local file doesn't exist."
137
+ msgstr "El archivo local no existe."
138
+
139
+ #: ../vendor/upload/class.upload.php:2173
140
+ msgid "Local file is not readable."
141
+ msgstr "El archivo local no es legible."
142
+
143
+ #: ../vendor/upload/class.upload.php:2174
144
+ msgid "File upload error (the uploaded file exceeds the upload_max_filesize directive in php.ini)."
145
+ msgstr "Error de carga de archivo (el archivo cargado excede la directiva UPLOAD_MAX_FILESIZE de PHP)."
146
+
147
+ #: ../vendor/upload/class.upload.php:2175
148
+ msgid "File upload error (the uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form)."
149
+ msgstr "Error de carga de archivo (el archivo enviado excede la directiva MAX_FILE_SIZE especificada en el formulario)."
150
+
151
+ #: ../vendor/upload/class.upload.php:2176
152
+ msgid "File upload error (the uploaded file was only partially uploaded)."
153
+ msgstr "Error de carga de archivo (el archivo sólo se recibió parcialmente)."
154
+
155
+ #: ../vendor/upload/class.upload.php:2177
156
+ msgid "File upload error (no file was uploaded)."
157
+ msgstr "Error de carga de archivo (no se recibió archivo)."
158
+
159
+ #: ../vendor/upload/class.upload.php:2178
160
+ msgid "File upload error (missing a temporary folder)."
161
+ msgstr "Error de carga de archivo (falta la carpeta temporal)."
162
+
163
+ #: ../vendor/upload/class.upload.php:2179
164
+ msgid "File upload error (failed to write file to disk)."
165
+ msgstr "Error de carga de archivo (no se pudo escribir en el disco)."
166
+
167
+ #: ../vendor/upload/class.upload.php:2180
168
+ msgid "File upload error (file upload stopped by extension)."
169
+ msgstr "Error de carga de archivo (se ha bloquedao el archivo por extensión)."
170
+
171
+ #: ../vendor/upload/class.upload.php:2181
172
+ msgid "File upload error (unknown error code)."
173
+ msgstr "Error de carga de archivo (código de error desconocido)."
174
+
175
+ #: ../vendor/upload/class.upload.php:2182
176
+ msgid "File upload error. Please try again."
177
+ msgstr "Error de carga de archivo. Por favor, reinténtalo."
178
+
179
+ #: ../vendor/upload/class.upload.php:2183
180
+ msgid "File too big."
181
+ msgstr "Archivo demasiado grande."
182
+
183
+ #: ../vendor/upload/class.upload.php:2184
184
+ msgid "MIME type can't be detected."
185
+ msgstr "No se pudo detectar el tipo MIME."
186
+
187
+ #: ../vendor/upload/class.upload.php:2185
188
+ msgid "Incorrect type of file."
189
+ msgstr "Tipo de archivo incorrecto."
190
+
191
+ #: ../vendor/upload/class.upload.php:2186
192
+ msgid "Image too wide."
193
+ msgstr "Imagen demasiado ancha."
194
+
195
+ #: ../vendor/upload/class.upload.php:2187
196
+ msgid "Image too narrow."
197
+ msgstr "Imagen demasiado estrecha."
198
+
199
+ #: ../vendor/upload/class.upload.php:2188
200
+ msgid "Image too high."
201
+ msgstr "Imagen demasiado alta."
202
+
203
+ #: ../vendor/upload/class.upload.php:2189
204
+ msgid "Image too short."
205
+ msgstr "Imagen demasiado baja."
206
+
207
+ #: ../vendor/upload/class.upload.php:2190
208
+ msgid "Image ratio too high (image too wide)."
209
+ msgstr "Ratio de imagen demariado alto (imagen demasiado ancha)."
210
+
211
+ #: ../vendor/upload/class.upload.php:2191
212
+ msgid "Image ratio too low (image too high)."
213
+ msgstr "Ratio de imagen demasiado bajo (imagen demasiado alta)."
214
+
215
+ #: ../vendor/upload/class.upload.php:2192
216
+ msgid "Image has too many pixels."
217
+ msgstr "La imágen tiene demasiados píxeles."
218
+
219
+ #: ../vendor/upload/class.upload.php:2193
220
+ msgid "Image has not enough pixels."
221
+ msgstr "La imagen no tiene suficientes píxeles."
222
+
223
+ #: ../vendor/upload/class.upload.php:2194
224
+ msgid "File not uploaded. Can't carry on a process."
225
+ msgstr "No se ha cargado el archivo. No se puede ejecutar el proceso."
226
+
227
+ #: ../vendor/upload/class.upload.php:2195
228
+ #, php-format
229
+ msgid "%s already exists. Please change the file name."
230
+ msgstr "El archivo %s ya existe. Por favor, cambia el nombre de archivo."
231
+
232
+ #: ../vendor/upload/class.upload.php:2196
233
+ msgid "No correct temp source file. Can't carry on a process."
234
+ msgstr "El archivo temporal es incorrecto. No se puede ejecutar el proceso."
235
+
236
+ #: ../vendor/upload/class.upload.php:2197
237
+ msgid "No correct uploaded source file. Can't carry on a process."
238
+ msgstr "Archivo original incorrecto. No se puede ejecutar el proceso."
239
+
240
+ #: ../vendor/upload/class.upload.php:2198
241
+ msgid "Destination directory can't be created. Can't carry on a process."
242
+ msgstr "No se puede crear el directorio de destino. No se puede realizar el proceso."
243
+
244
+ #: ../vendor/upload/class.upload.php:2199
245
+ msgid "Destination directory doesn't exist. Can't carry on a process."
246
+ msgstr "El directorio de destino no existe. No se puede realizar el proceso."
247
+
248
+ #: ../vendor/upload/class.upload.php:2200
249
+ msgid "Destination path is not a directory. Can't carry on a process."
250
+ msgstr "La ruta de destino no es un directorio. No se puede realizar el proceso."
251
+
252
+ #: ../vendor/upload/class.upload.php:2201
253
+ msgid "Destination directory can't be made writeable. Can't carry on a process."
254
+ msgstr "El directorio de destino no se puede cambiar a escribible. No se puede realizar el proceso."
255
+
256
+ #: ../vendor/upload/class.upload.php:2202
257
+ msgid "Destination path is not a writeable. Can't carry on a process."
258
+ msgstr "No se puede escribir en la ruta de destino. No se puede realizar el proceso."
259
+
260
+ #: ../vendor/upload/class.upload.php:2203
261
+ msgid "Can't create the temporary file. Can't carry on a process."
262
+ msgstr "No se puede crar un archivo temporal. No se puede ejecutar el proceso."
263
+
264
+ #: ../vendor/upload/class.upload.php:2204
265
+ msgid "Source file is not readable. Can't carry on a process."
266
+ msgstr "No se puede leer el archivo original. No se puede ejecutar el proceso."
267
+
268
+ #: ../vendor/upload/class.upload.php:2205
269
+ #, php-format
270
+ msgid "No create from %s support."
271
+ msgstr "No hay soporte para crear desde %s."
272
+
273
+ #: ../vendor/upload/class.upload.php:2206
274
+ #, php-format
275
+ msgid "Error in creating %s image from source."
276
+ msgstr "Error creacdo la imagen %s desde el original."
277
+
278
+ #: ../vendor/upload/class.upload.php:2207
279
+ msgid "Can't read image source. Not an image?."
280
+ msgstr "No se puede leer la imagen orginal. ¿Es una imagen?"
281
+
282
+ #: ../vendor/upload/class.upload.php:2208
283
+ msgid "GD doesn't seem to be present."
284
+ msgstr "No se ha detectado la libreria GD."
285
+
286
+ #: ../vendor/upload/class.upload.php:2209
287
+ #, php-format
288
+ msgid "No create from %s support, can't read watermark."
289
+ msgstr "No hay soporte para crear desde %s. No se puede leer la marca de agua."
290
+
291
+ #: ../vendor/upload/class.upload.php:2210
292
+ #, php-format
293
+ msgid "No %s read support, can't create watermark."
294
+ msgstr "No hay soporte para leer %s. No se puede crear la marca de agua."
295
+
296
+ #: ../vendor/upload/class.upload.php:2211
297
+ msgid "Unknown image format, can't read watermark."
298
+ msgstr "Formato de imagen desconocido. No se puede leer la marca al agua."
299
+
300
+ #: ../vendor/upload/class.upload.php:2212
301
+ #, php-format
302
+ msgid "No %s create support."
303
+ msgstr "No hay soporte para crear %s."
304
+
305
+ #: ../vendor/upload/class.upload.php:2213
306
+ msgid "No conversion type defined."
307
+ msgstr "No se ha definido el tipo de conversión."
308
+
309
+ #: ../vendor/upload/class.upload.php:2214
310
+ msgid "Error copying file on the server. copy() failed."
311
+ msgstr "Error coipiando el archivo en el servidor. Ha fallado copy()."
312
+
313
+ #: ../vendor/upload/class.upload.php:2215
314
+ msgid "Error reading the file."
315
+ msgstr "Error leyendo el archivo."
316
+
framework/lang/framework.pot ADDED
@@ -0,0 +1,317 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Alkivia SidePosts\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-02-08 13:50+0100\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Jordi Canals <devel@jcanals.cat>\n"
8
+ "Language-Team: Jordi Canals | http://alkivia.org <devel@jcanals.cat>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
+ "X-Poedit-SourceCharset: utf-8\n"
14
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_c;_x:2c,1\n"
15
+ "X-Poedit-Basepath: .\n"
16
+ "X-Poedit-SearchPath-0: ..\n"
17
+
18
+ #: ../classes/template.php:90
19
+ msgid "Template class: Received template paths are not valid directories."
20
+ msgstr ""
21
+
22
+ #: ../classes/template.php:98
23
+ msgid "Template class: Received config paths are not valid directories."
24
+ msgstr ""
25
+
26
+ #: ../classes/template.php:174
27
+ #, php-format
28
+ msgid "Template class: %s is a reserved template variable."
29
+ msgstr ""
30
+
31
+ #: ../classes/template.php:338
32
+ #, php-format
33
+ msgid "Template file %1$s not found. Default template %2$s not found."
34
+ msgstr ""
35
+
36
+ #: ../classes/abstract/module.php:614
37
+ msgid "Option blocked by administrator."
38
+ msgstr ""
39
+
40
+ #: ../classes/abstract/plugin.php:344
41
+ #: ../classes/abstract/plugin.php:363
42
+ msgid "Warning:"
43
+ msgstr ""
44
+
45
+ #: ../classes/abstract/plugin.php:345
46
+ #, php-format
47
+ msgid "The active plugin %s is not compatible with your WordPress version."
48
+ msgstr ""
49
+
50
+ #: ../classes/abstract/plugin.php:347
51
+ #, php-format
52
+ msgid "WordPress %s is required to run this plugin."
53
+ msgstr ""
54
+
55
+ #: ../classes/abstract/plugin.php:364
56
+ msgid "Standard sidebar functions are not present."
57
+ msgstr ""
58
+
59
+ #: ../classes/abstract/plugin.php:365
60
+ #, php-format
61
+ msgid "It is required to use the standard sidebar to run %s"
62
+ msgstr ""
63
+
64
+ #: ../classes/abstract/plugin.php:418
65
+ msgid "Activate Components"
66
+ msgstr ""
67
+
68
+ #: ../classes/abstract/plugin.php:427
69
+ msgid "Yes"
70
+ msgstr ""
71
+
72
+ #: ../classes/abstract/plugin.php:428
73
+ msgid "No"
74
+ msgstr ""
75
+
76
+ #: ../lib/formating.php:52
77
+ msgid "Settings saved."
78
+ msgstr ""
79
+
80
+ #: ../lib/formating.php:160
81
+ msgid "Just Now"
82
+ msgstr ""
83
+
84
+ #: ../lib/formating.php:163
85
+ #, php-format
86
+ msgid "1 minute ago"
87
+ msgid_plural "%d minutes ago"
88
+ msgstr[0] ""
89
+ msgstr[1] ""
90
+
91
+ #: ../lib/formating.php:166
92
+ #, php-format
93
+ msgid "1 hour ago"
94
+ msgid_plural "%d hours ago"
95
+ msgstr[0] ""
96
+ msgstr[1] ""
97
+
98
+ #: ../lib/formating.php:170
99
+ #, php-format
100
+ msgid "Today at %s"
101
+ msgstr ""
102
+
103
+ #: ../lib/formating.php:170
104
+ #, php-format
105
+ msgid "Yesterday at %s"
106
+ msgstr ""
107
+
108
+ #: ../lib/themes.php:160
109
+ msgid "Plugin Homepage"
110
+ msgstr ""
111
+
112
+ #: ../lib/themes.php:164
113
+ msgid "Theme Homepage"
114
+ msgstr ""
115
+
116
+ #: ../lib/themes.php:168
117
+ msgid "Documentation"
118
+ msgstr ""
119
+
120
+ #: ../lib/themes.php:172
121
+ msgid "Support Forum"
122
+ msgstr ""
123
+
124
+ #: ../lib/themes.php:176
125
+ msgid "Author Homepage"
126
+ msgstr ""
127
+
128
+ #: ../lib/themes.php:180
129
+ msgid "Donate to project"
130
+ msgstr ""
131
+
132
+ #: ../vendor/upload/class.upload.php:2171
133
+ msgid "File error. Please try again."
134
+ msgstr ""
135
+
136
+ #: ../vendor/upload/class.upload.php:2172
137
+ msgid "Local file doesn't exist."
138
+ msgstr ""
139
+
140
+ #: ../vendor/upload/class.upload.php:2173
141
+ msgid "Local file is not readable."
142
+ msgstr ""
143
+
144
+ #: ../vendor/upload/class.upload.php:2174
145
+ msgid "File upload error (the uploaded file exceeds the upload_max_filesize directive in php.ini)."
146
+ msgstr ""
147
+
148
+ #: ../vendor/upload/class.upload.php:2175
149
+ msgid "File upload error (the uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form)."
150
+ msgstr ""
151
+
152
+ #: ../vendor/upload/class.upload.php:2176
153
+ msgid "File upload error (the uploaded file was only partially uploaded)."
154
+ msgstr ""
155
+
156
+ #: ../vendor/upload/class.upload.php:2177
157
+ msgid "File upload error (no file was uploaded)."
158
+ msgstr ""
159
+
160
+ #: ../vendor/upload/class.upload.php:2178
161
+ msgid "File upload error (missing a temporary folder)."
162
+ msgstr ""
163
+
164
+ #: ../vendor/upload/class.upload.php:2179
165
+ msgid "File upload error (failed to write file to disk)."
166
+ msgstr ""
167
+
168
+ #: ../vendor/upload/class.upload.php:2180
169
+ msgid "File upload error (file upload stopped by extension)."
170
+ msgstr ""
171
+
172
+ #: ../vendor/upload/class.upload.php:2181
173
+ msgid "File upload error (unknown error code)."
174
+ msgstr ""
175
+
176
+ #: ../vendor/upload/class.upload.php:2182
177
+ msgid "File upload error. Please try again."
178
+ msgstr ""
179
+
180
+ #: ../vendor/upload/class.upload.php:2183
181
+ msgid "File too big."
182
+ msgstr ""
183
+
184
+ #: ../vendor/upload/class.upload.php:2184
185
+ msgid "MIME type can't be detected."
186
+ msgstr ""
187
+
188
+ #: ../vendor/upload/class.upload.php:2185
189
+ msgid "Incorrect type of file."
190
+ msgstr ""
191
+
192
+ #: ../vendor/upload/class.upload.php:2186
193
+ msgid "Image too wide."
194
+ msgstr ""
195
+
196
+ #: ../vendor/upload/class.upload.php:2187
197
+ msgid "Image too narrow."
198
+ msgstr ""
199
+
200
+ #: ../vendor/upload/class.upload.php:2188
201
+ msgid "Image too high."
202
+ msgstr ""
203
+
204
+ #: ../vendor/upload/class.upload.php:2189
205
+ msgid "Image too short."
206
+ msgstr ""
207
+
208
+ #: ../vendor/upload/class.upload.php:2190
209
+ msgid "Image ratio too high (image too wide)."
210
+ msgstr ""
211
+
212
+ #: ../vendor/upload/class.upload.php:2191
213
+ msgid "Image ratio too low (image too high)."
214
+ msgstr ""
215
+
216
+ #: ../vendor/upload/class.upload.php:2192
217
+ msgid "Image has too many pixels."
218
+ msgstr ""
219
+
220
+ #: ../vendor/upload/class.upload.php:2193
221
+ msgid "Image has not enough pixels."
222
+ msgstr ""
223
+
224
+ #: ../vendor/upload/class.upload.php:2194
225
+ msgid "File not uploaded. Can't carry on a process."
226
+ msgstr ""
227
+
228
+ #: ../vendor/upload/class.upload.php:2195
229
+ #, php-format
230
+ msgid "%s already exists. Please change the file name."
231
+ msgstr ""
232
+
233
+ #: ../vendor/upload/class.upload.php:2196
234
+ msgid "No correct temp source file. Can't carry on a process."
235
+ msgstr ""
236
+
237
+ #: ../vendor/upload/class.upload.php:2197
238
+ msgid "No correct uploaded source file. Can't carry on a process."
239
+ msgstr ""
240
+
241
+ #: ../vendor/upload/class.upload.php:2198
242
+ msgid "Destination directory can't be created. Can't carry on a process."
243
+ msgstr ""
244
+
245
+ #: ../vendor/upload/class.upload.php:2199
246
+ msgid "Destination directory doesn't exist. Can't carry on a process."
247
+ msgstr ""
248
+
249
+ #: ../vendor/upload/class.upload.php:2200
250
+ msgid "Destination path is not a directory. Can't carry on a process."
251
+ msgstr ""
252
+
253
+ #: ../vendor/upload/class.upload.php:2201
254
+ msgid "Destination directory can't be made writeable. Can't carry on a process."
255
+ msgstr ""
256
+
257
+ #: ../vendor/upload/class.upload.php:2202
258
+ msgid "Destination path is not a writeable. Can't carry on a process."
259
+ msgstr ""
260
+
261
+ #: ../vendor/upload/class.upload.php:2203
262
+ msgid "Can't create the temporary file. Can't carry on a process."
263
+ msgstr ""
264
+
265
+ #: ../vendor/upload/class.upload.php:2204
266
+ msgid "Source file is not readable. Can't carry on a process."
267
+ msgstr ""
268
+
269
+ #: ../vendor/upload/class.upload.php:2205
270
+ #, php-format
271
+ msgid "No create from %s support."
272
+ msgstr ""
273
+
274
+ #: ../vendor/upload/class.upload.php:2206
275
+ #, php-format
276
+ msgid "Error in creating %s image from source."
277
+ msgstr ""
278
+
279
+ #: ../vendor/upload/class.upload.php:2207
280
+ msgid "Can't read image source. Not an image?."
281
+ msgstr ""
282
+
283
+ #: ../vendor/upload/class.upload.php:2208
284
+ msgid "GD doesn't seem to be present."
285
+ msgstr ""
286
+
287
+ #: ../vendor/upload/class.upload.php:2209
288
+ #, php-format
289
+ msgid "No create from %s support, can't read watermark."
290
+ msgstr ""
291
+
292
+ #: ../vendor/upload/class.upload.php:2210
293
+ #, php-format
294
+ msgid "No %s read support, can't create watermark."
295
+ msgstr ""
296
+
297
+ #: ../vendor/upload/class.upload.php:2211
298
+ msgid "Unknown image format, can't read watermark."
299
+ msgstr ""
300
+
301
+ #: ../vendor/upload/class.upload.php:2212
302
+ #, php-format
303
+ msgid "No %s create support."
304
+ msgstr ""
305
+
306
+ #: ../vendor/upload/class.upload.php:2213
307
+ msgid "No conversion type defined."
308
+ msgstr ""
309
+
310
+ #: ../vendor/upload/class.upload.php:2214
311
+ msgid "Error copying file on the server. copy() failed."
312
+ msgstr ""
313
+
314
+ #: ../vendor/upload/class.upload.php:2215
315
+ msgid "Error reading the file."
316
+ msgstr ""
317
+
framework/lang/it_IT.mo ADDED
Binary file
framework/lang/it_IT.po ADDED
@@ -0,0 +1,417 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: SidePosts WordPress Widget in italiano\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-02-06 01:15+0100\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Jordi Canals <devel@jcanals.cat>\n"
8
+ "Language-Team: Gianni Diurno | http://gidibao.net/ <gidibao@gmail.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
+ "X-Poedit-Language: Italian\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+ "X-Poedit-KeywordsList: \n"
16
+ "X-Poedit-Basepath: .\n"
17
+ "X-Poedit-Country: ITALY\n"
18
+ "X-Poedit-SearchPath-0: \n"
19
+
20
+ #: ../classes/abstract/module.php:599
21
+ msgid "Option blocked by administrator."
22
+ msgstr "Opzione bloccata dall'amministratore"
23
+
24
+ #: ../classes/abstract/plugin.php:344
25
+ #: ../classes/abstract/plugin.php:363
26
+ msgid "Warning:"
27
+ msgstr "Avvertimento:"
28
+
29
+ #: ../classes/abstract/plugin.php:345
30
+ #, php-format
31
+ msgid "The active plugin %s is not compatible with your WordPress version."
32
+ msgstr "Il plugin attivo %s non é compatibile con la tua versione WordPress."
33
+
34
+ #: ../classes/abstract/plugin.php:347
35
+ #, php-format
36
+ msgid "WordPress %s is required to run this plugin."
37
+ msgstr "E' necessario WordPress %s affinché questo plugin possa funzionare."
38
+
39
+ #: ../classes/abstract/plugin.php:364
40
+ msgid "Standard sidebar functions are not present."
41
+ msgstr "Non sono presenti le funzioni standard della sidebar."
42
+
43
+ #: ../classes/abstract/plugin.php:365
44
+ #, php-format
45
+ msgid "It is required to use the standard sidebar to run %s"
46
+ msgstr "E' necessario l'utilizzo della sidebar standard affinché funzioni %s"
47
+
48
+ #: ../classes/abstract/plugin.php:412
49
+ msgid "Activate Components"
50
+ msgstr ""
51
+
52
+ #: ../classes/abstract/plugin.php:421
53
+ msgid "Yes"
54
+ msgstr "Sí"
55
+
56
+ #: ../classes/abstract/plugin.php:422
57
+ msgid "No"
58
+ msgstr "No"
59
+
60
+ #: ../lib/formating.php:52
61
+ msgid "Settings saved."
62
+ msgstr "Le impostazioni sono state salvate"
63
+
64
+ #: ../lib/formating.php:160
65
+ msgid "Just Now"
66
+ msgstr "In questo momento"
67
+
68
+ #: ../lib/formating.php:163
69
+ #, php-format
70
+ msgid "1 minute ago"
71
+ msgid_plural "%d minutes ago"
72
+ msgstr[0] "1 minuto fa"
73
+ msgstr[1] "%d minuti fa"
74
+
75
+ #: ../lib/formating.php:166
76
+ #, php-format
77
+ msgid "1 hour ago"
78
+ msgid_plural "%d hours ago"
79
+ msgstr[0] "1 ora fa"
80
+ msgstr[1] "%d ore fa"
81
+
82
+ #: ../lib/formating.php:170
83
+ #, php-format
84
+ msgid "Today at %s"
85
+ msgstr "Oggi alle %s"
86
+
87
+ #: ../lib/formating.php:170
88
+ #, php-format
89
+ msgid "Yesterday at %s"
90
+ msgstr "Ieri alle %s"
91
+
92
+ #: ../lib/themes.php:160
93
+ msgid "Plugin Homepage"
94
+ msgstr ""
95
+
96
+ #: ../lib/themes.php:164
97
+ msgid "Theme Homepage"
98
+ msgstr ""
99
+
100
+ #: ../lib/themes.php:168
101
+ msgid "Documentation"
102
+ msgstr ""
103
+
104
+ #: ../lib/themes.php:172
105
+ msgid "Support Forum"
106
+ msgstr ""
107
+
108
+ #: ../lib/themes.php:176
109
+ msgid "Author Homepage"
110
+ msgstr ""
111
+
112
+ #: ../lib/themes.php:180
113
+ msgid "Donate to project"
114
+ msgstr ""
115
+
116
+ #: ../vendor/upload/class.upload.php:2171
117
+ msgid "File error. Please try again."
118
+ msgstr "Errore file. Riprova."
119
+
120
+ #: ../vendor/upload/class.upload.php:2172
121
+ msgid "Local file doesn't exist."
122
+ msgstr "Il file locale non esiste."
123
+
124
+ #: ../vendor/upload/class.upload.php:2173
125
+ msgid "Local file is not readable."
126
+ msgstr "Il file locale non é leggibile."
127
+
128
+ #: ../vendor/upload/class.upload.php:2174
129
+ msgid "File upload error (the uploaded file exceeds the upload_max_filesize directive in php.ini)."
130
+ msgstr "Errore caricamento file (il file eccede il limite fissato dalla direttiva upload_max_filesize impostato in php.ini)."
131
+
132
+ #: ../vendor/upload/class.upload.php:2175
133
+ msgid "File upload error (the uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form)."
134
+ msgstr "Errore caricamento file (il file eccede il limite fissato dalla direttiva MAX_FILE_SIZE specificata nel modulo html)."
135
+
136
+ #: ../vendor/upload/class.upload.php:2176
137
+ msgid "File upload error (the uploaded file was only partially uploaded)."
138
+ msgstr "Errore caricamento file (il file é stato pazialmente caricato)."
139
+
140
+ #: ../vendor/upload/class.upload.php:2177
141
+ msgid "File upload error (no file was uploaded)."
142
+ msgstr "Errore caricamento file (nessun file é stato caricato)."
143
+
144
+ #: ../vendor/upload/class.upload.php:2178
145
+ msgid "File upload error (missing a temporary folder)."
146
+ msgstr "Errore caricamento file (cartella temporanea inesistente)."
147
+
148
+ #: ../vendor/upload/class.upload.php:2179
149
+ msgid "File upload error (failed to write file to disk)."
150
+ msgstr "Errore caricamento file (non é stato possibile scrivere il file nel disco)."
151
+
152
+ #: ../vendor/upload/class.upload.php:2180
153
+ msgid "File upload error (file upload stopped by extension)."
154
+ msgstr "Errore caricamento file (blocco caricamento file dovuto alla estensione)."
155
+
156
+ #: ../vendor/upload/class.upload.php:2181
157
+ msgid "File upload error (unknown error code)."
158
+ msgstr "Errore caricamento file (codice errore sconosciuto)."
159
+
160
+ #: ../vendor/upload/class.upload.php:2182
161
+ msgid "File upload error. Please try again."
162
+ msgstr "Errore caricamento file. Riprova."
163
+
164
+ #: ../vendor/upload/class.upload.php:2183
165
+ msgid "File too big."
166
+ msgstr "File troppo grande."
167
+
168
+ #: ../vendor/upload/class.upload.php:2184
169
+ msgid "MIME type can't be detected."
170
+ msgstr "Non é possibile rilevare il formato MIME."
171
+
172
+ #: ../vendor/upload/class.upload.php:2185
173
+ msgid "Incorrect type of file."
174
+ msgstr "Tipo di file non corretto."
175
+
176
+ #: ../vendor/upload/class.upload.php:2186
177
+ msgid "Image too wide."
178
+ msgstr "Immagine troppo larga."
179
+
180
+ #: ../vendor/upload/class.upload.php:2187
181
+ msgid "Image too narrow."
182
+ msgstr "Immagine troppo stretta."
183
+
184
+ #: ../vendor/upload/class.upload.php:2188
185
+ msgid "Image too high."
186
+ msgstr "Immagine troppo alta."
187
+
188
+ #: ../vendor/upload/class.upload.php:2189
189
+ msgid "Image too short."
190
+ msgstr "Immagine troppo piccola."
191
+
192
+ #: ../vendor/upload/class.upload.php:2190
193
+ msgid "Image ratio too high (image too wide)."
194
+ msgstr "Proporzione immagine troppo elevata (immagine eccessivamente larga)."
195
+
196
+ #: ../vendor/upload/class.upload.php:2191
197
+ msgid "Image ratio too low (image too high)."
198
+ msgstr "Proporzione immagine troppo bassa (immagine eccessivamente alta)."
199
+
200
+ #: ../vendor/upload/class.upload.php:2192
201
+ msgid "Image has too many pixels."
202
+ msgstr "Immagine con troppi pixel."
203
+
204
+ #: ../vendor/upload/class.upload.php:2193
205
+ msgid "Image has not enough pixels."
206
+ msgstr "Immagine con pochi pixel."
207
+
208
+ #: ../vendor/upload/class.upload.php:2194
209
+ msgid "File not uploaded. Can't carry on a process."
210
+ msgstr "Il file non é stato caricato. Non é possibile proseguire l'operazione."
211
+
212
+ #: ../vendor/upload/class.upload.php:2195
213
+ #, php-format
214
+ msgid "%s already exists. Please change the file name."
215
+ msgstr "%s già esiste. Modifica il nome del file."
216
+
217
+ #: ../vendor/upload/class.upload.php:2196
218
+ msgid "No correct temp source file. Can't carry on a process."
219
+ msgstr "File temporaneo sorgente non valido. Non é possibile proseguire l'operazione."
220
+
221
+ #: ../vendor/upload/class.upload.php:2197
222
+ msgid "No correct uploaded source file. Can't carry on a process."
223
+ msgstr "Il file sorgente che é stato caricato non è valido. Non é possibile proseguire l'operazione."
224
+
225
+ #: ../vendor/upload/class.upload.php:2198
226
+ msgid "Destination directory can't be created. Can't carry on a process."
227
+ msgstr "La cartella di destinazione non può essere creata. Non é possibile proseguire l'operazione."
228
+
229
+ #: ../vendor/upload/class.upload.php:2199
230
+ msgid "Destination directory doesn't exist. Can't carry on a process."
231
+ msgstr "La cartella di destinazione non esiste. Non é possibile proseguire l'operazione."
232
+
233
+ #: ../vendor/upload/class.upload.php:2200
234
+ msgid "Destination path is not a directory. Can't carry on a process."
235
+ msgstr "Il percorso di destinazione non conduce ad una cartella. Non é possibile proseguire l'operazione."
236
+
237
+ #: ../vendor/upload/class.upload.php:2201
238
+ msgid "Destination directory can't be made writeable. Can't carry on a process."
239
+ msgstr "La cartella di destinazione non può essere resa scrivibile. Non é possibile proseguire l'operazione."
240
+
241
+ #: ../vendor/upload/class.upload.php:2202
242
+ msgid "Destination path is not a writeable. Can't carry on a process."
243
+ msgstr "Il percorso di destinazione non é scrivibile. Non é possibile proseguire l'operazione."
244
+
245
+ #: ../vendor/upload/class.upload.php:2203
246
+ msgid "Can't create the temporary file. Can't carry on a process."
247
+ msgstr "Non é stato possibile creare un file temporaneo. Non é possibile proseguire l'operazione."
248
+
249
+ #: ../vendor/upload/class.upload.php:2204
250
+ msgid "Source file is not readable. Can't carry on a process."
251
+ msgstr "Il file sorgente non é leggibile. Non é possibile proseguire l'operazione."
252
+
253
+ #: ../vendor/upload/class.upload.php:2205
254
+ #, php-format
255
+ msgid "No create from %s support."
256
+ msgstr "Impossibile creare dal supporto %s."
257
+
258
+ #: ../vendor/upload/class.upload.php:2206
259
+ #, php-format
260
+ msgid "Error in creating %s image from source."
261
+ msgstr "Errore durante la creazione della immagine %s (via sorgente)."
262
+
263
+ #: ../vendor/upload/class.upload.php:2207
264
+ msgid "Can't read image source. Not an image?."
265
+ msgstr "Impossibile la lettura del sorgente immagine. Forse, non é una immagine!"
266
+
267
+ #: ../vendor/upload/class.upload.php:2208
268
+ msgid "GD doesn't seem to be present."
269
+ msgstr "Pare che la libreria GD non sia presente."
270
+
271
+ #: ../vendor/upload/class.upload.php:2209
272
+ #, php-format
273
+ msgid "No create from %s support, can't read watermark."
274
+ msgstr "Nessuna creazione dal supporto %s. Impossibile leggere la filigrana."
275
+
276
+ #: ../vendor/upload/class.upload.php:2210
277
+ #, php-format
278
+ msgid "No %s read support, can't create watermark."
279
+ msgstr "Nessun supporto di lettura %s. Impossibile creare la filigrana."
280
+
281
+ #: ../vendor/upload/class.upload.php:2211
282
+ msgid "Unknown image format, can't read watermark."
283
+ msgstr "Formato immagine sconosciuto. Impossibile leggere la filigrana."
284
+
285
+ #: ../vendor/upload/class.upload.php:2212
286
+ #, php-format
287
+ msgid "No %s create support."
288
+ msgstr "Nessuna creazione dal supporto %s."
289
+
290
+ #: ../vendor/upload/class.upload.php:2213
291
+ msgid "No conversion type defined."
292
+ msgstr "Non é stato definito alcun tipo di conversione."
293
+
294
+ #: ../vendor/upload/class.upload.php:2214
295
+ msgid "Error copying file on the server. copy() failed."
296
+ msgstr "Errore durante la copia del file sul server. copy() failed."
297
+
298
+ #: ../vendor/upload/class.upload.php:2215
299
+ msgid "Error reading the file."
300
+ msgstr "Errore nella lettura del file."
301
+
302
+ #~ msgid "The active plugin %s is not compatible with your PHP version."
303
+ #~ msgstr "Il plugin attivo %s non é compatibile con la tua versione PHP."
304
+ #~ msgid "%s is required for this plugin."
305
+ #~ msgstr "%s necessario per questo plugin."
306
+ #~ msgid "A widget to move posts to the sidebar."
307
+ #~ msgstr "Un widget per poter spostare gli articoli nella barra laterale."
308
+ #~ msgid "Category not selected."
309
+ #~ msgstr "La categoria non é stata selezionata."
310
+ #~ msgid "Read more &raquo;"
311
+ #~ msgstr "Prosegui la lettura &raquo;"
312
+ #~ msgid "No Comments"
313
+ #~ msgstr "Nessun commento"
314
+ #~ msgid "1 Comment"
315
+ #~ msgstr "1 Commento"
316
+ #~ msgid "% Comments"
317
+ #~ msgstr "% Commenti"
318
+ #~ msgid "Comments closed"
319
+ #~ msgstr "I commenti sono stati disattivati"
320
+ #~ msgid "Archive for"
321
+ #~ msgstr "Archivo per"
322
+ #~ msgid "Title:"
323
+ #~ msgstr "Titolo:"
324
+ #~ msgid "Category:"
325
+ #~ msgstr "Categoria:"
326
+ #~ msgid "-- PRIVATE POSTS --"
327
+ #~ msgstr "-- ARTICOLI PRIVATI --"
328
+ #~ msgid "Number of posts:"
329
+ #~ msgstr "Numero di articoli:"
330
+ #~ msgid "(At most %d)"
331
+ #~ msgstr "(massimo %d)"
332
+ #~ msgid "Show:"
333
+ #~ msgstr "Mostra:"
334
+ #~ msgid "Full Post"
335
+ #~ msgstr "Articolo completo"
336
+ #~ msgid "Post Excerpt"
337
+ #~ msgstr "Riassunto dell'articolo"
338
+ #~ msgid "Excerpts with thumbnails"
339
+ #~ msgstr "Riassunti con miniatura"
340
+ #~ msgid "Photo Blog"
341
+ #~ msgstr "Photo Blog"
342
+ #~ msgid "Only Post Title"
343
+ #~ msgstr "Solo il titolo del post"
344
+ #~ msgid "Show category on all feeds"
345
+ #~ msgstr "Mostra la categoria in tutti i feed"
346
+ #~ msgid "Image width:"
347
+ #~ msgstr "Larghezza immagine:"
348
+ #~ msgid "pixels"
349
+ #~ msgstr "pixel"
350
+ #~ msgid "Align thumbnail to right"
351
+ #~ msgstr "Allinea la miniatura a destra"
352
+ #~ msgid "Read full post &raquo;"
353
+ #~ msgstr "Leggi l'articolo completo &raquo;"
354
+ #~ msgid "No posts found"
355
+ #~ msgstr "Non é stato trovato alcun articolo"
356
+ #~ msgid "Incompatible System"
357
+ #~ msgstr "Sistema incompatibile"
358
+ #~ msgid "Read More..."
359
+ #~ msgstr "Continua..."
360
+ #~ msgid "DailyTube Plugin Settings"
361
+ #~ msgstr "Configuración de DailyTube"
362
+ #~ msgid ""
363
+ #~ "DailyTube plugin has been updated. Please, check your plugin settings."
364
+ #~ msgstr ""
365
+ #~ "La extensión DailyTube ha sido actualizada. Por favor, revisa la "
366
+ #~ "configuración de esta extensión."
367
+ #~ msgid ""
368
+ #~ "CAUTION: You updated from a version prior to 1.0. For this reason your "
369
+ #~ "settings have been reverted to defaults."
370
+ #~ msgstr ""
371
+ #~ "ATENCION: Has actualizado desde una versión anterior a 1.0. Por este "
372
+ #~ "motivo, las opciones se han revertido a valores por defecto."
373
+ #~ msgid "DailyTube Settings"
374
+ #~ msgstr "Configuración DailyTube"
375
+ #~ msgid "<strong>Note:</strong> All sizes must be entered as Width x Height"
376
+ #~ msgstr "<strong>Nota:</strong> Todos los tamaños son Ancho x Alto"
377
+ #~ msgid "Content tag:"
378
+ #~ msgstr "Etiqueta de contenido:"
379
+ #~ msgid "Video Size:"
380
+ #~ msgstr "Tamaño de vídeo:"
381
+ #~ msgid "Show Related Videos?"
382
+ #~ msgstr "¿Mostrar vídeos relacionados?"
383
+ #~ msgid "Player Color:"
384
+ #~ msgstr "Color del reproductor:"
385
+ #~ msgid "Show Border?"
386
+ #~ msgstr "¿Mostrar marco?"
387
+ #~ msgid "Enhanced Genie Menu?"
388
+ #~ msgstr "¿Utilizar menú \"Genie\"?"
389
+ #~ msgid "Wide format tag:"
390
+ #~ msgstr "Marcador formato panorámico:"
391
+ #~ msgid "Square format tag:"
392
+ #~ msgstr "Marcador de formato cuadrado:"
393
+ #~ msgid "Wide Video Size"
394
+ #~ msgstr "Tamaño de vídeo panorámico"
395
+ #~ msgid "Square Video Size"
396
+ #~ msgstr "Tamaño de vídeo cuadrado"
397
+ #~ msgid "Allow FullScreen?"
398
+ #~ msgstr "¿Permitir pantalla completa?"
399
+ #~ msgid "Global Settings"
400
+ #~ msgstr "Opciones Generales"
401
+ #~ msgid "Video Align:"
402
+ #~ msgstr "Alineación del vídeo:"
403
+ #~ msgid "None"
404
+ #~ msgstr "Ninguna"
405
+ #~ msgid "Left"
406
+ #~ msgstr "Izquierda"
407
+ #~ msgid "Center"
408
+ #~ msgstr "Centro"
409
+ #~ msgid "Right"
410
+ #~ msgstr "Derecha"
411
+ #~ msgid "Save Changes"
412
+ #~ msgstr "Guardar Cambios"
413
+ #~ msgid "YouTube & Google Video Size"
414
+ #~ msgstr "Tamaño de vídeo YouTube y Google"
415
+ #~ msgid "or"
416
+ #~ msgstr "o"
417
+
framework/lib/filesystem.php ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Functions related to the file system and system settings.
4
+ *
5
+ * @version $Rev: 203758 $
6
+ * @author Jordi Canals
7
+ * @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
8
+ * @license GNU General Public License version 2
9
+ * @link http://alkivia.org
10
+ * @package Alkivia
11
+ * @subpackage Framework
12
+ *
13
+
14
+ Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
15
+
16
+ This program is free software; you can redistribute it and/or
17
+ modify it under the terms of the GNU General Public License
18
+ version 2 as published by the Free Software Foundation.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+
29
+ /**
30
+ * Creates a subdirectory within the WordPress uploads folder.
31
+ *
32
+ * @uses apply_filters() Calls the 'ak_upload_dir' on the upload folder directory.
33
+ * @param string $name New subdirectory name.
34
+ * @return void
35
+ */
36
+ function ak_create_upload_folder( $name )
37
+ {
38
+ if ( ! defined('AK_UPLOAD_DIR') ) {
39
+ $uploads = wp_upload_dir();
40
+ define ( 'AK_UPLOAD_DIR', $upload['basedir'] .'/alkivia' );
41
+ }
42
+
43
+ $folder = apply_filters('ak_upload_dir', AK_UPLOAD_DIR . '/' . $name);
44
+ wp_mkdir_p($folder);
45
+ }
46
+
47
+ /**
48
+ * Returns the system max filesize for uploads.
49
+ * This depends on the directives upload_max_filesize, post_max_size and memory_limit. The lowest of them is the limit.
50
+ *
51
+ * @return int Max system filesize upload (in bytes).
52
+ */
53
+ function ak_max_upload()
54
+ {
55
+
56
+ $file = ak_return_bytes(ini_get('upload_max_filesize'));
57
+ $post = ak_return_bytes(ini_get('post_max_size'));
58
+ $mem = ak_return_bytes(ini_get('memory_limit'));
59
+
60
+ return min($file, $post, $mem);
61
+ }
62
+
63
+ /**
64
+ * Converts a PHP config value to bytes.
65
+ *
66
+ * @param $string PHP config value, as readed with ini_get()
67
+ * @return int Value in bytes.
68
+ */
69
+ function ak_return_bytes( $value )
70
+ {
71
+ $val = trim($value);
72
+ $unit = strtoupper($val[strlen($val)-1]);
73
+
74
+ switch ( $unit ) {
75
+ case 'G': // GigaBytes
76
+ $val *= 1024;
77
+ case 'M': // MegaBytes
78
+ $val *= 1024;
79
+ case 'K': // KiloBytes
80
+ $val *= 1024;
81
+ }
82
+
83
+ return $val;
84
+ }
85
+
86
+ /**
87
+ * Formats a value in bytes to the bigger unit. (Gb, Mb, Kb).
88
+ *
89
+ * @param int $value Value to convert.
90
+ * @return string Formated value.
91
+ */
92
+ function ak_return_units( $value, $max = 'G' )
93
+ {
94
+ $max = strtoupper($max);
95
+ $unit = 'bytes';
96
+
97
+ if ( $value >= 1024 ) {
98
+ $value /= 1024;
99
+ $unit = 'Kb';
100
+ }
101
+ if ( $value >= 1024 && ( 'M' == $max || 'G' == $max ) ){
102
+ $value /= 1024;
103
+ $unit = 'Mb';
104
+ }
105
+ if ( $value >= 1024 && ( 'G' == $max) ) {
106
+ $value /= 1024;
107
+ $unit = 'Gb';
108
+ }
109
+
110
+ $val = intval($value) . ' ' . $unit;
111
+ return $val;
112
+ }
113
+
114
+ /**
115
+ * Creates and returns an ordered list for files in a given directori.
116
+ * The function recurses into all directory tree.
117
+ *
118
+ * @param string $directory Directory where search for files. Absolute path.
119
+ * @param array $args Options array to select wich files to return. Options:
120
+ * - tree: recurses into subdirectories. 0 = No, 1 (default) = Yes
121
+ * - extensions: array or comma delimited list of wanted extensions (default all extensions).
122
+ * - with_ext: Return filename with extension. 0 = No, 1 (default) = Yes
123
+ * - prefix: A filename prefix for returned files (default = No prefix).
124
+ * @param boolean $withexst We want returned filenames with extension. Defaults true.
125
+ * @return array List of files found.
126
+ */
127
+ function ak_dir_content($directory, $args='')
128
+ {
129
+
130
+ $directory = realpath($directory); // Be sure the directory path is well formed.
131
+ if ( ! is_dir($directory) ) { // Check if it is a directory.
132
+ return array(); // If not, return an ampty array.
133
+ }
134
+
135
+ $defaults = array(
136
+ 'tree' => 1, // recurses into subdirectories (0 = No, 1 = Yes)
137
+ 'extensions' => '', // array or comma delimited list of wanted extensions
138
+ 'with_ext' => 1, // Return filename with extension (0 = No, 1 = Yes)
139
+ 'prefix' => ''); // If we only want files with a custom prefix set the prefix option.
140
+
141
+ $options = wp_parse_args($args, $defaults);
142
+ extract($options, EXTR_SKIP);
143
+
144
+ if ( ! empty($extensions) && ! is_array($extensions) ) {
145
+ $extensions = explode(',', $extensions);
146
+ }
147
+
148
+ $dir_tree = array(); // Directory could be empty.
149
+ $d = dir($directory);
150
+ while ( false !== ( $filename = $d->read() ) ) {
151
+ if ( $prefix != substr($filename, 0, strlen($prefix)) || '.' == substr($filename, 0, 1) ) {
152
+ continue;
153
+ }
154
+
155
+ if ( is_dir($directory . DIRECTORY_SEPARATOR . $filename) && $tree ) {
156
+ $dir_tree[$filename] = ak_dir_content($directory . DIRECTORY_SEPARATOR . $filename, $options);
157
+ } else {
158
+ $fileinfo = pathinfo($directory . DIRECTORY_SEPARATOR . $filename);
159
+ if ( empty($extensions) || in_array($fileinfo['extension'], $extensions) ) {
160
+ if ( ! $with_ext ) {
161
+ $filename = substr($filename, 0, (strlen($fileinfo['extension']) + 1) * -1);
162
+ }
163
+ $dir_tree[] = $filename;
164
+ }
165
+ }
166
+ }
167
+ $d->close();
168
+ asort($dir_tree);
169
+
170
+ return $dir_tree;
171
+ }
172
+
173
+ /**
174
+ * Returns a list of templates found in an array of directories
175
+ *
176
+ * @param array|string $folders Array of folders to search in.
177
+ * @param string $prefix Templates prefix filter.
178
+ * @return array Found templates (all found php files).
179
+ */
180
+ function ak_get_templates( $folders, $prefix = '' )
181
+ {
182
+ // Compatibility with a bug in Sideposts 3.0 and 3.0.1
183
+ if ( strpos($prefix, '&') ) $prefix = '';
184
+
185
+ $list = array();
186
+ foreach ( (array) $folders as $folder ) {
187
+ $found = ak_dir_content($folder, "tree=0&extensions=php&with_ext=0&prefix={$prefix}");
188
+ $list = array_merge($found, $list);
189
+ }
190
+
191
+ $start = strlen($prefix);
192
+ foreach ( $list as $item ) {
193
+ $name = substr($item, $start);
194
+ $templates[$name] = ucfirst(str_replace('_', ' ', $name));
195
+ }
196
+
197
+ return $templates;
198
+ }
framework/lib/formating.php ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * General formating functions.
4
+ * Used to format output data and send messages to user.
5
+ *
6
+ * @version $Rev: 199485 $
7
+ * @author Jordi Canals
8
+ * @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
9
+ * @license GNU General Public License version 2
10
+ * @link http://alkivia.org
11
+ * @package Alkivia
12
+ * @subpackage Framework
13
+ *
14
+
15
+ Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
16
+
17
+ This program is free software; you can redistribute it and/or
18
+ modify it under the terms of the GNU General Public License
19
+ version 2 as published by the Free Software Foundation.
20
+
21
+ This program is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
+
26
+ You should have received a copy of the GNU General Public License
27
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
28
+ */
29
+
30
+ /**
31
+ * Converts vars with values equivalent to zero (0) to an empty string.
32
+ * This is useful as an output filter, when we need and empty textbox.
33
+ *
34
+ * @param mixed $var Input value to convert.
35
+ * @return string Empty string if value is equivalent to zero.
36
+ */
37
+ function ak_zero_clean( $var )
38
+ {
39
+ return ( 0 == intval($var) ) ? '' : $var;
40
+ }
41
+
42
+ /**
43
+ * Displays admin notices.
44
+ *
45
+ * @param $message Message to display.
46
+ * @return void
47
+ */
48
+ function ak_admin_notify( $message = '' )
49
+ {
50
+ if ( is_admin() ) {
51
+ if ( empty($message) ) {
52
+ $message = __('Settings saved.', 'akfw');
53
+ }
54
+ echo '<div id="message" class="updated fade"><p><strong>' . $message . '</strong></p></div>';
55
+ }
56
+ }
57
+
58
+ /**
59
+ * Displays admin ERRORS.
60
+ *
61
+ * @param $message Message to display.
62
+ * @return void
63
+ */
64
+ function ak_admin_error( $message )
65
+ {
66
+ if ( is_admin() ) {
67
+ echo '<div id="error" class="error"><p><strong>' . $message . '</strong></p></div>';
68
+ }
69
+ }
70
+
71
+ /**
72
+ * Displays dashboard notices by setting the 'admin_notices' action hook.
73
+ * This is used for global warnings that have to show in all dashboard pages.
74
+ *
75
+ * @uses akAdminNotice
76
+ * @param $message Message to display.
77
+ * @return void
78
+ */
79
+ function ak_dashboard_notice( $message )
80
+ {
81
+ if ( is_admin() ) {
82
+ require_once ( AK_CLASSES . '/admin-notices.php' );
83
+ new akAdminNotice($message);
84
+ }
85
+ }
86
+
87
+ /**
88
+ * Generic pager.
89
+ *
90
+ * @param int $total Total elements to paginate.
91
+ * @param int $per_page Number of elements per page.
92
+ * @param $current Current page number.
93
+ * @param $url Base url for links. Only page numbers are appended.
94
+ * @return string Formated pager.
95
+ */
96
+ function ak_pager( $total, $per_page, $url, $current = 0 )
97
+ {
98
+ if ( 0 == $current ) $current = 1;
99
+
100
+ $pages = $total / $per_page;
101
+ $pages = ( $pages == intval($pages) ) ? intval($pages) : intval($pages) + 1;
102
+
103
+ if ( $pages == 1 ) {
104
+ $out = '';
105
+ } else {
106
+ $out = "<div class='pager'>\n";
107
+ if ( $current != 1 ) {
108
+ $start = $current - 1;
109
+ $out .= '<a class="prev page-numbers" href="'. $url . $start .'">&laquo;&laquo;</a>' . "\n";
110
+ }
111
+
112
+ for ( $i = 1; $i <= $pages; $i++ ) {
113
+ if ( $i == $current ) {
114
+ $out .= '<span class="page-numbers current">'. $i ."</span>\n";
115
+ } else {
116
+ $out .= '<a class="page-numbers" href="'. $url . $i .'">'. $i ."</a>\n";
117
+ }
118
+ }
119
+
120
+ if ( $current != $pages ) {
121
+ $start = $current + 1;
122
+ $out .= '<a class="next page-numbers" href="'. $url . $start .'">&raquo;&raquo;</a>' . "\n";
123
+ }
124
+ $out .= "</div>\n";
125
+ }
126
+
127
+ return $out;
128
+ }
129
+
130
+ /**
131
+ * Creates an string telling how many time ago
132
+ *
133
+ * @param $datetime Date Time in mySql Format.
134
+ * @return string The time from the date to now, just looks to yesterday.
135
+ */
136
+ function ak_time_ago( $datetime )
137
+ {
138
+ $before = strtotime($datetime);
139
+ $is_today = ( date('Y-m-d') == substr($datetime, 0, 10) );
140
+ $now = time();
141
+
142
+ $times = array (
143
+ 'd' => 43200, // 12 hours
144
+ 'h' => 3600, // 1 hour
145
+ 'm' => 60, // 1 minute
146
+ 's' => 1 // 1 second
147
+ );
148
+
149
+ $diff = $now - $before;
150
+ foreach ( $times as $unit => $seconds ) {
151
+ if ( $diff >= $seconds ) {
152
+ $value = intval($diff / $seconds);
153
+ break;
154
+ }
155
+ }
156
+
157
+ $format = get_option('date_format') . ' | ' . get_option('time_format'); // Date-Time format
158
+ switch ( $unit ) {
159
+ case 's':
160
+ $ago = __('Just Now', 'akfw');
161
+ break;
162
+ case 'm':
163
+ $ago = sprintf(_n('1 minute ago', '%d minutes ago', $value, 'akfw'), $value);
164
+ break;
165
+ case 'h' :
166
+ $ago = sprintf(_n('1 hour ago', '%d hours ago', $value, 'akfw'), $value);
167
+ break;
168
+ case 'd' :
169
+ if ( 1 == $value ) {
170
+ $literal = ( $is_today ) ? __('Today at %s', 'akfw') : __('Yesterday at %s', 'akfw');
171
+ $ago = sprintf($literal, date('H:i', $before));
172
+ } else {
173
+ $ago = mysql2date($format, $datetime);
174
+ }
175
+ break;
176
+ }
177
+
178
+ return $ago;
179
+ }
framework/lib/modules.php ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Modules related functions.
4
+ *
5
+ * @version $Rev: 203758 $
6
+ * @author Jordi Canals
7
+ * @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
8
+ * @license GNU General Public License version 2
9
+ * @link http://alkivia.org
10
+ * @package Alkivia
11
+ * @subpackage Framework
12
+ *
13
+
14
+ Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
15
+
16
+ This program is free software; you can redistribute it and/or
17
+ modify it under the terms of the GNU General Public License
18
+ version 2 as published by the Free Software Foundation.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+
29
+ /**
30
+ * Parse the plugin readme.txt file to retrieve plugin's metadata.
31
+ *
32
+ * The metadata of the plugin's readme searches for the following in the readme.txt
33
+ * header. All metadata must be on its own line. The below is formatted for printing.
34
+ *
35
+ * <code>
36
+ * Contributors: contributors nicknames, comma delimited
37
+ * Donate link: Link to plugin donate page
38
+ * Tags: Plugin tags, comma delimited
39
+ * Requires at least: Minimum WordPress version required
40
+ * Tested up to: Higher WordPress version the plugin has been tested.
41
+ * Stable tag: Latest stable tag in repository.
42
+ * </code>
43
+ *
44
+ * Readme data returned array cointains the following:
45
+ * - 'Contributors' - An array with all contributors nicknames.
46
+ * - 'Tags' - An array with all plugin tags.
47
+ * - 'DonateURI' - The donations page address.
48
+ * - 'HelpURI' - Link to the forum page.
49
+ * - 'DocsURI' - Link to module documentation.
50
+ * - 'Required' - Minimum required WordPress version.
51
+ * - 'Tested' - Higher WordPress version this plugin has been tested.
52
+ * - 'Stable' - Last stable tag when this was released.
53
+ *
54
+ * The first 8kiB of the file will be pulled in and if the readme data is not
55
+ * within that first 8kiB, then the plugin author should correct their plugin
56
+ * and move the plugin data headers to the top.
57
+ *
58
+ * The readme file is assumed to have permissions to allow for scripts to read
59
+ * the file. This is not checked however and the file is only opened for
60
+ * reading.
61
+ *
62
+ * @param string $mod_file Path to the plugin file (not the readme file)
63
+ * @return array See above for description.
64
+ */
65
+ function ak_module_readme_data( $mod_file )
66
+ {
67
+ $file = dirname($mod_file) . '/readme.txt';
68
+
69
+ if ( is_readable($file) ) {
70
+ $fp = fopen($file, 'r'); // Open just for reading.
71
+ $data = fread( $fp, 8192 ); // Pull the first 8kiB of the file in.
72
+ fclose($fp); // Close the file.
73
+
74
+ preg_match( '|Contributors:(.*)$|mi', $data, $contributors );
75
+ preg_match( '|Donate link:(.*)$|mi', $data, $uri );
76
+ preg_match( '|Help link:(.*)$|mi', $data, $help ); // Not WP Standard
77
+ preg_match( '|Docs link:(.*)$|mi', $data, $docs ); // Not WP Standard
78
+ preg_match( '|Tags:(.*)|mi', $data, $tags );
79
+ preg_match( '|Requires at least:(.*)$|mi', $data, $required );
80
+ preg_match( '|Tested up to:(.*)$|mi', $data, $tested );
81
+ preg_match( '|Stable tag:(.*)$|mi', $data, $stable );
82
+
83
+ foreach ( array( 'contributors', 'uri', 'help', 'docs', 'tags', 'required', 'tested', 'stable' ) as $field ) {
84
+ if ( !empty( ${$field} ) ) {
85
+ ${$field} = trim(${$field}[1]);
86
+ } else {
87
+ ${$field} = '';
88
+ }
89
+ }
90
+
91
+ $readme_data = array(
92
+ 'Contributors' => array_map('trim', explode(',', $contributors)),
93
+ 'Tags' => array_map('trim', explode(',', $tags)),
94
+ 'DonateURI' => trim($uri),
95
+ 'HelpURI' => $help,
96
+ 'DocsURI' => $docs,
97
+ 'Requires' => trim($required),
98
+ 'Tested' => trim($tested),
99
+ 'Stable' => trim($stable) );
100
+ } else {
101
+ $readme_data = array();
102
+ }
103
+
104
+ return $readme_data;
105
+ }
106
+
107
+ /**
108
+ * Reads a component file header, and returns component data.
109
+ * Returned data is:
110
+ * - 'File' - The component filename, relative to the plugin folder.
111
+ * - 'Component' - The component short name or ID.
112
+ * - 'Name' - Descriptive name for the component.
113
+ * - 'Description' - A descriptive text about the component.
114
+ * - 'Author' - Component author name
115
+ * - 'URL' - Author homepage URL.
116
+ * - 'Link' - Author anchor to home page.
117
+ * - 'Core' - If this is a core compoment or not.
118
+ *
119
+ * @since 0.7
120
+ *
121
+ * @param string $file File name to read the header
122
+ * @param $is_core If will return data for core components or not.
123
+ * @return array Component data, see above.
124
+ */
125
+ function ak_component_data ( $file, $is_core = false )
126
+ {
127
+ $fp = fopen($file, 'r'); // Open just for reading.
128
+ $data = fread( $fp, 8192 ); // Pull the first 8kiB of the file in.
129
+ fclose($fp); // Close the file.
130
+
131
+ preg_match( '|Module Component:(.*)$|mi', $data, $component );
132
+ if ( empty($component) && $is_core ) {
133
+ preg_match( '|Core Component:(.*)$|mi', $data, $component );
134
+ $core = 1;
135
+ } else {
136
+ $core = 0;
137
+ }
138
+ preg_match( '|Parent ID:(.*)$|mi', $data, $parent );
139
+ preg_match( '|Component Name:(.*)$|mi', $data, $name );
140
+ preg_match( '|Description:(.*)|mi', $data, $description );
141
+ preg_match( '|Version:(.*)|mi', $data, $version );
142
+ preg_match( '|Author:(.*)|mi', $data, $author );
143
+ preg_match( '|Link:(.*)|mi', $data, $url );
144
+
145
+ foreach ( array( 'component', 'parent', 'name', 'description', 'version', 'author', 'url' ) as $field ) {
146
+ if ( ! empty( ${$field} ) ) {
147
+ ${$field} = trim(${$field}[1]);
148
+ } else {
149
+ ${$field} = '';
150
+ }
151
+ }
152
+
153
+ if ( empty($component) ) {
154
+ $data = false;
155
+ } else {
156
+ $data = array(
157
+ 'Component' => str_replace(' ', '_', strtolower($component)),
158
+ 'File' => $file,
159
+ 'Parent' => $parent,
160
+ 'Name' => $name,
161
+ 'Description' => $description,
162
+ 'Version' => $version,
163
+ 'Author' => $author,
164
+ 'URL' => $url,
165
+ 'Link' => "<a href='{$url}' target='_blank'>{$author}</a>",
166
+ 'Core' => $core);
167
+ }
168
+
169
+ return $data;
170
+ }
171
+
172
+ /**
173
+ * Gets information about all optional installed components.
174
+ * The function is recursive to find files in all directory levels.
175
+ *
176
+ * TODO: Path must be provided as AOC_PATH is only for community plugin.
177
+ * @since 0.7
178
+ *
179
+ * @param string $path Absolute path where to search for components.
180
+ * @param boolean $core If we want to include the core components or not.
181
+ * @param array $files An array with filenames to seach information in. If empty will search on $path.
182
+ * @return array Array with all found components information.
183
+ */
184
+ function ak_get_installed_components( $path, $core = false, $files = array() )
185
+ {
186
+ if ( empty($files) ) {
187
+ $files = ak_dir_content($path, 'extensions=php');
188
+ }
189
+
190
+ $components = array();
191
+ foreach ( $files as $subdir => $file ) {
192
+ if ( is_array($file) ) {
193
+ $newdir = $path .'/'. $subdir;
194
+ $data = ak_get_installed_components( $newdir, $core, $file );
195
+ if ( is_array($data) ) {
196
+ $components = array_merge($components, $data);
197
+ }
198
+ } else {
199
+ $data = ak_component_data($path . '/' . $file, $core);
200
+ if ( is_array($data) ) {
201
+ $components[$data['Component']] = $data;
202
+ }
203
+ }
204
+ }
205
+
206
+ return $components;
207
+ }
framework/lib/objects.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Functions for objects management.
4
+ *
5
+ * @version $Rev: 198515 $
6
+ * @author Jordi Canals
7
+ * @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
8
+ * @license GNU General Public License version 2
9
+ * @link http://alkivia.org
10
+ * @package Alkivia
11
+ * @subpackage Framework
12
+ *
13
+
14
+ Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
15
+
16
+ This program is free software; you can redistribute it and/or
17
+ modify it under the terms of the GNU General Public License
18
+ version 2 as published by the Free Software Foundation.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+
29
+ if ( ! isset($GLOBALS['_akv']) )
30
+ {
31
+ // Create the global $_akv. This holds all objects and settings.
32
+ $GLOBALS['_akv'] = array();
33
+ }
34
+
35
+ /**
36
+ * Creates and stores an object in the $_akv global.
37
+ * Can be called at the same time we create the object: ak_store_object( 'obj_name', new objectName() );
38
+ *
39
+ * @param string $name Internal object name.
40
+ * @param object $object The object reference to store in the global.
41
+ * @return object The newly stored object reference.
42
+ */
43
+ function & ak_create_object ( $name, $object )
44
+ {
45
+ $GLOBALS['_akv'][$name] =& $object;
46
+ return $object;
47
+ }
48
+
49
+ /**
50
+ * Gets an object stored in the $_akv global.
51
+ *
52
+ * @param string $name Object name.
53
+ * @return object|false Returns the requested object reference. If not found, or not an object, returns false.
54
+ */
55
+ function & ak_get_object ( $name )
56
+ {
57
+ if ( is_object($GLOBALS['_akv'][$name]) ) {
58
+ return $GLOBALS['_akv'][$name];
59
+ } else {
60
+ return false;
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Checks if an object exists in the $_akv global.
66
+ *
67
+ * @param string $name Object name to check.
68
+ * @return boolean If the object exists or not.
69
+ */
70
+ function ak_object_exists ( $name )
71
+ {
72
+ global $_akv;
73
+
74
+ if ( isset($_akv[$name]) && is_object($_akv[$name]) ) {
75
+ return true;
76
+ } else {
77
+ return false;
78
+ }
79
+ }
80
+
81
+ /**
82
+ * Returns the 'settings' object reference.
83
+ *
84
+ * @return object|false Returns the object reference, or false if not found.
85
+ */
86
+ function & ak_settings_object ()
87
+ {
88
+ if ( ak_object_exists('settings') ) {
89
+ return ak_get_object('settings');
90
+ } else {
91
+ return ak_create_object('settings', new akSettings());
92
+ }
93
+ }
94
+
95
+ /**
96
+ * Returns an object option/setting.
97
+ *
98
+ * @param string $object Object name to get options from.
99
+ * @param string $option Option name to return.
100
+ * @param mixed $default Default value if option not found.
101
+ * @return mixed The option value.
102
+ */
103
+ function ak_get_option ( $object, $option = '', $default = false )
104
+ {
105
+ if ( is_object($GLOBALS['_akv'][$object]) && method_exists($GLOBALS['_akv'][$object], 'getOption') ) {
106
+ return $GLOBALS['_akv'][$object]->getOption($option, $default);
107
+ } else {
108
+ return $default;
109
+ }
110
+ }
framework/lib/plugins.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugins related functions.
4
+ * This file is deprecated and has been replaced by modules.php.
5
+ *
6
+ * @version $Rev: 198515 $
7
+ * @author Jordi Canals
8
+ * @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
9
+ * @license GNU General Public License version 2
10
+ * @link http://alkivia.org
11
+ * @package Alkivia
12
+ * @subpackage Framework
13
+ *
14
+ * @deprecated since 0.5
15
+ * @see modules.php
16
+ *
17
+
18
+ Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
19
+
20
+ This program is free software; you can redistribute it and/or
21
+ modify it under the terms of the GNU General Public License
22
+ version 2 as published by the Free Software Foundation.
23
+
24
+ This program is distributed in the hope that it will be useful,
25
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
26
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27
+ GNU General Public License for more details.
28
+
29
+ You should have received a copy of the GNU General Public License
30
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
31
+ */
32
+
33
+ require_once ( 'AK_LIB' . '/modules.php' );
framework/lib/system.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Functions related to WordPress system.
4
+ *
5
+ * @version $Rev: 198515 $
6
+ * @author Jordi Canals
7
+ * @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
8
+ * @license GNU General Public License version 2
9
+ * @link http://alkivia.org
10
+ * @package Alkivia
11
+ * @subpackage Framework
12
+ *
13
+
14
+ Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
15
+
16
+ This program is free software; you can redistribute it and/or
17
+ modify it under the terms of the GNU General Public License
18
+ version 2 as published by the Free Software Foundation.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+
29
+ /**
30
+ * Checks is we are running on WordPress MU
31
+ * @return boolean
32
+ */
33
+ function ak_is_mu()
34
+ {
35
+ return ( defined('VHOST') ) ? true : false;
36
+ }
framework/lib/themes.php ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Functions library for theme management.
4
+ *
5
+ * @version $Rev: 203758 $
6
+ * @author Jordi Canals
7
+ * @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
8
+ * @license GNU General Public License version 2
9
+ * @link http://alkivia.org
10
+ * @package Alkivia
11
+ * @subpackage Framework
12
+ *
13
+
14
+ Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
15
+
16
+ This program is free software; you can redistribute it and/or
17
+ modify it under the terms of the GNU General Public License
18
+ version 2 as published by the Free Software Foundation.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+
29
+ /**
30
+ * Creates and stores an object in the $_akv global.
31
+ * Can be called at the same time we create the object: ak_store_object( 'obj_name', new objectName() );
32
+ *
33
+ * @param string $name Internal object name.
34
+ * @param object $object The object reference to store in the global.
35
+ * @return object The newly stored object reference.
36
+ */
37
+ function & ak_create_theme ( $theme )
38
+ {
39
+ $GLOBALS['_akv']['theme'] =& $theme;
40
+ return $theme;
41
+ }
42
+
43
+ /**
44
+ * Gets and returns the theme object.
45
+ * @return akThemeAbstract
46
+ */
47
+ function & ak_theme ()
48
+ {
49
+ return ak_get_object('theme');
50
+ }
51
+
52
+ /**
53
+ * Returns a theme option/setting.
54
+ *
55
+ * @param string $option Option name to return.
56
+ * @param mixed $default Default value if option not found.
57
+ * @return mixed The option value.
58
+ */
59
+ function ak_theme_option ( $option = '', $default = false )
60
+ {
61
+ return ak_get_option ( 'theme', $option, $default );
62
+ }
63
+
64
+ /**
65
+ * Returns parent theme data from style.css file.
66
+ *
67
+ * @param string $name Data name to return.
68
+ * @return mixed Data value.
69
+ */
70
+ function ak_theme_data ( $name = '' )
71
+ {
72
+ if ( is_object($GLOBALS['_akv']['theme']) && method_exists($GLOBALS['_akv']['theme'], 'getModData') ) {
73
+ return $GLOBALS['_akv']['theme']->getModData($name);
74
+ } else {
75
+ return false;
76
+ }
77
+ }
78
+
79
+ /**
80
+ * Returns child theme data from style.css file.
81
+ *
82
+ * @param string $name Data name to return.
83
+ * @return mixed Data value.
84
+ */
85
+ function ak_child_theme_data ( $name = '' )
86
+ {
87
+ if ( is_object($GLOBALS['_akv']['theme']) && method_exists($GLOBALS['_akv']['theme'], 'getChildData') ) {
88
+ return $GLOBALS['_akv']['theme']->getChildData($name);
89
+ } else {
90
+ return false;
91
+ }
92
+ }
93
+
94
+ /**
95
+ * Redirects user to a new page.
96
+ * This is done if the custom field 'redirect' is defined as:
97
+ * + Filed Name: redirect
98
+ * + Field Value: New target URL.
99
+ *
100
+ * @return void
101
+ */
102
+ function ak_theme_redirect()
103
+ {
104
+ global $post;
105
+
106
+ if ( is_page() || is_single() ) {
107
+ if ( $meta = get_post_meta($post->ID, 'redirect', true) ) {
108
+ wp_redirect($meta, 301);
109
+ exit;
110
+ }
111
+ }
112
+ }
113
+
114
+ /**
115
+ * Checks if the sidebar is used.
116
+ * Do it by checking if there is any widget on a sidebar number.
117
+ *
118
+ * @param int|string $index Sidebar number or id
119
+ * @return boolean True if this sidebar is used and contains any widget, false if not.
120
+ */
121
+ function ak_theme_is_sidebar( $index )
122
+ {
123
+ $sidebar = wp_get_sidebars_widgets();
124
+ if ( is_numeric($index) ) {
125
+ $index = 'sidebar-' . $index;
126
+ }
127
+
128
+ if (isset($sidebar[$index]) && count($sidebar[$index]) ) {
129
+ return true;
130
+ } else {
131
+ return false;
132
+ }
133
+ }
134
+
135
+ /**
136
+ * Authoring widget for admin pages.
137
+ * You can add a readme.txt file for themes to add aditional links not found on style.css
138
+ * Additional strings searched at readme.txt are: 'Help link:' and 'Docs link'.
139
+ * All others follow plugins readme.txt guidelines.
140
+ *
141
+ * @since 0.5
142
+ *
143
+ * @param string $mod_id Module ID
144
+ * @return void
145
+ */
146
+ function ak_admin_authoring ( $mod_id )
147
+ {
148
+ return; // kevinB temp
149
+
150
+ $mod = ak_get_object($mod_id);
151
+ if ( ! $mod ) {
152
+ return;
153
+ }
154
+ $data = $mod->getModData();
155
+ $class = ( $mod->isComponent() ) ? $mod->PID : $mod_id;
156
+ ?>
157
+
158
+ <dl>
159
+ <dt><?php echo $data['Name']; ?></dt>
160
+ <dd>
161
+ <ul>
162
+ <li><a href="http://agapetry.com" class="capsman" target="_blank"><?php _e('Plugin Homepage', 'akfw'); ?></a></li>
163
+ <li><a href="http://presspermit.com" class="docs" target="_blank"><?php _e('Documentation', 'akfw'); ?></a></li>
164
+ <li><a href="http://agapetry.net/forum" class="help" target="_blank"><?php _e('Support Forum', 'akfw'); ?></a></li>
165
+ <li><a href="http://agapetry.com" class="h-ome" target="_blank"><?php _e('Author Homepage', 'akfw')?></a></li>
166
+ <li><a href="http://agapetry.com" class="donate" target="_blank"><?php _e('Help donating', 'akfw')?></a></li>
167
+
168
+ <!--
169
+ <?php if ( ! empty($data['PluginURI']) ) : ?>
170
+ <li><a href="<?php echo $data['PluginURI']; ?>" class="<?php echo $class; ?>" target="_blank"><?php _e('Plugin Homepage', 'akfw'); ?></a></li>
171
+ <?php endif; ?>
172
+
173
+ <?php if ( ! empty($data['URI']) ) : ?>
174
+ <li><a href="<?php echo $data['URI']; ?>" class="theme" target="_blank"><?php _e('Theme Homepage', 'akfw'); ?></a></li>
175
+ <?php endif; ?>
176
+
177
+ <?php if ( ! empty($data['DocsURI']) ) : ?>
178
+ <li><a href="<?php echo $data['DocsURI']; ?>" class="docs" target="_blank"><?php _e('Documentation', 'akfw'); ?></a></li>
179
+ <?php endif; ?>
180
+
181
+ <?php if ( ! empty($data['HelpURI']) ) : ?>
182
+ <li><a href="<?php echo $data['HelpURI']; ?>" class="help" target="_blank"><?php _e('Support Forum', 'akfw'); ?></a></li>
183
+ <?php endif; ?>
184
+
185
+ <?php if ( ! empty($data['AuthorURI']) ) : ?>
186
+ <li><a href="<?php echo $data['AuthorURI']; ?>" class="home" target="_blank"><?php _e('Author Homepage', 'akfw')?></a></li>
187
+ <?php endif; ?>
188
+
189
+ <?php if ( ! empty($data['DonateURI']) ) : ?>
190
+ <li><a href="<?php echo $data['DonateURI']; ?>" class="donate" target="_blank"><?php _e('Donate to project', 'akfw')?></a></li>
191
+ <?php endif; ?>
192
+ -->
193
+ </ul>
194
+ </dd>
195
+ </dl>
196
+ <?php
197
+ }
198
+
199
+ /**
200
+ * Copyright, authoring and versions for admin pages footer.
201
+ *
202
+ * @since 0.5
203
+ *
204
+ * @param string $mod_id Module ID
205
+ * @param int $year First copyrigh year.
206
+ * @return void
207
+ */
208
+ function ak_admin_footer ( $mod_id, $year = 2009 )
209
+ {
210
+ $mod = ak_get_object($mod_id);
211
+ if ( ! $mod ) {
212
+ return;
213
+ }
214
+ $data = $mod->getModData();
215
+
216
+ if ( $mod->isPlugin() || $mod->isComponent() ) {
217
+ echo '<p class="footer"><a href="' . $mod->getModData('PluginURI') . '">' . $mod->getModData('Name') . ' ' . $mod->getModData('Version') .
218
+ '</a>&nbsp;&nbsp;|&nbsp;&nbsp;&copy; Copyright ';
219
+ if ( 2010 != $year ) {
220
+ echo $year . '-';
221
+ }
222
+ echo '2010 Jordi Canals';
223
+ echo '&nbsp;&nbsp;|&nbsp;&nbsp;';
224
+
225
+ $_year = '2012';
226
+ if ( 2012 != $year ) {
227
+ $_year . '-' . $year ;
228
+ }
229
+
230
+ echo 'Modifications &copy; Copyright ' . $_year . ' <a href="http://agapetry.net">Kevin Behrens</a>'; // todo: translation, date formatting
231
+
232
+ } elseif ( $mod->isTheme() ) {
233
+ echo '<p class="footer"><a href="' . $mod->getModData('URI') . '">' . $mod->getModData('Name') . ' ' . $mod->getModData('Version') .
234
+ '</a> &nbsp; &copy; Copyright ';
235
+ if ( 2010 != $year ) {
236
+ echo $year . '-';
237
+ }
238
+ echo date('Y') . ' ';
239
+ echo $mod->getModData('Author');
240
+ }
241
+
242
+ //echo '&nbsp;&nbsp;|&nbsp;&nbsp;Framework Version: ' . get_option('ak_framework_version');
243
+ if ( $mod->isChildTheme() ) {
244
+ echo ' - Child theme: ' . $mod->getChildData('Name') . ' ' . $mod->getChildData('Version');
245
+ }
246
+ if ( $mod->isComponent() ) {
247
+ echo ' - Component: ' . $mod->getChildData('Name') . ' ' . $mod->getChildData('Version');
248
+ }
249
+
250
+ echo '</p>';
251
+ }
framework/lib/users.php ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Users, Roles and Capabilities related functions.
4
+ *
5
+ * @version $Rev: 203758 $
6
+ * @author Jordi Canals
7
+ * @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
8
+ * @license GNU General Public License version 2
9
+ * @link http://alkivia.org
10
+ * @package Alkivia
11
+ * @subpackage Framework
12
+ *
13
+
14
+ Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
15
+
16
+ This program is free software; you can redistribute it and/or
17
+ modify it under the terms of the GNU General Public License
18
+ version 2 as published by the Free Software Foundation.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+
29
+ /**
30
+ * Gets current user ID.
31
+ *
32
+ * @return int Current user ID or 0 if not logged in.
33
+ */
34
+ function ak_current_user_id ()
35
+ {
36
+ $user = wp_get_current_user();
37
+ return $user->id;
38
+ }
39
+
40
+ /**
41
+ * Returns all valid roles.
42
+ * The returned list can be translated or not.
43
+ *
44
+ * @uses apply_filters() Calls the 'alkivia_roles_translate' hook on translated roles array.
45
+ * @since 0.5
46
+ *
47
+ * @param boolean $translate If the returned roles have to be translated or not.
48
+ * @return array All defined roles. If translated, the key is the role name and value is the translated role.
49
+ */
50
+ function ak_get_roles( $translate = false ) {
51
+ global $wp_roles;
52
+ if ( ! isset( $wp_roles ) ) {
53
+ $wp_roles = new WP_Roles();
54
+ }
55
+
56
+ $roles = $wp_roles->get_names();
57
+ if ( $translate ) {
58
+ foreach ($roles as $k => $r) {
59
+ $roles[$k] = _x($r, 'User role');
60
+ }
61
+ asort($roles);
62
+ return apply_filters('alkivia_roles_translate', $roles);
63
+ } else {
64
+ $roles = array_keys($roles);
65
+ asort($roles);
66
+ return $roles;
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Return the user role. Taken from WordPress roles and Capabilities.
72
+ *
73
+ * @since 0.5
74
+ *
75
+ * @param int|object $user_ID User ID or the user object to find the role.
76
+ * @return string User role in this blog (key, not translated).
77
+ */
78
+ function ak_get_user_role( $user ) {
79
+ global $wpdb, $wp_roles;
80
+ if ( ! isset( $wp_roles ) ) {
81
+ $wp_roles = new WP_Roles();
82
+ }
83
+ $caps_name = $wpdb->prefix . 'capabilities';
84
+
85
+ if ( ! is_object($user) ) {
86
+ $user = get_userdata($user);
87
+ }
88
+ $roles = array_filter( array_keys( (array) $user->$caps_name ), array( &$wp_roles, 'is_role' ) );
89
+
90
+ return array_pop($roles);
91
+ }
92
+
93
+ /**
94
+ * Generates the caps names from user level.
95
+ *
96
+ * @since 0.5
97
+ *
98
+ * @param int $level Level to convert to caps
99
+ * @return array Generated caps
100
+ */
101
+ function ak_level2caps( $level ) {
102
+ $caps = array();
103
+ $level = min(10, intval($level));
104
+
105
+ for ( $i = $level; $i >= 0; $i--) {
106
+ $caps["level_{$i}"] = "Level {$i}";
107
+ }
108
+
109
+ return $caps;
110
+ }
111
+
112
+ /**
113
+ * Finds the proper level from a capabilities list.
114
+ *
115
+ * @since 0.5
116
+ *
117
+ * @uses _ak_level_reduce()
118
+ * @param array $caps List of capabilities.
119
+ * @return int Level found, if no level found, will return 0.
120
+ */
121
+ function ak_caps2level( $caps ) {
122
+ $level = array_reduce( array_keys( $caps ), '_ak_caps2level_CB', 0);
123
+ return $level;
124
+ }
125
+
126
+ /**
127
+ * Callback function to find the level from caps.
128
+ * Taken from WordPress 2.7.1
129
+ *
130
+ * @since 0.5
131
+ * @access private
132
+ *
133
+ * @return int level Level found.
134
+ */
135
+ function _ak_caps2level_CB( $max, $item ) {
136
+ if ( preg_match( '/^level_(10|[0-9])$/i', $item, $matches ) ) {
137
+ $level = intval( $matches[1] );
138
+ return max( $max, $level );
139
+ } else {
140
+ return $max;
141
+ }
142
+ }
framework/license.txt ADDED
@@ -0,0 +1,280 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
framework/loader.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Framework Loader.
4
+ * This file MUST always be included at startup when using the framework.
5
+ *
6
+ * @version $Rev: 203758 $
7
+ * @author Jordi Canals
8
+ * @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
9
+ * @license GNU General Public License version 2
10
+ * @link http://alkivia.org
11
+ * @package Alkivia
12
+ * @subpackage Framework
13
+ *
14
+
15
+ Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
16
+
17
+ This program is free software; you can redistribute it and/or
18
+ modify it under the terms of the GNU General Public License
19
+ version 2 as published by the Free Software Foundation.
20
+
21
+ This program is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
+
26
+ You should have received a copy of the GNU General Public License
27
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
28
+ */
29
+
30
+ // TODO: Bybapass framework loading if already loaded.
31
+ // TODO: Load Framework at plugins_loaded or init to allow filters on plugins?
32
+ // If loaded on plufins_loaded will not load for themes.
33
+
34
+ $akf_version = '0.8';
35
+
36
+ if ( file_exists(WP_CONTENT_DIR . '/alkivia.php') ) {
37
+ /** Loads alkivia.php to override some default constants */
38
+ include_once( WP_CONTENT_DIR . '/alkivia.php');
39
+ }
40
+
41
+ // Check version for installs and updates.
42
+ $akf_current = get_option('ak_framework_version');
43
+ $akf_path = dirname(__FILE__);
44
+
45
+ if ( false === $akf_current ) {
46
+ // Install the framework. Save version and path.
47
+ add_option('ak_framework_version', $akf_version);
48
+ add_option('ak_framework_path', $akf_path);
49
+ } elseif ( version_compare($akf_version, $akf_current, '>') ) {
50
+ // Update framework if newer. Save version and path.
51
+ update_option('ak_framework_version', $akf_version);
52
+ update_option('ak_framework_path', $akf_path);
53
+ } else {
54
+ // Using installed version.
55
+ $akf_db_path = get_option('ak_framework_path');
56
+ if ( false !== $akf_db_path && is_dir($akf_db_path) ) {
57
+ // Only use current if still present. Could be from an uninstalled plugin.
58
+ $akf_path = $akf_db_path;
59
+ } else {
60
+ // If installed version not present, use current.
61
+ update_option('ak_framework_version', $akf_version);
62
+ update_option('ak_framework_path', $akf_path);
63
+ }
64
+ }
65
+
66
+ if ( ! defined('AK_FRAMEWORK') ) {
67
+ // Define the framework path.
68
+ define ('AK_FRAMEWORK', $akf_path );
69
+ }
70
+
71
+ include_once( AK_FRAMEWORK . '/init.php');
framework/samples/alkivia.ini ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ; $Id: alkivia.ini 203758 2010-02-10 19:01:07Z Txanny $
2
+
3
+ ; If you set this file on your wp-content directory, it will override the module
4
+ ; options, force to use this ones and disable them from the admin page.
5
+
6
+ ; All alkivia plugins and themes share the same file. If you already have an
7
+ ; alkivia.ini file in your wp-content directory, you can copy and paste this
8
+ ; settings on it.
9
+
10
+ ; The ini file is mostly used on WordPress MU, when we want to force all blogs to
11
+ ; this settings and don't want to allow the blog administrators to change them.
12
+
13
+ ; This settings are available to any theme or plugin that uses the framework,
14
+ ; just have to write this settings on the plugin or theme section.
15
+ ;
16
+ ; More information at http://wiki.alkivia.org/framework/ini-file
17
+ ;
18
+
19
+ [for_all]
20
+
21
+ ; disable-admin-page = Off
22
+
23
+ [for_plugins]
24
+
25
+ ; disable-module-styles = Off
26
+ ; style-url = "http://example.com/styles/style.css"
27
+ ; disable-components-activation = Off
28
+
29
+ [for_themes]
30
+
31
+ ; disable-favicon = Off
32
+ ; favicon-url = "http://sample.com/images/favicon.ico"
33
+ ; enable-self-ping = Off
framework/samples/alkivia.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Alkivia paths.
4
+ * You can locate this file on your wp-content directopry if you want to
5
+ * override the framework location or if you want to point to custom
6
+ * 'alkivia.ini' location.
7
+ *
8
+ * @version $Rev: 198515 $
9
+ * @author Jordi Canals
10
+ * @copyright Copyright (C) 2008, 2009, 2010 Jordi Canals
11
+ * @license GNU General Public License version 2
12
+ * @link http://alkivia.org
13
+ * @package Alkivia
14
+ * @subpackage Framework
15
+ *
16
+
17
+ Copyright 2008, 2009, 2010 Jordi Canals <devel@jcanals.cat>
18
+
19
+ This program is free software; you can redistribute it and/or
20
+ modify it under the terms of the GNU General Public License
21
+ version 2 as published by the Free Software Foundation.
22
+
23
+ This program is distributed in the hope that it will be useful,
24
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
25
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26
+ GNU General Public License for more details.
27
+
28
+ You should have received a copy of the GNU General Public License
29
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
30
+ */
31
+
32
+ /** Override the absolute path to Alkivia Framework
33
+ * If you move the framework outside the wp_content folder,
34
+ * You will have to define AK_STYLES_URL and set the styles folder
35
+ * in a server public place.
36
+ *
37
+ * @link http://wiki.alkivia.org/framework/config-file
38
+ */
39
+ // define ('AK_FRAMEWORK', '/home/my_user/my_root/wp_content/plugins/my_plugin/framework'
40
+
41
+ /** Overrides the default 'alkivia.ini' location. */
42
+ // define ( 'AK_INI_FILE', dirname(__FILE__) . '/alkivia.ini');
framework/styles/.htaccess ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ # Prevent running or accessing any file directly.
2
+
3
+ Order Deny,Allow
4
+ Allow from all
framework/styles/admin.css ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Alkivia Framework.
3
+ * Styles for admin dashboard.
4
+ * Based on the styles for Maintenance Mode plugin by Michael Wöhrer
5
+ *
6
+ * @version $Rev: 198515 $
7
+ * @author Jordi Canals
8
+ * @copyright Copyright (C) 2009, 2010 Jordi Canals
9
+ * @license GNU General Public License version 2
10
+ * @link http://alkivia.org
11
+ * @package Alkivia
12
+ * @subpackage Framework
13
+ *
14
+
15
+ Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
16
+
17
+ This program is free software; you can redistribute it and/or
18
+ modify it under the terms of the GNU General Public License
19
+ version 2 as published by the Free Software Foundation.
20
+
21
+ This program is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
+
26
+ You should have received a copy of the GNU General Public License
27
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
28
+ */
29
+
30
+ /* =========================================================== SETTINGS */
31
+
32
+ table#akmin {
33
+ width: 100%;
34
+ border: 0 none;
35
+ padding: 0;
36
+ margin:0;
37
+ }
38
+
39
+ table#akmin fieldset {
40
+ border: 0 none;
41
+ padding: 0;
42
+ margin:0;
43
+ }
44
+
45
+ table#akmin td {
46
+ vertical-align: top;
47
+ }
48
+
49
+ table#akmin td dl {
50
+ padding: 0;
51
+ margin: 10px 0 20px 0;
52
+ background-color: white;
53
+ border: 1px solid #dfdfdf;
54
+ }
55
+
56
+ table#akmin td dl {
57
+ -moz-border-radius: 5px;
58
+ -khtml-border-radius: 5px;
59
+ -webkit-border-radius: 5px;
60
+ border-radius: 5px;
61
+ }
62
+
63
+ table#akmin dl dt {
64
+ font-size: 13px;
65
+ font-weight: bold;
66
+ margin: 0;
67
+ padding: 4px 10px 4px 10px;
68
+ background: #dfdfdf url('images/dl-bg-gray.png') repeat-x left top;
69
+ }
70
+
71
+ table#akmin p {
72
+ padding: 5px 0 5px 0;
73
+ margin: 0;
74
+ }
75
+
76
+ table#akmin .footer {
77
+ text-align: center;
78
+ font-size: 10.5px;
79
+ }
80
+
81
+ table#akmin .footer a {
82
+ font-size: 10.5px;
83
+ text-decoration: none;
84
+ }
85
+
86
+ table#akmin .footer a:hover {
87
+ text-decoration: underline;
88
+ }
89
+ table#akmin td small {
90
+ font-size: 10.5px;
91
+ }
92
+
93
+ table#akmin hr {
94
+ border: none 0;
95
+ border-top: 1px solid #bbbbbb;
96
+ height: 1px;
97
+ }
98
+
99
+ table#akmin ul {
100
+ list-style: none;
101
+ }
102
+
103
+ table#akmin ul.ul-disc {
104
+ list-style: disc outside;
105
+ }
106
+
107
+ table#akmin ul.bullet {
108
+ list-style-type: disc;
109
+ padding-left: 20px;
110
+ }
111
+
112
+ /* ====================================================== ADMIN CONTENT */
113
+
114
+ table#akmin td.content {
115
+ padding: 0 8px 0 0;
116
+ }
117
+
118
+ table#akmin td.content dd {
119
+ margin: 0;
120
+ padding: 10px 20px 10px 20px;
121
+ }
122
+
123
+ /* ====================================================== ADMIN SIDEBAR */
124
+
125
+ table#akmin td.sidebar {
126
+ width: 275px;
127
+ padding: 0 0 0 8px;
128
+ }
129
+
130
+ table#akmin td.sidebar ul, table#akmin td.sidebar ul li {
131
+ list-style: none;
132
+ padding: 0;
133
+ margin: 0;
134
+ }
135
+
136
+ table#akmin td.sidebar a {
137
+ text-decoration: none;
138
+ background-position: 0px 60%;
139
+ background-repeat: no-repeat;
140
+ padding: 4px 0px 4px 22px;
141
+ border: 0 none;
142
+ display: block;
143
+ }
144
+
145
+ table#akmin td.sidebar ul li {
146
+ margin: 0;
147
+ border-bottom: 1px dotted gray;
148
+ }
149
+
150
+ table#akmin td.sidebar dd {
151
+ margin: 0;
152
+ padding: 5px 10px 5px 10px;
153
+ }
154
+
155
+ /* ====================================================== SIDEBAR ICONS */
156
+
157
+ td.sidebar a.docs {
158
+ background-image: url('images/docs.png');
159
+ }
160
+
161
+ td.sidebar a.help {
162
+ background-image: url('images/help.png');
163
+ }
164
+
165
+ td.sidebar a.home {
166
+ background-image: url('images/alkivia.png');
167
+ }
168
+
169
+ td.sidebar a.donate {
170
+ background-image: url('images/paypal.png');
171
+ }
172
+
173
+ /* EOF */
framework/styles/images/alkivia.png ADDED
Binary file
framework/styles/images/dl-bg-gray.png ADDED
Binary file
framework/styles/images/docs.png ADDED
Binary file
framework/styles/images/help.png ADDED
Binary file
framework/styles/images/paypal.png ADDED
Binary file
framework/vendor/upload/class.upload.php ADDED
@@ -0,0 +1,4752 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // $Rev: 203758 $
4
+
5
+ // +------------------------------------------------------------------------+
6
+ // | class.upload.php |
7
+ // +------------------------------------------------------------------------+
8
+ // | Copyright (c) Colin Verot 2003-2009. All rights reserved. |
9
+ // | Version 0.29 |
10
+ // | Last modified 03/02/2010 |
11
+ // | Email colin@verot.net |
12
+ // | Web http://www.verot.net |
13
+ // +------------------------------------------------------------------------+
14
+ // | This program is free software; you can redistribute it and/or modify |
15
+ // | it under the terms of the GNU General Public License version 2 as |
16
+ // | published by the Free Software Foundation. |
17
+ // | |
18
+ // | This program is distributed in the hope that it will be useful, |
19
+ // | but WITHOUT ANY WARRANTY; without even the implied warranty of |
20
+ // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
21
+ // | GNU General Public License for more details. |
22
+ // | |
23
+ // | You should have received a copy of the GNU General Public License |
24
+ // | along with this program; if not, write to the |
25
+ // | Free Software Foundation, Inc., 59 Temple Place, Suite 330, |
26
+ // | Boston, MA 02111-1307 USA |
27
+ // | |
28
+ // | Please give credit on sites that use class.upload and submit changes |
29
+ // | of the script so other people can use them as well. |
30
+ // | This script is free to use, don't abuse. |
31
+ // +------------------------------------------------------------------------+
32
+ //
33
+
34
+ /**
35
+ * Class akUpload
36
+ *
37
+ * @version 0.29
38
+ * @author Colin Verot <colin@verot.net>
39
+ * @license GNU Public License version 2
40
+ * @copyright Colin Verot
41
+ * @package Alkivia
42
+ * @subpackage External
43
+ */
44
+
45
+ /**
46
+ * Class akUpload
47
+ *
48
+ * <b>What does it do?</b>
49
+ *
50
+ * It manages file uploads for you. In short, it manages the uploaded file,
51
+ * and allows you to do whatever you want with the file, especially if it
52
+ * is an image, and as many times as you want.
53
+ *
54
+ * It is the ideal class to quickly integrate file upload in your site.
55
+ * If the file is an image, you can convert, resize, crop it in many ways.
56
+ * You can also apply filters, add borders, text, watermarks, etc...
57
+ * That's all you need for a gallery script for instance. Supported formats
58
+ * are PNG, JPG, GIF and BMP.
59
+ *
60
+ * You can also use the class to work on local files, which is especially
61
+ * useful to use the image manipulation features. The class also supports
62
+ * Flash uploaders.
63
+ *
64
+ * The class works with PHP 4 and 5, and its error messages can
65
+ * be localized at will.
66
+ *
67
+ * <b>How does it work?</b>
68
+ *
69
+ * You instanciate the class with the $_FILES['my_field'] array
70
+ * where my_field is the field name from your upload form.
71
+ * The class will check if the original file has been uploaded
72
+ * to its temporary location (alternatively, you can instanciate
73
+ * the class with a local filename).
74
+ *
75
+ * You can then set a number of processing variables to act on the file.
76
+ * For instance, you can rename the file, and if it is an image,
77
+ * convert and resize it in many ways.
78
+ * You can also set what will the class do if the file already exists.
79
+ *
80
+ * Then you call the function {@link process} to actually perform the actions
81
+ * according to the processing parameters you set above.
82
+ * It will create new instances of the original file,
83
+ * so the original file remains the same between each process.
84
+ * The file will be manipulated, and copied to the given location.
85
+ * The processing variables will be reset once it is done.
86
+ *
87
+ * You can repeat setting up a new set of processing variables,
88
+ * and calling {@link process} again as many times as you want.
89
+ * When you have finished, you can call {@link clean} to delete
90
+ * the original uploaded file.
91
+ *
92
+ * If you don't set any processing parameters and call {@link process}
93
+ * just after instanciating the class. The uploaded file will be simply
94
+ * copied to the given location without any alteration or checks.
95
+ *
96
+ * Don't forget to add <i>enctype="multipart/form-data"</i> in your form
97
+ * tag <form> if you want your form to upload the file.
98
+ *
99
+ * <b>How to use it?</b><br>
100
+ * Create a simple HTML file, with a form such as:
101
+ * <pre>
102
+ * <form enctype="multipart/form-data" method="post" action="upload.php">
103
+ * <input type="file" size="32" name="image_field" value="">
104
+ * <input type="submit" name="Submit" value="upload">
105
+ * </form>
106
+ * </pre>
107
+ * Create a file called upload.php:
108
+ * <pre>
109
+ * $handle = new upload($_FILES['image_field']);
110
+ * if ($handle->uploaded) {
111
+ * $handle->file_new_name_body = 'image_resized';
112
+ * $handle->image_resize = true;
113
+ * $handle->image_x = 100;
114
+ * $handle->image_ratio_y = true;
115
+ * $handle->process('/home/user/files/');
116
+ * if ($handle->processed) {
117
+ * echo 'image resized';
118
+ * $handle->clean();
119
+ * } else {
120
+ * echo 'error : ' . $handle->error;
121
+ * }
122
+ * }
123
+ * </pre>
124
+ *
125
+ * <b>How to process local files?</b><br>
126
+ * Use the class as following, the rest being the same as above:
127
+ * <pre>
128
+ * $handle = new upload('/home/user/myfile.jpg');
129
+ * </pre>
130
+ *
131
+ * <b>How to set the language?</b><br>
132
+ * Instantiate the class with a second argument being the language code:
133
+ * <pre>
134
+ * $handle = new upload($_FILES['image_field'], 'fr_FR');
135
+ * $handle = new upload('/home/user/myfile.jpg', 'fr_FR');
136
+ * </pre>
137
+ *
138
+ * <b>How to output the resulting file or picture directly to the browser?</b><br>
139
+ * Simply call {@link process}() without an argument (or with null as first argument):
140
+ * <pre>
141
+ * $handle = new upload($_FILES['image_field']);
142
+ * header('Content-type: ' . $handle->file_src_mime);
143
+ * echo $handle->Process();
144
+ * die();
145
+ * </pre>
146
+ * Or if you want to force the download of the file:
147
+ * <pre>
148
+ * $handle = new upload($_FILES['image_field']);
149
+ * header('Content-type: ' . $handle->file_src_mime);
150
+ * header("Content-Disposition: attachment; filename=".rawurlencode($handle->file_src_name).";");
151
+ * echo $handle->Process();
152
+ * die();
153
+ * </pre>
154
+ *
155
+ * <b>Processing parameters</b> (reset after each process)
156
+ * <ul>
157
+ * <li><b>file_new_name_body</b> replaces the name body (default: '')<br>
158
+ * <pre>$handle->file_new_name_body = 'new name';</pre></li>
159
+ * <li><b>file_name_body_add</b> appends to the name body (default: '')<br>
160
+ * <pre>$handle->file_name_body_add = '_uploaded';</pre></li>
161
+ * <li><b>file_name_body_pre</b> prepends to the name body (default: '')<br>
162
+ * <pre>$handle->file_name_body_pre = 'thumb_';</pre></li>
163
+ * <li><b>file_new_name_ext</b> replaces the file extension (default: '')<br>
164
+ * <pre>$handle->file_new_name_ext = 'txt';</pre></li>
165
+ * <li><b>file_safe_name</b> formats the filename (spaces changed to _) (default: true)<br>
166
+ * <pre>$handle->file_safe_name = true;</pre></li>
167
+ * <li><b>file_overwrite</b> sets behaviour if file already exists (default: false)<br>
168
+ * <pre>$handle->file_overwrite = true;</pre></li>
169
+ * <li><b>file_auto_rename</b> automatically renames file if it already exists (default: true)<br>
170
+ * <pre>$handle->file_auto_rename = true;</pre></li>
171
+ * <li><b>auto_create_dir</b> automatically creates destination directory if missing (default: true)<br>
172
+ * <pre>$handle->auto_create_dir = true;</pre></li>
173
+ * <li><b>dir_auto_chmod</b> automatically attempts to chmod the destination directory if not writeable (default: true)<br>
174
+ * <pre>$handle->dir_auto_chmod = true;</pre></li>
175
+ * <li><b>dir_chmod</b> chmod used when creating directory or if directory not writeable (default: 0777)<br>
176
+ * <pre>$handle->dir_chmod = 0777;</pre></li>
177
+ * <li><b>file_max_size</b> sets maximum upload size (default: upload_max_filesize from php.ini)<br>
178
+ * <pre>$handle->file_max_size = '1024'; // 1KB</pre></li>
179
+ * <li><b>mime_check</b> sets if the class check the MIME against the {@link allowed} list (default: true)<br>
180
+ * <pre>$handle->mime_check = true;</pre></li>
181
+ * <li><b>no_script</b> sets if the class turns scripts into text files (default: true)<br>
182
+ * <pre>$handle->no_script = false;</pre></li>
183
+ * <li><b>allowed</b> array of allowed mime-types. wildcard accepted, as in image/* (default: check {@link Init})<br>
184
+ * <pre>$handle->allowed = array('application/pdf','application/msword', 'image/*');</pre></li>
185
+ * <li><b>forbidden</b> array of forbidden mime-types. wildcard accepted, as in image/* (default: check {@link Init})<br>
186
+ * <pre>$handle->forbidden = array('application/*');</pre></li>
187
+ * </ul>
188
+ * <ul>
189
+ * <li><b>image_convert</b> if set, image will be converted (possible values : ''|'png'|'jpeg'|'gif'|'bmp'; default: '')<br>
190
+ * <pre>$handle->image_convert = 'jpg';</pre></li>
191
+ * <li><b>image_background_color</b> if set, will forcibly fill transparent areas with the color, in hexadecimal (default: null)<br>
192
+ * <pre>$handle->image_background_color = '#FF00FF';</pre></li>
193
+ * <li><b>image_default_color</b> fallback color background color for non alpha-transparent output formats, such as JPEG or BMP, in hexadecimal (default: #FFFFFF)<br>
194
+ * <pre>$handle->image_default_color = '#FF00FF';</pre></li>
195
+ * <li><b>jpeg_quality</b> sets the compression quality for JPEG images (default: 85)<br>
196
+ * <pre>$handle->jpeg_quality = 50;</pre></li>
197
+ * <li><b>jpeg_size</b> if set to a size in bytes, will approximate {@link jpeg_quality} so the output image fits within the size (default: null)<br>
198
+ * <pre>$handle->jpeg_size = 3072;</pre></li>
199
+ * </ul>
200
+ * The following eight settings can be used to invalidate an upload if the file is an image (note that <i>open_basedir</i> restrictions prevent the use of these settings)
201
+ * <ul>
202
+ * <li><b>image_max_width</b> if set to a dimension in pixels, the upload will be invalid if the image width is greater (default: null)<br>
203
+ * <pre>$handle->image_max_width = 200;</pre></li>
204
+ * <li><b>image_max_height</b> if set to a dimension in pixels, the upload will be invalid if the image height is greater (default: null)<br>
205
+ * <pre>$handle->image_max_height = 100;</pre></li>
206
+ * <li><b>image_max_pixels</b> if set to a number of pixels, the upload will be invalid if the image number of pixels is greater (default: null)<br>
207
+ * <pre>$handle->image_max_pixels = 50000;</pre></li>
208
+ * <li><b>image_max_ratio</b> if set to a aspect ratio (width/height), the upload will be invalid if the image apect ratio is greater (default: null)<br>
209
+ * <pre>$handle->image_max_ratio = 1.5;</pre></li>
210
+ * <li><b>image_min_width</b> if set to a dimension in pixels, the upload will be invalid if the image width is lower (default: null)<br>
211
+ * <pre>$handle->image_min_width = 100;</pre></li>
212
+ * <li><b>image_min_height</b> if set to a dimension in pixels, the upload will be invalid if the image height is lower (default: null)<br>
213
+ * <pre>$handle->image_min_height = 500;</pre></li>
214
+ * <li><b>image_min_pixels</b> if set to a number of pixels, the upload will be invalid if the image number of pixels is lower (default: null)<br>
215
+ * <pre>$handle->image_min_pixels = 20000;</pre></li>
216
+ * <li><b>image_min_ratio</b> if set to a aspect ratio (width/height), the upload will be invalid if the image apect ratio is lower (default: null)<br>
217
+ * <pre>$handle->image_min_ratio = 0.5;</pre></li>
218
+ * </ul>
219
+ * <ul>
220
+ * <li><b>image_resize</b> determines is an image will be resized (default: false)<br>
221
+ * <pre>$handle->image_resize = true;</pre></li>
222
+ * </ul>
223
+ * The following variables are used only if {@link image_resize} == true
224
+ * <ul>
225
+ * <li><b>image_x</b> destination image width (default: 150)<br>
226
+ * <pre>$handle->image_x = 100;</pre></li>
227
+ * <li><b>image_y</b> destination image height (default: 150)<br>
228
+ * <pre>$handle->image_y = 200;</pre></li>
229
+ * </ul>
230
+ * Use either one of the following
231
+ * <ul>
232
+ * <li><b>image_ratio</b> if true, resize image conserving the original sizes ratio, using {@link image_x} AND {@link image_y} as max sizes if true (default: false)<br>
233
+ * <pre>$handle->image_ratio = true;</pre></li>
234
+ * <li><b>image_ratio_crop</b> if true, resize image conserving the original sizes ratio, using {@link image_x} AND {@link image_y} as max sizes, and cropping excedent to fill the space. setting can also be a string, with one or more from 'TBLR', indicating which side of the image will be kept while cropping (default: false)<br>
235
+ * <pre>$handle->image_ratio_crop = true;</pre></li>
236
+ * <li><b>image_ratio_fill</b> if true, resize image conserving the original sizes ratio, using {@link image_x} AND {@link image_y} as max sizes, fitting the image in the space and coloring the remaining space. setting can also be a string, with one or more from 'TBLR', indicating which side of the space the image will be in (default: false)<br>
237
+ * <pre>$handle->image_ratio_fill = true;</pre></li>
238
+ * <li><b>image_ratio_no_zoom_in</b> same as {@link image_ratio}, but won't resize if the source image is smaller than {@link image_x} x {@link image_y} (default: false)<br>
239
+ * <pre>$handle->image_ratio_no_zoom_in = true;</pre></li>
240
+ * <li><b>image_ratio_no_zoom_out</b> same as {@link image_ratio}, but won't resize if the source image is bigger than {@link image_x} x {@link image_y} (default: false)<br>
241
+ * <pre>$handle->image_ratio_no_zoom_out = true;</pre></li>
242
+ * <li><b>image_ratio_x</b> if true, resize image, calculating {@link image_x} from {@link image_y} and conserving the original sizes ratio (default: false)<br>
243
+ * <pre>$handle->image_ratio_x = true;</pre></li>
244
+ * <li><b>image_ratio_y</b> if true, resize image, calculating {@link image_y} from {@link image_x} and conserving the original sizes ratio (default: false)<br>
245
+ * <pre>$handle->image_ratio_y = true;</pre></li>
246
+ * <li><b>image_ratio_pixels</b> if set to a long integer, resize image, calculating {@link image_y} and {@link image_x} to match a the number of pixels (default: false)<br>
247
+ * <pre>$handle->image_ratio_pixels = 25000;</pre></li>
248
+ * </ul>
249
+ * The following image manipulations require GD2+
250
+ * <ul>
251
+ * <li><b>image_brightness</b> if set, corrects the brightness. value between -127 and 127 (default: null)<br>
252
+ * <pre>$handle->image_brightness = 40;</pre></li>
253
+ * <li><b>image_contrast</b> if set, corrects the contrast. value between -127 and 127 (default: null)<br>
254
+ * <pre>$handle->image_contrast = 50;</pre></li>
255
+ * <li><b>image_tint_color</b> if set, will tint the image with a color, value as hexadecimal #FFFFFF (default: null)<br>
256
+ * <pre>$handle->image_tint_color = '#FF0000';</pre></li>
257
+ * <li><b>image_overlay_color</b> if set, will add a colored overlay, value as hexadecimal #FFFFFF (default: null)<br>
258
+ * <pre>$handle->image_overlay_color = '#FF0000';</pre></li>
259
+ * <li><b>image_overlay_percent</b> used when {@link image_overlay_color} is set, determines the opacity (default: 50)<br>
260
+ * <pre>$handle->image_overlay_percent = 20;</pre></li>
261
+ * <li><b>image_negative</b> inverts the colors in the image (default: false)<br>
262
+ * <pre>$handle->image_negative = true;</pre></li>
263
+ * <li><b>image_greyscale</b> transforms an image into greyscale (default: false)<br>
264
+ * <pre>$handle->image_greyscale = true;</pre></li>
265
+ * <li><b>image_threshold</b> applies a threshold filter. value between -127 and 127 (default: null)<br>
266
+ * <pre>$handle->image_threshold = 20;</pre></li>
267
+ * </ul>
268
+ * <ul>
269
+ * <li><b>image_text</b> creates a text label on the image, value is a string, with eventual replacement tokens (default: null)<br>
270
+ * <pre>$handle->image_text = 'test';</pre></li>
271
+ * <li><b>image_text_direction</b> text label direction, either 'h' horizontal or 'v' vertical (default: 'h')<br>
272
+ * <pre>$handle->image_text_direction = 'v';</pre></li>
273
+ * <li><b>image_text_color</b> text color for the text label, in hexadecimal (default: #FFFFFF)<br>
274
+ * <pre>$handle->image_text_color = '#FF0000';</pre></li>
275
+ * <li><b>image_text_percent</b> text opacity on the text label, integer between 0 and 100 (default: 100)<br>
276
+ * <pre>$handle->image_text_percent = 50;</pre></li>
277
+ * <li><b>image_text_background</b> text label background color, in hexadecimal (default: null)<br>
278
+ * <pre>$handle->image_text_background = '#FFFFFF';</pre></li>
279
+ * <li><b>image_text_background_percent</b> text label background opacity, integer between 0 and 100 (default: 100)<br>
280
+ * <pre>$handle->image_text_background_percent = 50;</pre></li>
281
+ * <li><b>image_text_font</b> built-in font for the text label, from 1 to 5. 1 is the smallest (default: 5)<br>
282
+ * <pre>$handle->image_text_font = 4;</pre></li>
283
+ * <li><b>image_text_x</b> absolute text label position, in pixels from the left border. can be negative (default: null)<br>
284
+ * <pre>$handle->image_text_x = 5;</pre></li>
285
+ * <li><b>image_text_y</b> absolute text label position, in pixels from the top border. can be negative (default: null)<br>
286
+ * <pre>$handle->image_text_y = 5;</pre></li>
287
+ * <li><b>image_text_position</b> text label position withing the image, a combination of one or two from 'TBLR': top, bottom, left, right (default: null)<br>
288
+ * <pre>$handle->image_text_position = 'LR';</pre></li>
289
+ * <li><b>image_text_padding</b> text label padding, in pixels. can be overridden by {@link image_text_padding_x} and {@link image_text_padding_y} (default: 0)<br>
290
+ * <pre>$handle->image_text_padding = 5;</pre></li>
291
+ * <li><b>image_text_padding_x</b> text label horizontal padding (default: null)<br>
292
+ * <pre>$handle->image_text_padding_x = 2;</pre></li>
293
+ * <li><b>image_text_padding_y</b> text label vertical padding (default: null)<br>
294
+ * <pre>$handle->image_text_padding_y = 10;</pre></li>
295
+ * <li><b>image_text_alignment</b> text alignment when text has multiple lines, either 'L', 'C' or 'R' (default: 'C')<br>
296
+ * <pre>$handle->image_text_alignment = 'R';</pre></li>
297
+ * <li><b>image_text_line_spacing</b> space between lines in pixels, when text has multiple lines (default: 0)<br>
298
+ * <pre>$handle->image_text_line_spacing = 3;</pre></li>
299
+ * </ul>
300
+ * <ul>
301
+ * <li><b>image_flip</b> flips image, wither 'h' horizontal or 'v' vertical (default: null)<br>
302
+ * <pre>$handle->image_flip = 'h';</pre></li>
303
+ * <li><b>image_rotate</b> rotates image. possible values are 90, 180 and 270 (default: null)<br>
304
+ * <pre>$handle->image_rotate = 90;</pre></li>
305
+ * <li><b>image_crop</b> crops image. accepts 4, 2 or 1 values as 'T R B L' or 'TB LR' or 'TBLR'. dimension can be 20, or 20px or 20% (default: null)<br>
306
+ * <pre>$handle->image_crop = array(50,40,30,20); OR '-20 20%'...</pre></li>
307
+ * <li><b>image_precrop</b> crops image, before an eventual resizing. accepts 4, 2 or 1 values as 'T R B L' or 'TB LR' or 'TBLR'. dimension can be 20, or 20px or 20% (default: null)<br>
308
+ * <pre>$handle->image_precrop = array(50,40,30,20); OR '-20 20%'...</pre></li>
309
+ * </ul>
310
+ * <ul>
311
+ * <li><b>image_bevel</b> adds a bevel border to the image. value is thickness in pixels (default: null)<br>
312
+ * <pre>$handle->image_bevel = 20;</pre></li>
313
+ * <li><b>image_bevel_color1</b> top and left bevel color, in hexadecimal (default: #FFFFFF)<br>
314
+ * <pre>$handle->image_bevel_color1 = '#FFFFFF';</pre></li>
315
+ * <li><b>image_bevel_color2</b> bottom and right bevel color, in hexadecimal (default: #000000)<br>
316
+ * <pre>$handle->image_bevel_color2 = '#000000';</pre></li>
317
+ * <li><b>image_border</b> adds a unicolor border to the image. accepts 4, 2 or 1 values as 'T R B L' or 'TB LR' or 'TBLR'. dimension can be 20, or 20px or 20% (default: null)<br>
318
+ * <pre>$handle->image_border = '3px'; OR '-20 20%' OR array(3,2)...</pre></li>
319
+ * <li><b>image_border_color</b> border color, in hexadecimal (default: #FFFFFF)<br>
320
+ * <pre>$handle->image_border_color = '#FFFFFF';</pre></li>
321
+ * <li><b>image_frame</b> type of frame: 1=flat 2=crossed (default: null)<br>
322
+ * <pre>$handle->image_frame = 2;</pre></li>
323
+ * <li><b>image_frame_colors</b> list of hex colors, in an array or a space separated string (default: '#FFFFFF #999999 #666666 #000000')<br>
324
+ * <pre>$handle->image_frame_colors = array('#999999', '#FF0000', '#666666', '#333333', '#000000');</pre></li>
325
+ * </ul>
326
+ * <ul>
327
+ * <li><b>image_watermark</b> adds a watermark on the image, value is a local filename. accepted files are GIF, JPG, BMP, PNG and PNG alpha (default: null)<br>
328
+ * <pre>$handle->image_watermark = 'watermark.png';</pre></li>
329
+ * <li><b>image_watermark_x</b> absolute watermark position, in pixels from the left border. can be negative (default: null)<br>
330
+ * <pre>$handle->image_watermark_x = 5;</pre></li>
331
+ * <li><b>image_watermark_y</b> absolute watermark position, in pixels from the top border. can be negative (default: null)<br>
332
+ * <pre>$handle->image_watermark_y = 5;</pre></li>
333
+ * <li><b>image_watermark_position</b> watermark position withing the image, a combination of one or two from 'TBLR': top, bottom, left, right (default: null)<br>
334
+ * <pre>$handle->image_watermark_position = 'LR';</pre></li>
335
+ * </ul>
336
+ * <ul>
337
+ * <li><b>image_reflection_height</b> if set, a reflection will be added. Format is either in pixels or percentage, such as 40, '40', '40px' or '40%' (default: null)<br>
338
+ * <pre>$handle->image_reflection_height = '25%';</pre></li>
339
+ * <li><b>image_reflection_space</b> space in pixels between the source image and the reflection, can be negative (default: null)<br>
340
+ * <pre>$handle->image_reflection_space = 3;</pre></li>
341
+ * <li><b>image_reflection_color</b> reflection background color, in hexadecimal. Now deprecated in favor of {@link image_default_color} (default: #FFFFFF)<br>
342
+ * <pre>$handle->image_default_color = '#000000';</pre></li>
343
+ * <li><b>image_reflection_opacity</b> opacity level at which the reflection starts, integer between 0 and 100 (default: 60)<br>
344
+ * <pre>$handle->image_reflection_opacity = 60;</pre></li>
345
+ * </ul>
346
+ *
347
+ * <b>Values that can be read before calling {@link process}()</b>
348
+ * <ul>
349
+ * <li><b>file_src_name</b> Source file name</li>
350
+ * <li><b>file_src_name_body</b> Source file name body</li>
351
+ * <li><b>file_src_name_ext</b> Source file extension</li>
352
+ * <li><b>file_src_pathname</b> Source file complete path and name</li>
353
+ * <li><b>file_src_mime</b> Source file mime type</li>
354
+ * <li><b>file_src_size</b> Source file size in bytes</li>
355
+ * <li><b>file_src_error</b> Upload error code</li>
356
+ * <li><b>file_is_image</b> Boolean flag, true if the file is a supported image type</li>
357
+ * </ul>
358
+ * If the file is a supported image type (and <i>open_basedir</i> restrictions allow it)
359
+ * <ul>
360
+ * <li><b>image_src_x</b> Source file width in pixels</li>
361
+ * <li><b>image_src_y</b> Source file height in pixels</li>
362
+ * <li><b>image_src_pixels</b> Source file number of pixels</li>
363
+ * <li><b>image_src_type</b> Source file type (png, jpg, gif or bmp)</li>
364
+ * <li><b>image_src_bits</b> Source file color depth</li>
365
+ * </ul>
366
+ *
367
+ * <b>Values that can be read after calling {@link process}()</b>
368
+ * <ul>
369
+ * <li><b>file_dst_path</b> Destination file path</li>
370
+ * <li><b>file_dst_name_body</b> Destination file name body</li>
371
+ * <li><b>file_dst_name_ext</b> Destination file extension</li>
372
+ * <li><b>file_dst_name</b> Destination file name</li>
373
+ * <li><b>file_dst_pathname</b> Destination file complete path and name</li>
374
+ * </ul>
375
+ * If the file is a supported image type
376
+ * <ul>
377
+ * <li><b>image_dst_x</b> Destination file width</li>
378
+ * <li><b>image_dst_y</b> Destination file height</li>
379
+ * <li><b>image_convert</b> Destination file format</li>
380
+ * </ul>
381
+ *
382
+ * <b>Requirements</b>
383
+ *
384
+ * Most of the image operations require GD. GD2 is greatly recommended
385
+ *
386
+ * The class is compatible with PHP 4.3+, and compatible with PHP5
387
+ *
388
+ * <b>Changelog</b>
389
+ * <ul>
390
+ * <li><b>v 0.29</b> 03/02/2010<br>
391
+ * - added protection against malicious images<br>
392
+ * - added zip and torrent MIME type<br>
393
+ * - replaced split() with explode()<br>
394
+ * - initialise image_dst_x/y with image_src_x/y<br>
395
+ * - removed {@link mime_fileinfo}, {@link mime_file}, {@link mime_magic} and {@link mime_getimagesize} from the docs since they are used before {@link process}<br>
396
+ * - added more extensions and MIME types<br>
397
+ * - improved MIME type validation<br>
398
+ * - improved logging</li>
399
+ * <li><b>v 0.28</b> 10/08/2009<br>
400
+ * - replaced ereg functions to be compatible with PHP 5.3<br>
401
+ * - added flv MIME type<br>
402
+ * - improved MIME type detection<br>
403
+ * - added {@link file_name_body_pre} to prepend a string to the file name<br>
404
+ * - added {@link mime_fileinfo}, {@link mime_file}, {@link mime_magic} and {@link mime_getimagesize} so that it is possible to deactivate some MIME type checking method<br>
405
+ * - use exec() rather than shell_exec(), to play better with safe mode <br>
406
+ * - added some error messages<br>
407
+ * - fix bug when checking on conditions, {@link processed} wasn't propagated properly</li>
408
+ * <li><b>v 0.27</b> 14/05/2009<br>
409
+ * - look for the language files directory from __FILE__<br>
410
+ * - deactivate {@link file_auto_rename} if {@link file_overwrite} is set<br>
411
+ * - improved transparency replacement for true color images<br>
412
+ * - fixed calls to newer version of UNIX file utility<br>
413
+ * - fixed error when using PECL Fileinfo extension in SAFE MODE, and when using the finfo class<br>
414
+ * - added {@link image_precrop} to crop the image before an eventual resizing</li>
415
+ * <li><b>v 0.26</b> 13/11/2008<br>
416
+ * - rewrote conversion from palette to true color to handle transparency better<br>
417
+ * - fixed imagecopymergealpha() when the overlayed image is of wrong dimensions<br>
418
+ * - fixed imagecreatenew() when the image to create have less than 1 pixels width or height<br>
419
+ * - rewrote MIME type detection to be more secure and not rely on browser information; now using Fileinfo PECL extension, UNIX file() command, MIME magic, and getimagesize(), in that order<br>
420
+ * - added support for Flash uploaders<br>
421
+ * - some bug fixing and error handling</li>
422
+ * <li><b>v 0.25</b> 17/11/2007<br>
423
+ * - added translation files and mechanism to instantiate the class with a language different from English<br>
424
+ * - added {@link forbidden} to set an array of forbidden MIME types<br>
425
+ * - implemented support for simple wildcards in {@link allowed} and {@link forbidden}, such as image/*<br>
426
+ * - preset the file extension to the desired conversion format when converting an image<br>
427
+ * - added read and write support for BMP images<br>
428
+ * - added a flag {@link file_is_image} to determine if the file is a supported image type<br>
429
+ * - the class now provides some information about the image, before calling {@link process}(). Available are {@link image_src_x}, {@link image_src_y} and the newly introduced {@link image_src_bits}, {@link image_src_pixels} and {@link image_src_type}. Note that this will not work if <i>open_basedir</i> restrictions are in place<br>
430
+ * - improved logging; now provides useful system information<br>
431
+ * - added some more pre-processing checks for files that are images: {@link image_max_width}, {@link image_max_height}, {@link image_max_pixels}, {@link image_max_ratio}, {@link image_min_width}, {@link image_min_height}, {@link image_min_pixels} and {@link image_min_ratio}<br>
432
+ * - added {@link image_ratio_pixels} to resize an image to a number of pixels, keeping aspect ratio<br>
433
+ * - added {@link image_is_palette} and {@link image_is_transparent} and {@link image_transparent_color} for GIF images<br>
434
+ * - added {@link image_default_color} to define a fallback color for non alpha-transparent output formats, such as JPEG or BMP<br>
435
+ * - changed {@link image_background_color}, which now forces transparent areas to be painted<br>
436
+ * - improved reflections and color overlays so that it works with alpha transparent images<br>
437
+ * - {@link image_reflection_color} is now deprecated in favour of {@link image_default_color}<br />
438
+ * - transparent PNGs are now processed in true color, and fully preserving the alpha channel when doing merges<br>
439
+ * - transparent GIFs are now automatically detected. {@link preserve_transparency} is deprecated<br>
440
+ * - transparent true color images can be saved as GIF while retaining transparency, semi transparent areas being merged with {@link image_default_color}<br>
441
+ * - transparent true color images can be saved as JPG/BMP with the semi transparent areas being merged with {@link image_default_color}<br>
442
+ * - fixed conversion of images to true color<br>
443
+ * - the class can now output the uploaded files content as the return value of process() if the function is called with an empty or null argumenti, or no argument</li>
444
+ * <li><b>v 0.24</b> 25/05/2007<br>
445
+ * - added {@link image_background_color}, to set the default background color of an image<br>
446
+ * - added possibility of using replacement tokens in text labels<br>
447
+ * - changed default JPEG quality to 85<br>
448
+ * - fixed a small bug when using greyscale filter and associated filters<br>
449
+ * - added {@link image_ratio_fill} in order to fit an image within some dimensions and color the remaining space. Very similar to {@link image_ratio_crop}<br>
450
+ * - improved the recursive creation of directories<br>
451
+ * - the class now converts palette based images to true colors before doing graphic manipulations</li>
452
+ * <li><b>v 0.23</b> 23/12/2006<br>
453
+ * - fixed a bug when processing more than once the same uploaded file. If there is an open_basedir restriction, the class now creates a temporary file for the first call to process(). This file will be used for subsequent processes, and will be deleted upon calling clean()</li>
454
+ * <li><b>v 0.22</b> 16/12/2006<br>
455
+ * - added automatic creation of a temporary file if the upload directory is not within open_basedir<br>
456
+ * - fixed a bug which was preventing to work on a local file by overwriting it with its processed copy<br>
457
+ * - added MIME types video/x-ms-wmv and image/x-png and fixed PNG support for IE weird MIME types<br>
458
+ * - modified {@link image_ratio_crop} so it can accept one or more from string 'TBLR', determining which side of the image is kept while cropping<br>
459
+ * - added support for multiple lines in the text, using "\n" as a line break<br>
460
+ * - added {@link image_text_line_spacing} which allow to set the space between several lines of text<br>
461
+ * - added {@link image_text_alignment} which allow to set the alignment when text has several lines<br>
462
+ * - {@link image_text_font} can now be set to the path of a GDF font to load external fonts<br>
463
+ * - added {@link image_reflection_height} to create a reflection of the source image, which height is in pixels or percentage<br>
464
+ * - added {@link image_reflection_space} to set the space in pixels between the source image and the reflection<br>
465
+ * - added {@link image_reflection_color} to set the reflection background color<br>
466
+ * - added {@link image_reflection_opacity} to set the initial level of opacity of the reflection</li>
467
+ * <li><b>v 0.21</b> 30/09/2006<br>
468
+ * - added {@link image_ratio_crop} which resizes within {@link image_x} and {@link image_y}, keeping ratio, but filling the space by cropping excedent of image<br>
469
+ * - added {@link mime_check}, which default is true, to set checks against {@link allowed} MIME list<br>
470
+ * - if MIME is empty, the class now triggers an error<br>
471
+ * - color #000000 is OK for {@link image_text_color}, and related text transparency bug fixed<br>
472
+ * - {@link gd_version}() now uses gd_info(), or else phpinfo()<br>
473
+ * - fixed path issue when the destination path has no trailing slash on Windows systems <br>
474
+ * - removed inline functions to be fully PHP5 compatible </li>
475
+ * <li><b>v 0.20</b> 11/08/2006<br>
476
+ * - added some more error checking and messages (GD presence, permissions...)<br>
477
+ * - fix when uploading files without extension<br>
478
+ * - changed values for {@link image_brightness} and {@link image_contrast} to be between -127 and 127<br>
479
+ * - added {@link dir_auto_create} to automatically and recursively create destination directory if missing.<br>
480
+ * - added {@link dir_auto_chmod} to automatically chmod the destination directory if not writeable.<br>
481
+ * - added {@link dir_chmod} to set the default chmod to use.<br>
482
+ * - added {@link image_crop} to crop images<br>
483
+ * - added {@link image_negative} to invert the colors on the image<br>
484
+ * - added {@link image_greyscale} to turn the image into greyscale<br>
485
+ * - added {@link image_threshold} to apply a threshold filter on the image<br>
486
+ * - added {@link image_bevel}, {@link image_bevel_color1} and {@link image_bevel_color2} to add a bevel border<br>
487
+ * - added {@link image_border} and {@link image_border_color} to add a single color border<br>
488
+ * - added {@link image_frame} and {@link image_frame_colors} to add a multicolored frame</li>
489
+ * <li><b>v 0.19</b> 29/03/2006<br>
490
+ * - class is now compatible i18n (thanks Sylwester).<br>
491
+ * - the class can mow manipulate local files, not only uploaded files (instanciate the class with a local filename).<br>
492
+ * - {@link file_safe_name} has been improved a bit.<br>
493
+ * - added {@link image_brightness}, {@link image_contrast}, {@link image_tint_color}, {@link image_overlay_color} and {@link image_overlay_percent} to do color manipulation on the images.<br>
494
+ * - added {@link image_text} and all derivated settings to add a text label on the image.<br>
495
+ * - added {@link image_watermark} and all derivated settings to add a watermark image on the image.<br>
496
+ * - added {@link image_flip} and {@link image_rotate} for more image manipulations<br>
497
+ * - added {@link jpeg_size} to calculate the JPG compression quality in order to fit within one filesize.</li>
498
+ * <li><b>v 0.18</b> 02/02/2006<br>
499
+ * - added {@link no_script} to turn dangerous scripts into text files.<br>
500
+ * - added {@link mime_magic_check} to set the class to use mime_magic.<br>
501
+ * - added {@link preserve_transparency} *experimental*. Thanks Gregor.<br>
502
+ * - fixed size and mime checking, wasn't working :/ Thanks Willem.<br>
503
+ * - fixed memory leak when resizing images.<br>
504
+ * - when resizing, it is not necessary anymore to set {@link image_convert}.<br>
505
+ * - il is now possible to simply convert an image, with no resizing.<br>
506
+ * - sets the default {@link file_max_size} to upload_max_filesize from php.ini. Thanks Edward</li>
507
+ * <li><b>v 0.17</b> 28/05/2005<br>
508
+ * - the class can be used with any version of GD.<br>
509
+ * - added security check on the file with a list of mime-types.<br>
510
+ * - changed the license to GPL v2 only</li>
511
+ * <li><b>v 0.16</b> 19/05/2005<br>
512
+ * - added {@link file_auto_rename} automatic file renaming if the same filename already exists.<br>
513
+ * - added {@link file_safe_name} safe formatting of the filename (spaces to _underscores so far).<br>
514
+ * - added some more error reporting to avoid crash if GD is not present</li>
515
+ * <li><b>v 0.15</b> 16/04/2005<br>
516
+ * - added JPEG compression quality setting. Thanks Vad</li>
517
+ * <li><b>v 0.14</b> 14/03/2005<br>
518
+ * - reworked the class file to allow parsing with phpDocumentor</li>
519
+ * <li><b>v 0.13</b> 07/03/2005<br>
520
+ * - fixed a bug with {@link image_ratio}. Thanks Justin.<br>
521
+ * - added {@link image_ratio_no_zoom_in} and {@link image_ratio_no_zoom_out} </li>
522
+ * <li><b>v 0.12</b> 21/01/2005<br>
523
+ * - added {@link image_ratio} to resize within max values, keeping image ratio</li>
524
+ * <li><b>v 0.11</b> 22/08/2003<br>
525
+ * - update for GD2 (changed imageresized() into imagecopyresampled() and imagecreate() into imagecreatetruecolor())</li>
526
+ * </ul>
527
+ *
528
+ * @package Alkivia
529
+ * @subpackage External
530
+ */
531
+ class akUpload {
532
+
533
+
534
+ /**
535
+ * Class version
536
+ *
537
+ * @access public
538
+ * @var string
539
+ */
540
+ var $version;
541
+
542
+ /**
543
+ * Uploaded file name
544
+ *
545
+ * @access public
546
+ * @var string
547
+ */
548
+ var $file_src_name;
549
+
550
+ /**
551
+ * Uploaded file name body (i.e. without extension)
552
+ *
553
+ * @access public
554
+ * @var string
555
+ */
556
+ var $file_src_name_body;
557
+
558
+ /**
559
+ * Uploaded file name extension
560
+ *
561
+ * @access public
562
+ * @var string
563
+ */
564
+ var $file_src_name_ext;
565
+
566
+ /**
567
+ * Uploaded file MIME type
568
+ *
569
+ * @access public
570
+ * @var string
571
+ */
572
+ var $file_src_mime;
573
+
574
+ /**
575
+ * Uploaded file size, in bytes
576
+ *
577
+ * @access public
578
+ * @var double
579
+ */
580
+ var $file_src_size;
581
+
582
+ /**
583
+ * Holds eventual PHP error code from $_FILES
584
+ *
585
+ * @access public
586
+ * @var string
587
+ */
588
+ var $file_src_error;
589
+
590
+ /**
591
+ * Uloaded file name, including server path
592
+ *
593
+ * @access private
594
+ * @var string
595
+ */
596
+ var $file_src_pathname;
597
+
598
+ /**
599
+ * Uloaded file name temporary copy
600
+ *
601
+ * @access private
602
+ * @var string
603
+ */
604
+ var $file_src_temp;
605
+
606
+ /**
607
+ * Destination file name
608
+ *
609
+ * @access private
610
+ * @var string
611
+ */
612
+ var $file_dst_path;
613
+
614
+ /**
615
+ * Destination file name
616
+ *
617
+ * @access public
618
+ * @var string
619
+ */
620
+ var $file_dst_name;
621
+
622
+ /**
623
+ * Destination file name body (i.e. without extension)
624
+ *
625
+ * @access public
626
+ * @var string
627
+ */
628
+ var $file_dst_name_body;
629
+
630
+ /**
631
+ * Destination file extension
632
+ *
633
+ * @access public
634
+ * @var string
635
+ */
636
+ var $file_dst_name_ext;
637
+
638
+ /**
639
+ * Destination file name, including path
640
+ *
641
+ * @access private
642
+ * @var string
643
+ */
644
+ var $file_dst_pathname;
645
+
646
+ /**
647
+ * Source image width
648
+ *
649
+ * @access private
650
+ * @var integer
651
+ */
652
+ var $image_src_x;
653
+
654
+ /**
655
+ * Source image height
656
+ *
657
+ * @access private
658
+ * @var integer
659
+ */
660
+ var $image_src_y;
661
+
662
+ /**
663
+ * Source image color depth
664
+ *
665
+ * @access private
666
+ * @var integer
667
+ */
668
+ var $image_src_bits;
669
+
670
+ /**
671
+ * Number of pixels
672
+ *
673
+ * @access private
674
+ * @var long
675
+ */
676
+ var $image_src_pixels;
677
+
678
+ /**
679
+ * Type of image (png, gif, jpg or bmp)
680
+ *
681
+ * @access private
682
+ * @var string
683
+ */
684
+ var $image_src_type;
685
+
686
+ /**
687
+ * Destination image width
688
+ *
689
+ * @access private
690
+ * @var integer
691
+ */
692
+ var $image_dst_x;
693
+
694
+ /**
695
+ * Destination image height
696
+ *
697
+ * @access private
698
+ * @var integer
699
+ */
700
+ var $image_dst_y;
701
+
702
+ /**
703
+ * Supported image formats
704
+ *
705
+ * @access private
706
+ * @var array
707
+ */
708
+ var $image_supported;
709
+
710
+ /**
711
+ * Flag to determine if the source file is an image
712
+ *
713
+ * @access private
714
+ * @var boolean
715
+ */
716
+ var $file_is_image;
717
+
718
+ /**
719
+ * Flag set after instanciating the class
720
+ *
721
+ * Indicates if the file has been uploaded properly
722
+ *
723
+ * @access public
724
+ * @var bool
725
+ */
726
+ var $uploaded;
727
+
728
+ /**
729
+ * Flag stopping PHP upload checks
730
+ *
731
+ * Indicates whether we instanciated the class with a filename, in which case
732
+ * we will not check on the validity of the PHP *upload*
733
+ *
734
+ * This flag is automatically set to true when working on a local file
735
+ *
736
+ * Warning: for uploads, this flag MUST be set to false for security reason
737
+ *
738
+ * @access public
739
+ * @var bool
740
+ */
741
+ var $no_upload_check;
742
+
743
+ /**
744
+ * Flag set after calling a process
745
+ *
746
+ * Indicates if the processing, and copy of the resulting file went OK
747
+ *
748
+ * @access public
749
+ * @var bool
750
+ */
751
+ var $processed;
752
+
753
+ /**
754
+ * Holds eventual error message in plain english
755
+ *
756
+ * @access public
757
+ * @var string
758
+ */
759
+ var $error;
760
+
761
+ /**
762
+ * Holds an HTML formatted log
763
+ *
764
+ * @access public
765
+ * @var string
766
+ */
767
+ var $log;
768
+
769
+
770
+ // overiddable processing variables
771
+
772
+
773
+ /**
774
+ * Set this variable to replace the name body (i.e. without extension)
775
+ *
776
+ * @access public
777
+ * @var string
778
+ */
779
+ var $file_new_name_body;
780
+
781
+ /**
782
+ * Set this variable to append a string to the file name body
783
+ *
784
+ * @access public
785
+ * @var string
786
+ */
787
+ var $file_name_body_add;
788
+
789
+ /**
790
+ * Set this variable to prepend a string to the file name body
791
+ *
792
+ * @access public
793
+ * @var string
794
+ */
795
+ var $file_name_body_pre;
796
+
797
+ /**
798
+ * Set this variable to change the file extension
799
+ *
800
+ * @access public
801
+ * @var string
802
+ */
803
+ var $file_new_name_ext;
804
+
805
+ /**
806
+ * Set this variable to format the filename (spaces changed to _)
807
+ *
808
+ * @access public
809
+ * @var boolean
810
+ */
811
+ var $file_safe_name;
812
+
813
+ /**
814
+ * Set this variable to false if you don't want to check the MIME against the allowed list
815
+ *
816
+ * This variable is set to true by default for security reason
817
+ *
818
+ * @access public
819
+ * @var boolean
820
+ */
821
+ var $mime_check;
822
+
823
+ /**
824
+ * Set this variable to false if you don't want to check the MIME with Fileinfo PECL extension
825
+ *
826
+ * You can also set it with the path of the magic database file.
827
+ * If set to true, the class will try to read the MAGIC environment variable
828
+ * and if it is empty, will default to '/usr/share/file/magic'
829
+ * If set to an empty string, it will call finfo_open without the path argument
830
+ *
831
+ * This variable is set to true by default for security reason
832
+ *
833
+ * @access public
834
+ * @var boolean
835
+ */
836
+ var $mime_fileinfo;
837
+
838
+ /**
839
+ * Set this variable to false if you don't want to check the MIME with UNIX file() command
840
+ *
841
+ * This variable is set to true by default for security reason
842
+ *
843
+ * @access public
844
+ * @var boolean
845
+ */
846
+ var $mime_file;
847
+
848
+ /**
849
+ * Set this variable to false if you don't want to check the MIME with the magic.mime file
850
+ *
851
+ * The function mime_content_type() will be deprecated,
852
+ * and this variable will be set to false in a future release
853
+ *
854
+ * This variable is set to true by default for security reason
855
+ *
856
+ * @access public
857
+ * @var boolean
858
+ */
859
+ var $mime_magic;
860
+
861
+ /**
862
+ * Set this variable to false if you don't want to check the MIME with getimagesize()
863
+ *
864
+ * The class tries to get a MIME type from getimagesize()
865
+ * If no MIME is returned, it tries to guess the MIME type from the file type
866
+ *
867
+ * This variable is set to true by default for security reason
868
+ *
869
+ * @access public
870
+ * @var boolean
871
+ */
872
+ var $mime_getimagesize;
873
+
874
+ /**
875
+ * Set this variable to false if you don't want to turn dangerous scripts into simple text files
876
+ *
877
+ * @access public
878
+ * @var boolean
879
+ */
880
+ var $no_script;
881
+
882
+ /**
883
+ * Set this variable to true to allow automatic renaming of the file
884
+ * if the file already exists
885
+ *
886
+ * Default value is true
887
+ *
888
+ * For instance, on uploading foo.ext,<br>
889
+ * if foo.ext already exists, upload will be renamed foo_1.ext<br>
890
+ * and if foo_1.ext already exists, upload will be renamed foo_2.ext<br>
891
+ *
892
+ * Note that this option doesn't have any effect if {@link file_overwrite} is true
893
+ *
894
+ * @access public
895
+ * @var bool
896
+ */
897
+ var $file_auto_rename;
898
+
899
+ /**
900
+ * Set this variable to true to allow automatic creation of the destination
901
+ * directory if it is missing (works recursively)
902
+ *
903
+ * Default value is true
904
+ *
905
+ * @access public
906
+ * @var bool
907
+ */
908
+ var $dir_auto_create;
909
+
910
+ /**
911
+ * Set this variable to true to allow automatic chmod of the destination
912
+ * directory if it is not writeable
913
+ *
914
+ * Default value is true
915
+ *
916
+ * @access public
917
+ * @var bool
918
+ */
919
+ var $dir_auto_chmod;
920
+
921
+ /**
922
+ * Set this variable to the default chmod you want the class to use
923
+ * when creating directories, or attempting to write in a directory
924
+ *
925
+ * Default value is 0777 (without quotes)
926
+ *
927
+ * @access public
928
+ * @var bool
929
+ */
930
+ var $dir_chmod;
931
+
932
+ /**
933
+ * Set this variable tu true to allow overwriting of an existing file
934
+ *
935
+ * Default value is false, so no files will be overwritten
936
+ *
937
+ * @access public
938
+ * @var bool
939
+ */
940
+ var $file_overwrite;
941
+
942
+ /**
943
+ * Set this variable to change the maximum size in bytes for an uploaded file
944
+ *
945
+ * Default value is the value <i>upload_max_filesize</i> from php.ini
946
+ *
947
+ * @access public
948
+ * @var double
949
+ */
950
+ var $file_max_size;
951
+
952
+ /**
953
+ * Set this variable to true to resize the file if it is an image
954
+ *
955
+ * You will probably want to set {@link image_x} and {@link image_y}, and maybe one of the ratio variables
956
+ *
957
+ * Default value is false (no resizing)
958
+ *
959
+ * @access public
960
+ * @var bool
961
+ */
962
+ var $image_resize;
963
+
964
+ /**
965
+ * Set this variable to convert the file if it is an image
966
+ *
967
+ * Possibles values are : ''; 'png'; 'jpeg'; 'gif'; 'bmp'
968
+ *
969
+ * Default value is '' (no conversion)<br>
970
+ * If {@link resize} is true, {@link convert} will be set to the source file extension
971
+ *
972
+ * @access public
973
+ * @var string
974
+ */
975
+ var $image_convert;
976
+
977
+ /**
978
+ * Set this variable to the wanted (or maximum/minimum) width for the processed image, in pixels
979
+ *
980
+ * Default value is 150
981
+ *
982
+ * @access public
983
+ * @var integer
984
+ */
985
+ var $image_x;
986
+
987
+ /**
988
+ * Set this variable to the wanted (or maximum/minimum) height for the processed image, in pixels
989
+ *
990
+ * Default value is 150
991
+ *
992
+ * @access public
993
+ * @var integer
994
+ */
995
+ var $image_y;
996
+
997
+ /**
998
+ * Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y}
999
+ *
1000
+ * Default value is false
1001
+ *
1002
+ * @access public
1003
+ * @var bool
1004
+ */
1005
+ var $image_ratio;
1006
+
1007
+ /**
1008
+ * Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y}
1009
+ *
1010
+ * The image will be resized as to fill the whole space, and excedent will be cropped
1011
+ *
1012
+ * Value can also be a string, one or more character from 'TBLR' (top, bottom, left and right)
1013
+ * If set as a string, it determines which side of the image is kept while cropping.
1014
+ * By default, the part of the image kept is in the center, i.e. it crops equally on both sides
1015
+ *
1016
+ * Default value is false
1017
+ *
1018
+ * @access public
1019
+ * @var mixed
1020
+ */
1021
+ var $image_ratio_crop;
1022
+
1023
+ /**
1024
+ * Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y}
1025
+ *
1026
+ * The image will be resized to fit entirely in the space, and the rest will be colored.
1027
+ * The default color is white, but can be set with {@link image_default_color}
1028
+ *
1029
+ * Value can also be a string, one or more character from 'TBLR' (top, bottom, left and right)
1030
+ * If set as a string, it determines in which side of the space the image is displayed.
1031
+ * By default, the image is displayed in the center, i.e. it fills the remaining space equally on both sides
1032
+ *
1033
+ * Default value is false
1034
+ *
1035
+ * @access public
1036
+ * @var mixed
1037
+ */
1038
+ var $image_ratio_fill;
1039
+
1040
+ /**
1041
+ * Set this variable to a number of pixels so that {@link image_x} and {@link image_y} are the best match possible
1042
+ *
1043
+ * The image will be resized to have approximatively the number of pixels
1044
+ * The aspect ratio wil be conserved
1045
+ *
1046
+ * Default value is false
1047
+ *
1048
+ * @access public
1049
+ * @var mixed
1050
+ */
1051
+ var $image_ratio_pixels;
1052
+
1053
+ /**
1054
+ * Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y},
1055
+ * but only if original image is bigger
1056
+ *
1057
+ * Default value is false
1058
+ *
1059
+ * @access public
1060
+ * @var bool
1061
+ */
1062
+ var $image_ratio_no_zoom_in;
1063
+
1064
+ /**
1065
+ * Set this variable to keep the original size ratio to fit within {@link image_x} x {@link image_y},
1066
+ * but only if original image is smaller
1067
+ *
1068
+ * Default value is false
1069
+ *
1070
+ * @access public
1071
+ * @var bool
1072
+ */
1073
+ var $image_ratio_no_zoom_out;
1074
+
1075
+ /**
1076
+ * Set this variable to calculate {@link image_x} automatically , using {@link image_y} and conserving ratio
1077
+ *
1078
+ * Default value is false
1079
+ *
1080
+ * @access public
1081
+ * @var bool
1082
+ */
1083
+ var $image_ratio_x;
1084
+
1085
+ /**
1086
+ * Set this variable to calculate {@link image_y} automatically , using {@link image_x} and conserving ratio
1087
+ *
1088
+ * Default value is false
1089
+ *
1090
+ * @access public
1091
+ * @var bool
1092
+ */
1093
+ var $image_ratio_y;
1094
+
1095
+ /**
1096
+ * Set this variable to set a maximum image width, above which the upload will be invalid
1097
+ *
1098
+ * Default value is null
1099
+ *
1100
+ * @access public
1101
+ * @var integer
1102
+ */
1103
+ var $image_max_width;
1104
+
1105
+ /**
1106
+ * Set this variable to set a maximum image height, above which the upload will be invalid
1107
+ *
1108
+ * Default value is null
1109
+ *
1110
+ * @access public
1111
+ * @var integer
1112
+ */
1113
+ var $image_max_height;
1114
+
1115
+ /**
1116
+ * Set this variable to set a maximum number of pixels for an image, above which the upload will be invalid
1117
+ *
1118
+ * Default value is null
1119
+ *
1120
+ * @access public
1121
+ * @var long
1122
+ */
1123
+ var $image_max_pixels;
1124
+
1125
+ /**
1126
+ * Set this variable to set a maximum image aspect ratio, above which the upload will be invalid
1127
+ *
1128
+ * Note that ratio = width / height
1129
+ *
1130
+ * Default value is null
1131
+ *
1132
+ * @access public
1133
+ * @var float
1134
+ */
1135
+ var $image_max_ratio;
1136
+
1137
+ /**
1138
+ * Set this variable to set a minimum image width, below which the upload will be invalid
1139
+ *
1140
+ * Default value is null
1141
+ *
1142
+ * @access public
1143
+ * @var integer
1144
+ */
1145
+ var $image_min_width;
1146
+
1147
+ /**
1148
+ * Set this variable to set a minimum image height, below which the upload will be invalid
1149
+ *
1150
+ * Default value is null
1151
+ *
1152
+ * @access public
1153
+ * @var integer
1154
+ */
1155
+ var $image_min_height;
1156
+
1157
+ /**
1158
+ * Set this variable to set a minimum number of pixels for an image, below which the upload will be invalid
1159
+ *
1160
+ * Default value is null
1161
+ *
1162
+ * @access public
1163
+ * @var long
1164
+ */
1165
+ var $image_min_pixels;
1166
+
1167
+ /**
1168
+ * Set this variable to set a minimum image aspect ratio, below which the upload will be invalid
1169
+ *
1170
+ * Note that ratio = width / height
1171
+ *
1172
+ * Default value is null
1173
+ *
1174
+ * @access public
1175
+ * @var float
1176
+ */
1177
+ var $image_min_ratio;
1178
+
1179
+ /**
1180
+ * Quality of JPEG created/converted destination image
1181
+ *
1182
+ * Default value is 85
1183
+ *
1184
+ * @access public
1185
+ * @var integer
1186
+ */
1187
+ var $jpeg_quality;
1188
+
1189
+ /**
1190
+ * Determines the quality of the JPG image to fit a desired file size
1191
+ *
1192
+ * Value is in bytes. The JPG quality will be set between 1 and 100%
1193
+ * The calculations are approximations.
1194
+ *
1195
+ * Default value is null (no calculations)
1196
+ *
1197
+ * @access public
1198
+ * @var integer
1199
+ */
1200
+ var $jpeg_size;
1201
+
1202
+ /**
1203
+ * Preserve transparency when resizing or converting an image (deprecated)
1204
+ *
1205
+ * Default value is automatically set to true for transparent GIFs
1206
+ * This setting is now deprecated
1207
+ *
1208
+ * @access public
1209
+ * @var integer
1210
+ */
1211
+ var $preserve_transparency;
1212
+
1213
+ /**
1214
+ * Flag set to true when the image is transparent
1215
+ *
1216
+ * This is actually used only for transparent GIFs
1217
+ *
1218
+ * @access public
1219
+ * @var boolean
1220
+ */
1221
+ var $image_is_transparent;
1222
+
1223
+ /**
1224
+ * Transparent color in a palette
1225
+ *
1226
+ * This is actually used only for transparent GIFs
1227
+ *
1228
+ * @access public
1229
+ * @var boolean
1230
+ */
1231
+ var $image_transparent_color;
1232
+
1233
+ /**
1234
+ * Background color, used to paint transparent areas with
1235
+ *
1236
+ * If set, it will forcibly remove transparency by painting transparent areas with the color
1237
+ * This setting will fill in all transparent areas in PNG and GIF, as opposed to {@link image_default_color}
1238
+ * which will do so only in BMP, JPEG, and alpha transparent areas in transparent GIFs
1239
+ * This setting overrides {@link image_default_color}
1240
+ *
1241
+ * Default value is null
1242
+ *
1243
+ * @access public
1244
+ * @var string
1245
+ */
1246
+ var $image_background_color;
1247
+
1248
+ /**
1249
+ * Default color for non alpha-transparent images
1250
+ *
1251
+ * This setting is to be used to define a background color for semi transparent areas
1252
+ * of an alpha transparent when the output format doesn't support alpha transparency
1253
+ * This is useful when, from an alpha transparent PNG image, or an image with alpha transparent features
1254
+ * if you want to output it as a transparent GIFs for instance, you can set a blending color for transparent areas
1255
+ * If you output in JPEG or BMP, this color will be used to fill in the previously transparent areas
1256
+ *
1257
+ * The default color white
1258
+ *
1259
+ * @access public
1260
+ * @var boolean
1261
+ */
1262
+ var $image_default_color;
1263
+
1264
+ /**
1265
+ * Flag set to true when the image is not true color
1266
+ *
1267
+ * @access public
1268
+ * @var boolean
1269
+ */
1270
+ var $image_is_palette;
1271
+
1272
+ /**
1273
+ * Corrects the image brightness
1274
+ *
1275
+ * Value can range between -127 and 127
1276
+ *
1277
+ * Default value is null
1278
+ *
1279
+ * @access public
1280
+ * @var integer
1281
+ */
1282
+ var $image_brightness;
1283
+
1284
+ /**
1285
+ * Corrects the image contrast
1286
+ *
1287
+ * Value can range between -127 and 127
1288
+ *
1289
+ * Default value is null
1290
+ *
1291
+ * @access public
1292
+ * @var integer
1293
+ */
1294
+ var $image_contrast;
1295
+
1296
+ /**
1297
+ * Applies threshold filter
1298
+ *
1299
+ * Value can range between -127 and 127
1300
+ *
1301
+ * Default value is null
1302
+ *
1303
+ * @access public
1304
+ * @var integer
1305
+ */
1306
+ var $image_threshold;
1307
+
1308
+ /**
1309
+ * Applies a tint on the image
1310
+ *
1311
+ * Value is an hexadecimal color, such as #FFFFFF
1312
+ *
1313
+ * Default value is null
1314
+ *
1315
+ * @access public
1316
+ * @var string;
1317
+ */
1318
+ var $image_tint_color;
1319
+
1320
+ /**
1321
+ * Applies a colored overlay on the image
1322
+ *
1323
+ * Value is an hexadecimal color, such as #FFFFFF
1324
+ *
1325
+ * To use with {@link image_overlay_percent}
1326
+ *
1327
+ * Default value is null
1328
+ *
1329
+ * @access public
1330
+ * @var string;
1331
+ */
1332
+ var $image_overlay_color;
1333
+
1334
+ /**
1335
+ * Sets the percentage for the colored overlay
1336
+ *
1337
+ * Value is a percentage, as an integer between 0 and 100
1338
+ *
1339
+ * Unless used with {@link image_overlay_color}, this setting has no effect
1340
+ *
1341
+ * Default value is 50
1342
+ *
1343
+ * @access public
1344
+ * @var integer
1345
+ */
1346
+ var $image_overlay_percent;
1347
+
1348
+ /**
1349
+ * Inverts the color of an image
1350
+ *
1351
+ * Default value is FALSE
1352
+ *
1353
+ * @access public
1354
+ * @var boolean;
1355
+ */
1356
+ var $image_negative;
1357
+
1358
+ /**
1359
+ * Turns the image into greyscale
1360
+ *
1361
+ * Default value is FALSE
1362
+ *
1363
+ * @access public
1364
+ * @var boolean;
1365
+ */
1366
+ var $image_greyscale;
1367
+
1368
+ /**
1369
+ * Adds a text label on the image
1370
+ *
1371
+ * Value is a string, any text. Text will not word-wrap, although you can use breaklines in your text "\n"
1372
+ *
1373
+ * If set, this setting allow the use of all other settings starting with image_text_
1374
+ *
1375
+ * Replacement tokens can be used in the string:
1376
+ * <pre>
1377
+ * gd_version src_name src_name_body src_name_ext
1378
+ * src_pathname src_mime src_x src_y
1379
+ * src_type src_bits src_pixels
1380
+ * src_size src_size_kb src_size_mb src_size_human
1381
+ * dst_path dst_name_body dst_pathname
1382
+ * dst_name dst_name_ext dst_x dst_y
1383
+ * date time host server ip
1384
+ * </pre>
1385
+ * The tokens must be enclosed in square brackets: [dst_x] will be replaced by the width of the picture
1386
+ *
1387
+ * Default value is null
1388
+ *
1389
+ * @access public
1390
+ * @var string;
1391
+ */
1392
+ var $image_text;
1393
+
1394
+ /**
1395
+ * Sets the text direction for the text label
1396
+ *
1397
+ * Value is either 'h' or 'v', as in horizontal and vertical
1398
+ *
1399
+ * Default value is h (horizontal)
1400
+ *
1401
+ * @access public
1402
+ * @var string;
1403
+ */
1404
+ var $image_text_direction;
1405
+
1406
+ /**
1407
+ * Sets the text color for the text label
1408
+ *
1409
+ * Value is an hexadecimal color, such as #FFFFFF
1410
+ *
1411
+ * Default value is #FFFFFF (white)
1412
+ *
1413
+ * @access public
1414
+ * @var string;
1415
+ */
1416
+ var $image_text_color;
1417
+
1418
+ /**
1419
+ * Sets the text visibility in the text label
1420
+ *
1421
+ * Value is a percentage, as an integer between 0 and 100
1422
+ *
1423
+ * Default value is 100
1424
+ *
1425
+ * @access public
1426
+ * @var integer
1427
+ */
1428
+ var $image_text_percent;
1429
+
1430
+ /**
1431
+ * Sets the text background color for the text label
1432
+ *
1433
+ * Value is an hexadecimal color, such as #FFFFFF
1434
+ *
1435
+ * Default value is null (no background)
1436
+ *
1437
+ * @access public
1438
+ * @var string;
1439
+ */
1440
+ var $image_text_background;
1441
+
1442
+ /**
1443
+ * Sets the text background visibility in the text label
1444
+ *
1445
+ * Value is a percentage, as an integer between 0 and 100
1446
+ *
1447
+ * Default value is 100
1448
+ *
1449
+ * @access public
1450
+ * @var integer
1451
+ */
1452
+ var $image_text_background_percent;
1453
+
1454
+ /**
1455
+ * Sets the text font in the text label
1456
+ *
1457
+ * Value is a an integer between 1 and 5 for GD built-in fonts. 1 is the smallest font, 5 the biggest
1458
+ * Value can also be a string, which represents the path to a GDF font. The font will be loaded into GD, and used as a built-in font.
1459
+ *
1460
+ * Default value is 5
1461
+ *
1462
+ * @access public
1463
+ * @var mixed;
1464
+ */
1465
+ var $image_text_font;
1466
+
1467
+ /**
1468
+ * Sets the text label position within the image
1469
+ *
1470
+ * Value is one or two out of 'TBLR' (top, bottom, left, right)
1471
+ *
1472
+ * The positions are as following:
1473
+ * <pre>
1474
+ * TL T TR
1475
+ * L R
1476
+ * BL B BR
1477
+ * </pre>
1478
+ *
1479
+ * Default value is null (centered, horizontal and vertical)
1480
+ *
1481
+ * Note that is {@link image_text_x} and {@link image_text_y} are used, this setting has no effect
1482
+ *
1483
+ * @access public
1484
+ * @var string;
1485
+ */
1486
+ var $image_text_position;
1487
+
1488
+ /**
1489
+ * Sets the text label absolute X position within the image
1490
+ *
1491
+ * Value is in pixels, representing the distance between the left of the image and the label
1492
+ * If a negative value is used, it will represent the distance between the right of the image and the label
1493
+ *
1494
+ * Default value is null (so {@link image_text_position} is used)
1495
+ *
1496
+ * @access public
1497
+ * @var integer
1498
+ */
1499
+ var $image_text_x;
1500
+
1501
+ /**
1502
+ * Sets the text label absolute Y position within the image
1503
+ *
1504
+ * Value is in pixels, representing the distance between the top of the image and the label
1505
+ * If a negative value is used, it will represent the distance between the bottom of the image and the label
1506
+ *
1507
+ * Default value is null (so {@link image_text_position} is used)
1508
+ *
1509
+ * @access public
1510
+ * @var integer
1511
+ */
1512
+ var $image_text_y;
1513
+
1514
+ /**
1515
+ * Sets the text label padding
1516
+ *
1517
+ * Value is in pixels, representing the distance between the text and the label background border
1518
+ *
1519
+ * Default value is 0
1520
+ *
1521
+ * This setting can be overriden by {@link image_text_padding_x} and {@link image_text_padding_y}
1522
+ *
1523
+ * @access public
1524
+ * @var integer
1525
+ */
1526
+ var $image_text_padding;
1527
+
1528
+ /**
1529
+ * Sets the text label horizontal padding
1530
+ *
1531
+ * Value is in pixels, representing the distance between the text and the left and right label background borders
1532
+ *
1533
+ * Default value is null
1534
+ *
1535
+ * If set, this setting overrides the horizontal part of {@link image_text_padding}
1536
+ *
1537
+ * @access public
1538
+ * @var integer
1539
+ */
1540
+ var $image_text_padding_x;
1541
+
1542
+ /**
1543
+ * Sets the text label vertical padding
1544
+ *
1545
+ * Value is in pixels, representing the distance between the text and the top and bottom label background borders
1546
+ *
1547
+ * Default value is null
1548
+ *
1549
+ * If set, his setting overrides the vertical part of {@link image_text_padding}
1550
+ *
1551
+ * @access public
1552
+ * @var integer
1553
+ */
1554
+ var $image_text_padding_y;
1555
+
1556
+ /**
1557
+ * Sets the text alignment
1558
+ *
1559
+ * Value is a string, which can be either 'L', 'C' or 'R'
1560
+ *
1561
+ * Default value is 'C'
1562
+ *
1563
+ * This setting is relevant only if the text has several lines.
1564
+ *
1565
+ * @access public
1566
+ * @var string;
1567
+ */
1568
+ var $image_text_alignment;
1569
+
1570
+ /**
1571
+ * Sets the text line spacing
1572
+ *
1573
+ * Value is an integer, in pixels
1574
+ *
1575
+ * Default value is 0
1576
+ *
1577
+ * This setting is relevant only if the text has several lines.
1578
+ *
1579
+ * @access public
1580
+ * @var integer
1581
+ */
1582
+ var $image_text_line_spacing;
1583
+
1584
+ /**
1585
+ * Sets the height of the reflection
1586
+ *
1587
+ * Value is an integer in pixels, or a string which format can be in pixels or percentage.
1588
+ * For instance, values can be : 40, '40', '40px' or '40%'
1589
+ *
1590
+ * Default value is null, no reflection
1591
+ *
1592
+ * @access public
1593
+ * @var mixed;
1594
+ */
1595
+ var $image_reflection_height;
1596
+
1597
+ /**
1598
+ * Sets the space between the source image and its relection
1599
+ *
1600
+ * Value is an integer in pixels, which can be negative
1601
+ *
1602
+ * Default value is 2
1603
+ *
1604
+ * This setting is relevant only if {@link image_reflection_height} is set
1605
+ *
1606
+ * @access public
1607
+ * @var integer
1608
+ */
1609
+ var $image_reflection_space;
1610
+
1611
+ /**
1612
+ * Sets the color of the reflection background (deprecated)
1613
+ *
1614
+ * Value is an hexadecimal color, such as #FFFFFF
1615
+ *
1616
+ * Default value is #FFFFFF
1617
+ *
1618
+ * This setting is relevant only if {@link image_reflection_height} is set
1619
+ *
1620
+ * This setting is now deprecated in favor of {@link image_default_color}
1621
+ *
1622
+ * @access public
1623
+ * @var string;
1624
+ */
1625
+ var $image_reflection_color;
1626
+
1627
+ /**
1628
+ * Sets the initial opacity of the reflection
1629
+ *
1630
+ * Value is an integer between 0 (no opacity) and 100 (full opacity).
1631
+ * The reflection will start from {@link image_reflection_opacity} and end up at 0
1632
+ *
1633
+ * Default value is 60
1634
+ *
1635
+ * This setting is relevant only if {@link image_reflection_height} is set
1636
+ *
1637
+ * @access public
1638
+ * @var integer
1639
+ */
1640
+ var $image_reflection_opacity;
1641
+
1642
+ /**
1643
+ * Flips the image vertically or horizontally
1644
+ *
1645
+ * Value is either 'h' or 'v', as in horizontal and vertical
1646
+ *
1647
+ * Default value is null (no flip)
1648
+ *
1649
+ * @access public
1650
+ * @var string;
1651
+ */
1652
+ var $image_flip;
1653
+
1654
+ /**
1655
+ * Rotates the image by increments of 45 degrees
1656
+ *
1657
+ * Value is either 90, 180 or 270
1658
+ *
1659
+ * Default value is null (no rotation)
1660
+ *
1661
+ * @access public
1662
+ * @var string;
1663
+ */
1664
+ var $image_rotate;
1665
+
1666
+ /**
1667
+ * Crops an image
1668
+ *
1669
+ * Values are four dimensions, or two, or one (CSS style)
1670
+ * They represent the amount cropped top, right, bottom and left.
1671
+ * These values can either be in an array, or a space separated string.
1672
+ * Each value can be in pixels (with or without 'px'), or percentage (of the source image)
1673
+ *
1674
+ * For instance, are valid:
1675
+ * <pre>
1676
+ * $foo->image_crop = 20 OR array(20);
1677
+ * $foo->image_crop = '20px' OR array('20px');
1678
+ * $foo->image_crop = '20 40' OR array('20', 40);
1679
+ * $foo->image_crop = '-20 25%' OR array(-20, '25%');
1680
+ * $foo->image_crop = '20px 25%' OR array('20px', '25%');
1681
+ * $foo->image_crop = '20% 25%' OR array('20%', '25%');
1682
+ * $foo->image_crop = '20% 25% 10% 30%' OR array('20%', '25%', '10%', '30%');
1683
+ * $foo->image_crop = '20px 25px 2px 2px' OR array('20px', '25%px', '2px', '2px');
1684
+ * $foo->image_crop = '20 25% 40px 10%' OR array(20, '25%', '40px', '10%');
1685
+ * </pre>
1686
+ *
1687
+ * If a value is negative, the image will be expanded, and the extra parts will be filled with black
1688
+ *
1689
+ * Default value is null (no cropping)
1690
+ *
1691
+ * @access public
1692
+ * @var string OR array;
1693
+ */
1694
+ var $image_crop;
1695
+
1696
+ /**
1697
+ * Crops an image, before an eventual resizing
1698
+ *
1699
+ * See {@link image_crop} for valid formats
1700
+ *
1701
+ * Default value is null (no cropping)
1702
+ *
1703
+ * @access public
1704
+ * @var string OR array;
1705
+ */
1706
+ var $image_precrop;
1707
+
1708
+ /**
1709
+ * Adds a bevel border on the image
1710
+ *
1711
+ * Value is a positive integer, representing the thickness of the bevel
1712
+ *
1713
+ * If the bevel colors are the same as the background, it makes a fade out effect
1714
+ *
1715
+ * Default value is null (no bevel)
1716
+ *
1717
+ * @access public
1718
+ * @var integer
1719
+ */
1720
+ var $image_bevel;
1721
+
1722
+ /**
1723
+ * Top and left bevel color
1724
+ *
1725
+ * Value is a color, in hexadecimal format
1726
+ * This setting is used only if {@link image_bevel} is set
1727
+ *
1728
+ * Default value is #FFFFFF
1729
+ *
1730
+ * @access public
1731
+ * @var string;
1732
+ */
1733
+ var $image_bevel_color1;
1734
+
1735
+ /**
1736
+ * Right and bottom bevel color
1737
+ *
1738
+ * Value is a color, in hexadecimal format
1739
+ * This setting is used only if {@link image_bevel} is set
1740
+ *
1741
+ * Default value is #000000
1742
+ *
1743
+ * @access public
1744
+ * @var string;
1745
+ */
1746
+ var $image_bevel_color2;
1747
+
1748
+ /**
1749
+ * Adds a single-color border on the outer of the image
1750
+ *
1751
+ * Values are four dimensions, or two, or one (CSS style)
1752
+ * They represent the border thickness top, right, bottom and left.
1753
+ * These values can either be in an array, or a space separated string.
1754
+ * Each value can be in pixels (with or without 'px'), or percentage (of the source image)
1755
+ *
1756
+ * See {@link image_crop} for valid formats
1757
+ *
1758
+ * If a value is negative, the image will be cropped.
1759
+ * Note that the dimensions of the picture will be increased by the borders' thickness
1760
+ *
1761
+ * Default value is null (no border)
1762
+ *
1763
+ * @access public
1764
+ * @var integer
1765
+ */
1766
+ var $image_border;
1767
+
1768
+ /**
1769
+ * Border color
1770
+ *
1771
+ * Value is a color, in hexadecimal format.
1772
+ * This setting is used only if {@link image_border} is set
1773
+ *
1774
+ * Default value is #FFFFFF
1775
+ *
1776
+ * @access public
1777
+ * @var string;
1778
+ */
1779
+ var $image_border_color;
1780
+
1781
+ /**
1782
+ * Adds a multi-color frame on the outer of the image
1783
+ *
1784
+ * Value is an integer. Two values are possible for now:
1785
+ * 1 for flat border, meaning that the frame is mirrored horizontally and vertically
1786
+ * 2 for crossed border, meaning that the frame will be inversed, as in a bevel effect
1787
+ *
1788
+ * The frame will be composed of colored lines set in {@link image_frame_colors}
1789
+ *
1790
+ * Note that the dimensions of the picture will be increased by the borders' thickness
1791
+ *
1792
+ * Default value is null (no frame)
1793
+ *
1794
+ * @access public
1795
+ * @var integer
1796
+ */
1797
+ var $image_frame;
1798
+
1799
+ /**
1800
+ * Sets the colors used to draw a frame
1801
+ *
1802
+ * Values is a list of n colors in hexadecimal format.
1803
+ * These values can either be in an array, or a space separated string.
1804
+ *
1805
+ * The colors are listed in the following order: from the outset of the image to its center
1806
+ *
1807
+ * For instance, are valid:
1808
+ * <pre>
1809
+ * $foo->image_frame_colors = '#FFFFFF #999999 #666666 #000000';
1810
+ * $foo->image_frame_colors = array('#FFFFFF', '#999999', '#666666', '#000000');
1811
+ * </pre>
1812
+ *
1813
+ * This setting is used only if {@link image_frame} is set
1814
+ *
1815
+ * Default value is '#FFFFFF #999999 #666666 #000000'
1816
+ *
1817
+ * @access public
1818
+ * @var string OR array;
1819
+ */
1820
+ var $image_frame_colors;
1821
+
1822
+ /**
1823
+ * Adds a watermark on the image
1824
+ *
1825
+ * Value is a local image filename, relative or absolute. GIF, JPG, BMP and PNG are supported, as well as PNG alpha.
1826
+ *
1827
+ * If set, this setting allow the use of all other settings starting with image_watermark_
1828
+ *
1829
+ * Default value is null
1830
+ *
1831
+ * @access public
1832
+ * @var string;
1833
+ */
1834
+ var $image_watermark;
1835
+
1836
+ /**
1837
+ * Sets the watermarkposition within the image
1838
+ *
1839
+ * Value is one or two out of 'TBLR' (top, bottom, left, right)
1840
+ *
1841
+ * The positions are as following: TL T TR
1842
+ * L R
1843
+ * BL B BR
1844
+ *
1845
+ * Default value is null (centered, horizontal and vertical)
1846
+ *
1847
+ * Note that is {@link image_watermark_x} and {@link image_watermark_y} are used, this setting has no effect
1848
+ *
1849
+ * @access public
1850
+ * @var string;
1851
+ */
1852
+ var $image_watermark_position;
1853
+
1854
+ /**
1855
+ * Sets the watermark absolute X position within the image
1856
+ *
1857
+ * Value is in pixels, representing the distance between the top of the image and the watermark
1858
+ * If a negative value is used, it will represent the distance between the bottom of the image and the watermark
1859
+ *
1860
+ * Default value is null (so {@link image_watermark_position} is used)
1861
+ *
1862
+ * @access public
1863
+ * @var integer
1864
+ */
1865
+ var $image_watermark_x;
1866
+
1867
+ /**
1868
+ * Sets the twatermark absolute Y position within the image
1869
+ *
1870
+ * Value is in pixels, representing the distance between the left of the image and the watermark
1871
+ * If a negative value is used, it will represent the distance between the right of the image and the watermark
1872
+ *
1873
+ * Default value is null (so {@link image_watermark_position} is used)
1874
+ *
1875
+ * @access public
1876
+ * @var integer
1877
+ */
1878
+ var $image_watermark_y;
1879
+
1880
+ /**
1881
+ * Allowed MIME types
1882
+ *
1883
+ * Default is a selection of safe mime-types, but you might want to change it
1884
+ *
1885
+ * Simple wildcards are allowed, such as image/* or application/*
1886
+ *
1887
+ * @access public
1888
+ * @var array
1889
+ */
1890
+ var $allowed;
1891
+
1892
+ /**
1893
+ * Forbidden MIME types
1894
+ *
1895
+ * Default is a selection of safe mime-types, but you might want to change it
1896
+ * To only check for forbidden MIME types, and allow everything else, set {@link allowed} to array('* / *') without the spaces
1897
+ *
1898
+ * Simple wildcards are allowed, such as image/* or application/*
1899
+ *
1900
+ * @access public
1901
+ * @var array
1902
+ */
1903
+ var $forbidden;
1904
+
1905
+ /**
1906
+ * Array of translated error messages
1907
+ *
1908
+ * By default, the language is english (en_US)
1909
+ * Translations can be in separate files, in a lang/ subdirectory
1910
+ *
1911
+ * @access public
1912
+ * @var array
1913
+ */
1914
+ var $translation;
1915
+
1916
+ /**
1917
+ * Language selected for the translations
1918
+ *
1919
+ * By default, the language is english (en_US)
1920
+ *
1921
+ * @access public
1922
+ * @var array
1923
+ */
1924
+ var $language;
1925
+
1926
+ /**
1927
+ * Init or re-init all the processing variables to their default values
1928
+ *
1929
+ * This function is called in the constructor, and after each call of {@link process}
1930
+ *
1931
+ * @access private
1932
+ */
1933
+ function init() {
1934
+
1935
+ // overiddable variables
1936
+ $this->file_new_name_body = ''; // replace the name body
1937
+ $this->file_name_body_add = ''; // append to the name body
1938
+ $this->file_name_body_pre = ''; // prepend to the name body
1939
+ $this->file_new_name_ext = ''; // replace the file extension
1940
+ $this->file_safe_name = true; // format safely the filename
1941
+ $this->file_overwrite = false; // allows overwritting if the file already exists
1942
+ $this->file_auto_rename = true; // auto-rename if the file already exists
1943
+ $this->dir_auto_create = true; // auto-creates directory if missing
1944
+ $this->dir_auto_chmod = true; // auto-chmod directory if not writeable
1945
+ $this->dir_chmod = 0777; // default chmod to use
1946
+
1947
+ $this->mime_check = true; // checks the mime type against the allowed list
1948
+ $this->mime_fileinfo = true; // MIME detection with Fileinfo PECL extension
1949
+ $this->mime_file = true; // MIME detection with UNIX file() command
1950
+ $this->mime_magic = true; // MIME detection with mime_magic (mime_content_type())
1951
+ $this->mime_getimagesize = true; // MIME detection with getimagesize()
1952
+ $this->no_script = true; // turns scripts into test files
1953
+
1954
+ $val = trim(ini_get('upload_max_filesize'));
1955
+ $last = strtolower($val{strlen($val)-1});
1956
+ switch($last) {
1957
+ case 'g':
1958
+ $val *= 1024;
1959
+ case 'm':
1960
+ $val *= 1024;
1961
+ case 'k':
1962
+ $val *= 1024;
1963
+ }
1964
+ $this->file_max_size = $val;
1965
+
1966
+ $this->image_resize = false; // resize the image
1967
+ $this->image_convert = ''; // convert. values :''; 'png'; 'jpeg'; 'gif'; 'bmp'
1968
+
1969
+ $this->image_x = 150;
1970
+ $this->image_y = 150;
1971
+ $this->image_ratio = false; // keeps aspect ratio with x and y dimensions
1972
+ $this->image_ratio_crop = false; // keeps aspect ratio with x and y dimensions, filling the space
1973
+ $this->image_ratio_fill = false; // keeps aspect ratio with x and y dimensions, fitting the image in the space, and coloring the rest
1974
+ $this->image_ratio_pixels = false; // keeps aspect ratio, calculating x and y so that the image is approx the set number of pixels
1975
+ $this->image_ratio_no_zoom_in = false;
1976
+ $this->image_ratio_no_zoom_out = false;
1977
+ $this->image_ratio_x = false; // calculate the $image_x if true
1978
+ $this->image_ratio_y = false; // calculate the $image_y if true
1979
+ $this->jpeg_quality = 85;
1980
+ $this->jpeg_size = null;
1981
+ $this->preserve_transparency = false;
1982
+ $this->image_is_transparent = false;
1983
+ $this->image_transparent_color = null;
1984
+ $this->image_background_color = null;
1985
+ $this->image_default_color = '#ffffff';
1986
+ $this->image_is_palette = false;
1987
+
1988
+ $this->image_max_width = null;
1989
+ $this->image_max_height = null;
1990
+ $this->image_max_pixels = null;
1991
+ $this->image_max_ratio = null;
1992
+ $this->image_min_width = null;
1993
+ $this->image_min_height = null;
1994
+ $this->image_min_pixels = null;
1995
+ $this->image_min_ratio = null;
1996
+
1997
+ $this->image_brightness = null;
1998
+ $this->image_contrast = null;
1999
+ $this->image_threshold = null;
2000
+ $this->image_tint_color = null;
2001
+ $this->image_overlay_color = null;
2002
+ $this->image_overlay_percent = null;
2003
+ $this->image_negative = false;
2004
+ $this->image_greyscale = false;
2005
+
2006
+ $this->image_text = null;
2007
+ $this->image_text_direction = null;
2008
+ $this->image_text_color = '#FFFFFF';
2009
+ $this->image_text_percent = 100;
2010
+ $this->image_text_background = null;
2011
+ $this->image_text_background_percent = 100;
2012
+ $this->image_text_font = 5;
2013
+ $this->image_text_x = null;
2014
+ $this->image_text_y = null;
2015
+ $this->image_text_position = null;
2016
+ $this->image_text_padding = 0;
2017
+ $this->image_text_padding_x = null;
2018
+ $this->image_text_padding_y = null;
2019
+ $this->image_text_alignment = 'C';
2020
+ $this->image_text_line_spacing = 0;
2021
+
2022
+ $this->image_reflection_height = null;
2023
+ $this->image_reflection_space = 2;
2024
+ $this->image_reflection_color = '#ffffff';
2025
+ $this->image_reflection_opacity = 60;
2026
+
2027
+ $this->image_watermark = null;
2028
+ $this->image_watermark_x = null;
2029
+ $this->image_watermark_y = null;
2030
+ $this->image_watermark_position = null;
2031
+
2032
+ $this->image_flip = null;
2033
+ $this->image_rotate = null;
2034
+ $this->image_crop = null;
2035
+ $this->image_precrop = null;
2036
+
2037
+ $this->image_bevel = null;
2038
+ $this->image_bevel_color1 = '#FFFFFF';
2039
+ $this->image_bevel_color2 = '#000000';
2040
+ $this->image_border = null;
2041
+ $this->image_border_color = '#FFFFFF';
2042
+ $this->image_frame = null;
2043
+ $this->image_frame_colors = '#FFFFFF #999999 #666666 #000000';
2044
+
2045
+ $this->forbidden = array();
2046
+ $this->allowed = array("application/arj",
2047
+ "application/excel",
2048
+ "application/gnutar",
2049
+ "application/mspowerpoint",
2050
+ "application/msword",
2051
+ "application/octet-stream",
2052
+ "application/onenote",
2053
+ "application/pdf",
2054
+ "application/plain",
2055
+ "application/postscript",
2056
+ "application/powerpoint",
2057
+ "application/rar",
2058
+ "application/rtf",
2059
+ "application/vnd.ms-excel",
2060
+ "application/vnd.ms-excel.addin.macroEnabled.12",
2061
+ "application/vnd.ms-excel.sheet.binary.macroEnabled.12",
2062
+ "application/vnd.ms-excel.sheet.macroEnabled.12",
2063
+ "application/vnd.ms-excel.template.macroEnabled.12",
2064
+ "application/vnd.ms-office",
2065
+ "application/vnd.ms-officetheme",
2066
+ "application/vnd.ms-powerpoint",
2067
+ "application/vnd.ms-powerpoint.addin.macroEnabled.12",
2068
+ "application/vnd.ms-powerpoint.presentation.macroEnabled.12",
2069
+ "application/vnd.ms-powerpoint.slide.macroEnabled.12",
2070
+ "application/vnd.ms-powerpoint.slideshow.macroEnabled.12",
2071
+ "application/vnd.ms-powerpoint.template.macroEnabled.12",
2072
+ "application/vnd.ms-word",
2073
+ "application/vnd.ms-word.document.macroEnabled.12",
2074
+ "application/vnd.ms-word.template.macroEnabled.12",
2075
+ "application/vnd.oasis.opendocument.chart",
2076
+ "application/vnd.oasis.opendocument.database",
2077
+ "application/vnd.oasis.opendocument.formula",
2078
+ "application/vnd.oasis.opendocument.graphics",
2079
+ "application/vnd.oasis.opendocument.graphics-template",
2080
+ "application/vnd.oasis.opendocument.image",
2081
+ "application/vnd.oasis.opendocument.presentation",
2082
+ "application/vnd.oasis.opendocument.presentation-template",
2083
+ "application/vnd.oasis.opendocument.spreadsheet",
2084
+ "application/vnd.oasis.opendocument.spreadsheet-template",
2085
+ "application/vnd.oasis.opendocument.text",
2086
+ "application/vnd.oasis.opendocument.text-master",
2087
+ "application/vnd.oasis.opendocument.text-template",
2088
+ "application/vnd.oasis.opendocument.text-web",
2089
+ "application/vnd.openofficeorg.extension",
2090
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation",
2091
+ "application/vnd.openxmlformats-officedocument.presentationml.slide",
2092
+ "application/vnd.openxmlformats-officedocument.presentationml.slideshow",
2093
+ "application/vnd.openxmlformats-officedocument.presentationml.template",
2094
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
2095
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.template",
2096
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
2097
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
2098
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.template",
2099
+ "application/vocaltec-media-file",
2100
+ "application/wordperfect",
2101
+ "application/x-bittorrent",
2102
+ "application/x-bzip",
2103
+ "application/x-bzip2",
2104
+ "application/x-compressed",
2105
+ "application/x-excel",
2106
+ "application/x-gzip",
2107
+ "application/x-latex",
2108
+ "application/x-midi",
2109
+ "application/xml",
2110
+ "application/x-msexcel",
2111
+ "application/x-rar-compressed",
2112
+ "application/x-rtf",
2113
+ "application/x-shockwave-flash",
2114
+ "application/x-sit",
2115
+ "application/x-stuffit",
2116
+ "application/x-troff-msvideo",
2117
+ "application/x-zip",
2118
+ "application/x-zip-compressed",
2119
+ "application/zip",
2120
+ "audio/*",
2121
+ "image/*",
2122
+ "multipart/x-gzip",
2123
+ "multipart/x-zip",
2124
+ "text/plain",
2125
+ "text/richtext",
2126
+ "text/xml",
2127
+ "video/*");
2128
+
2129
+ }
2130
+
2131
+ /**
2132
+ * Constructor. Checks if the file has been uploaded
2133
+ *
2134
+ * The constructor takes $_FILES['form_field'] array as argument
2135
+ * where form_field is the form field name
2136
+ *
2137
+ * The constructor will check if the file has been uploaded in its temporary location, and
2138
+ * accordingly will set {@link uploaded} (and {@link error} is an error occurred)
2139
+ *
2140
+ * If the file has been uploaded, the constructor will populate all the variables holding the upload
2141
+ * information (none of the processing class variables are used here).
2142
+ * You can have access to information about the file (name, size, MIME type...).
2143
+ *
2144
+ *
2145
+ * Alternatively, you can set the first argument to be a local filename (string)
2146
+ * This allows processing of a local file, as if the file was uploaded
2147
+ *
2148
+ * The optional second argument allows you to set the language for the error messages
2149
+ *
2150
+ * @access private
2151
+ * @param array $file $_FILES['form_field']
2152
+ * or string $file Local filename
2153
+ */
2154
+ function akUpload( $file ) {
2155
+
2156
+ $this->version = '0.29';
2157
+ $this->language = 'en_US'; // Not used.
2158
+
2159
+ $this->file_src_name = '';
2160
+ $this->file_src_name_body = '';
2161
+ $this->file_src_name_ext = '';
2162
+ $this->file_src_mime = '';
2163
+ $this->file_src_size = '';
2164
+ $this->file_src_error = '';
2165
+ $this->file_src_pathname = '';
2166
+ $this->file_src_temp = '';
2167
+
2168
+ $this->file_dst_path = '';
2169
+ $this->file_dst_name = '';
2170
+ $this->file_dst_name_body = '';
2171
+ $this->file_dst_name_ext = '';
2172
+ $this->file_dst_pathname = '';
2173
+
2174
+ $this->image_src_x = null;
2175
+ $this->image_src_y = null;
2176
+ $this->image_src_bits = null;
2177
+ $this->image_src_type = null;
2178
+ $this->image_src_pixels = null;
2179
+ $this->image_dst_x = 0;
2180
+ $this->image_dst_y = 0;
2181
+
2182
+ $this->uploaded = true;
2183
+ $this->no_upload_check = false;
2184
+ $this->processed = true;
2185
+ $this->error = '';
2186
+ $this->log = '';
2187
+ $this->allowed = array();
2188
+ $this->forbidden = array();
2189
+ $this->file_is_image = false;
2190
+ $this->init();
2191
+ $info = null;
2192
+ $mime_from_browser = null;
2193
+
2194
+ $this->translation = array();
2195
+ $this->translation['file_error'] = __('File error. Please try again.', 'akfw');
2196
+ $this->translation['local_file_missing'] = __('Local file doesn\'t exist.', 'akfw');
2197
+ $this->translation['local_file_not_readable'] = __('Local file is not readable.', 'akfw');
2198
+ $this->translation['uploaded_too_big_ini'] = __('File upload error (the uploaded file exceeds the upload_max_filesize directive in php.ini).', 'akfw');
2199
+ $this->translation['uploaded_too_big_html'] = __('File upload error (the uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form).', 'akfw');
2200
+ $this->translation['uploaded_partial'] = __('File upload error (the uploaded file was only partially uploaded).', 'akfw');
2201
+ $this->translation['uploaded_missing'] = __('File upload error (no file was uploaded).', 'akfw');
2202
+ $this->translation['uploaded_no_tmp_dir'] = __('File upload error (missing a temporary folder).', 'akfw');
2203
+ $this->translation['uploaded_cant_write'] = __('File upload error (failed to write file to disk).', 'akfw');
2204
+ $this->translation['uploaded_err_extension'] = __('File upload error (file upload stopped by extension).', 'akfw');
2205
+ $this->translation['uploaded_unknown'] = __('File upload error (unknown error code).', 'akfw');
2206
+ $this->translation['try_again'] = __('File upload error. Please try again.', 'akfw');
2207
+ $this->translation['file_too_big'] = __('File too big.', 'akfw');
2208
+ $this->translation['no_mime'] = __('MIME type can\'t be detected.', 'akfw');
2209
+ $this->translation['incorrect_file'] = __('Incorrect type of file.', 'akfw');
2210
+ $this->translation['image_too_wide'] = __('Image too wide.', 'akfw');
2211
+ $this->translation['image_too_narrow'] = __('Image too narrow.', 'akfw');
2212
+ $this->translation['image_too_high'] = __('Image too high.', 'akfw');
2213
+ $this->translation['image_too_short'] = __('Image too short.', 'akfw');
2214
+ $this->translation['ratio_too_high'] = __('Image ratio too high (image too wide).', 'akfw');
2215
+ $this->translation['ratio_too_low'] = __('Image ratio too low (image too high).', 'akfw');
2216
+ $this->translation['too_many_pixels'] = __('Image has too many pixels.', 'akfw');
2217
+ $this->translation['not_enough_pixels'] = __('Image has not enough pixels.', 'akfw');
2218
+ $this->translation['file_not_uploaded'] = __('File not uploaded. Can\'t carry on a process.', 'akfw');
2219
+ $this->translation['already_exists'] = __('%s already exists. Please change the file name.', 'akfw');
2220
+ $this->translation['temp_file_missing'] = __('No correct temp source file. Can\'t carry on a process.', 'akfw');
2221
+ $this->translation['source_missing'] = __('No correct uploaded source file. Can\'t carry on a process.', 'akfw');
2222
+ $this->translation['destination_dir'] = __('Destination directory can\'t be created. Can\'t carry on a process.', 'akfw');
2223
+ $this->translation['destination_dir_missing'] = __('Destination directory doesn\'t exist. Can\'t carry on a process.', 'akfw');
2224
+ $this->translation['destination_path_not_dir'] = __('Destination path is not a directory. Can\'t carry on a process.', 'akfw');
2225
+ $this->translation['destination_dir_write'] = __('Destination directory can\'t be made writeable. Can\'t carry on a process.', 'akfw');
2226
+ $this->translation['destination_path_write'] = __('Destination path is not a writeable. Can\'t carry on a process.', 'akfw');
2227
+ $this->translation['temp_file'] = __('Can\'t create the temporary file. Can\'t carry on a process.', 'akfw');
2228
+ $this->translation['source_not_readable'] = __('Source file is not readable. Can\'t carry on a process.', 'akfw');
2229
+ $this->translation['no_create_support'] = __('No create from %s support.', 'akfw');
2230
+ $this->translation['create_error'] = __('Error in creating %s image from source.', 'akfw');
2231
+ $this->translation['source_invalid'] = __('Can\'t read image source. Not an image?.', 'akfw');
2232
+ $this->translation['gd_missing'] = __('GD doesn\'t seem to be present.', 'akfw');
2233
+ $this->translation['watermark_no_create_support'] = __('No create from %s support, can\'t read watermark.', 'akfw');
2234
+ $this->translation['watermark_create_error'] = __('No %s read support, can\'t create watermark.', 'akfw');
2235
+ $this->translation['watermark_invalid'] = __('Unknown image format, can\'t read watermark.', 'akfw');
2236
+ $this->translation['file_create'] = __('No %s create support.', 'akfw');
2237
+ $this->translation['no_conversion_type'] = __('No conversion type defined.', 'akfw');
2238
+ $this->translation['copy_failed'] = __('Error copying file on the server. copy() failed.', 'akfw');
2239
+ $this->translation['reading_failed'] = __('Error reading the file.', 'akfw');
2240
+
2241
+ // determines the supported MIME types, and matching image format
2242
+ $this->image_supported = array();
2243
+ if ($this->gdversion()) {
2244
+ if (imagetypes() & IMG_GIF) {
2245
+ $this->image_supported['image/gif'] = 'gif';
2246
+ }
2247
+ if (imagetypes() & IMG_JPG) {
2248
+ $this->image_supported['image/jpg'] = 'jpg';
2249
+ $this->image_supported['image/jpeg'] = 'jpg';
2250
+ $this->image_supported['image/pjpeg'] = 'jpg';
2251
+ }
2252
+ if (imagetypes() & IMG_PNG) {
2253
+ $this->image_supported['image/png'] = 'png';
2254
+ $this->image_supported['image/x-png'] = 'png';
2255
+ }
2256
+ if (imagetypes() & IMG_WBMP) {
2257
+ $this->image_supported['image/bmp'] = 'bmp';
2258
+ $this->image_supported['image/x-ms-bmp'] = 'bmp';
2259
+ $this->image_supported['image/x-windows-bmp'] = 'bmp';
2260
+ }
2261
+ }
2262
+
2263
+ // display some system information
2264
+ if (empty($this->log)) {
2265
+ $this->log .= '<b>system information</b><br />';
2266
+ $inis = ini_get_all();
2267
+ $open_basedir = (array_key_exists('open_basedir', $inis) && array_key_exists('local_value', $inis['open_basedir']) && !empty($inis['open_basedir']['local_value'])) ? $inis['open_basedir']['local_value'] : false;
2268
+ $gd = $this->gdversion() ? $this->gdversion(true) : 'GD not present';
2269
+ $supported = trim((in_array('png', $this->image_supported) ? 'png' : '') . ' ' . (in_array('jpg', $this->image_supported) ? 'jpg' : '') . ' ' . (in_array('gif', $this->image_supported) ? 'gif' : '') . ' ' . (in_array('bmp', $this->image_supported) ? 'bmp' : ''));
2270
+ $this->log .= '-&nbsp;class version : ' . $this->version . '<br />';
2271
+ $this->log .= '-&nbsp;operating system : ' . PHP_OS . '<br />';
2272
+ $this->log .= '-&nbsp;PHP version : ' . PHP_VERSION . '<br />';
2273
+ $this->log .= '-&nbsp;GD version : ' . $gd . '<br />';
2274
+ $this->log .= '-&nbsp;supported image types : ' . (!empty($supported) ? $supported : 'none') . '<br />';
2275
+ $this->log .= '-&nbsp;open_basedir : ' . (!empty($open_basedir) ? $open_basedir : 'no restriction') . '<br />';
2276
+ $this->log .= '-&nbsp;language : ' . $this->language . '<br />';
2277
+ }
2278
+
2279
+ if (!$file) {
2280
+ $this->uploaded = false;
2281
+ $this->error = $this->translate('file_error');
2282
+ }
2283
+
2284
+ // check if we sent a local filename rather than a $_FILE element
2285
+ if (!is_array($file)) {
2286
+ if (empty($file)) {
2287
+ $this->uploaded = false;
2288
+ $this->error = $this->translate('file_error');
2289
+ } else {
2290
+ $this->no_upload_check = TRUE;
2291
+ // this is a local filename, i.e.not uploaded
2292
+ $this->log .= '<b>' . $this->translate("source is a local file") . ' ' . $file . '</b><br />';
2293
+
2294
+ if ($this->uploaded && !file_exists($file)) {
2295
+ $this->uploaded = false;
2296
+ $this->error = $this->translate('local_file_missing');
2297
+ }
2298
+
2299
+ if ($this->uploaded && !is_readable($file)) {
2300
+ $this->uploaded = false;
2301
+ $this->error = $this->translate('local_file_not_readable');
2302
+ }
2303
+
2304
+ if ($this->uploaded) {
2305
+ $this->file_src_pathname = $file;
2306
+ $this->file_src_name = basename($file);
2307
+ $this->log .= '- local file name OK<br />';
2308
+ preg_match('/\.([^\.]*$)/', $this->file_src_name, $extension);
2309
+ if (is_array($extension) && sizeof($extension) > 0) {
2310
+ $this->file_src_name_ext = strtolower($extension[1]);
2311
+ $this->file_src_name_body = substr($this->file_src_name, 0, ((strlen($this->file_src_name) - strlen($this->file_src_name_ext)))-1);
2312
+ } else {
2313
+ $this->file_src_name_ext = '';
2314
+ $this->file_src_name_body = $this->file_src_name;
2315
+ }
2316
+ $this->file_src_size = (file_exists($file) ? filesize($file) : 0);
2317
+ }
2318
+ $this->file_src_error = 0;
2319
+ }
2320
+ } else {
2321
+ // this is an element from $_FILE, i.e. an uploaded file
2322
+ $this->log .= '<b>source is an uploaded file</b><br />';
2323
+ if ($this->uploaded) {
2324
+ $this->file_src_error = trim($file['error']);
2325
+ switch($this->file_src_error) {
2326
+ case UPLOAD_ERR_OK:
2327
+ // all is OK
2328
+ $this->log .= '- upload OK<br />';
2329
+ break;
2330
+ case UPLOAD_ERR_INI_SIZE:
2331
+ $this->uploaded = false;
2332
+ $this->error = $this->translate('uploaded_too_big_ini');
2333
+ break;
2334
+ case UPLOAD_ERR_FORM_SIZE:
2335
+ $this->uploaded = false;
2336
+ $this->error = $this->translate('uploaded_too_big_html');
2337
+ break;
2338
+ case UPLOAD_ERR_PARTIAL:
2339
+ $this->uploaded = false;
2340
+ $this->error = $this->translate('uploaded_partial');
2341
+ break;
2342
+ case UPLOAD_ERR_NO_FILE:
2343
+ $this->uploaded = false;
2344
+ $this->error = $this->translate('uploaded_missing');
2345
+ break;
2346
+ case @UPLOAD_ERR_NO_TMP_DIR:
2347
+ $this->uploaded = false;
2348
+ $this->error = $this->translate('uploaded_no_tmp_dir');
2349
+ break;
2350
+ case @UPLOAD_ERR_CANT_WRITE:
2351
+ $this->uploaded = false;
2352
+ $this->error = $this->translate('uploaded_cant_write');
2353
+ break;
2354
+ case @UPLOAD_ERR_EXTENSION:
2355
+ $this->uploaded = false;
2356
+ $this->error = $this->translate('uploaded_err_extension');
2357
+ break;
2358
+ default:
2359
+ $this->uploaded = false;
2360
+ $this->error = $this->translate('uploaded_unknown') . ' ('.$this->file_src_error.')';
2361
+ }
2362
+ }
2363
+
2364
+ if ($this->uploaded) {
2365
+ $this->file_src_pathname = $file['tmp_name'];
2366
+ $this->file_src_name = $file['name'];
2367
+ if ($this->file_src_name == '') {
2368
+ $this->uploaded = false;
2369
+ $this->error = $this->translate('try_again');
2370
+ }
2371
+ }
2372
+
2373
+ if ($this->uploaded) {
2374
+ $this->log .= '- file name OK<br />';
2375
+ preg_match('/\.([^\.]*$)/', $this->file_src_name, $extension);
2376
+ if (is_array($extension) && sizeof($extension) > 0) {
2377
+ $this->file_src_name_ext = strtolower($extension[1]);
2378
+ $this->file_src_name_body = substr($this->file_src_name, 0, ((strlen($this->file_src_name) - strlen($this->file_src_name_ext)))-1);
2379
+ } else {
2380
+ $this->file_src_name_ext = '';
2381
+ $this->file_src_name_body = $this->file_src_name;
2382
+ }
2383
+ $this->file_src_size = $file['size'];
2384
+ $mime_from_browser = $file['type'];
2385
+ }
2386
+ }
2387
+
2388
+ if ($this->uploaded) {
2389
+ $this->log .= '<b>determining MIME type</b><br />';
2390
+ $this->file_src_mime = null;
2391
+
2392
+ // checks MIME type with Fileinfo PECL extension
2393
+ if (!$this->file_src_mime || !is_string($this->file_src_mime) || empty($this->file_src_mime) || strpos($this->file_src_mime, '/') === FALSE) {
2394
+ if ($this->mime_fileinfo) {
2395
+ $this->log .= '- Checking MIME type with Fileinfo PECL extension<br />';
2396
+ if (function_exists('finfo_open')) {
2397
+ if ($this->mime_fileinfo !== '') {
2398
+ if ($this->mime_fileinfo === true) {
2399
+ if (getenv('MAGIC') === FALSE) {
2400
+ if (substr(PHP_OS, 0, 3) == 'WIN') {
2401
+ $path = realpath(ini_get('extension_dir') . '/../') . 'extras/magic';
2402
+ } else {
2403
+ $path = '/usr/share/file/magic';
2404
+ }
2405
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;MAGIC path defaults to ' . $path . '<br />';
2406
+ } else {
2407
+ $path = getenv('MAGIC');
2408
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;MAGIC path is set to ' . $path . ' from MAGIC variable<br />';
2409
+ }
2410
+ } else {
2411
+ $path = $this->mime_fileinfo;
2412
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;MAGIC path is set to ' . $path . '<br />';
2413
+ }
2414
+ $f = @finfo_open(FILEINFO_MIME, $path);
2415
+ } else {
2416
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;MAGIC path will not be used<br />';
2417
+ $f = @finfo_open(FILEINFO_MIME);
2418
+ }
2419
+ if (is_resource($f)) {
2420
+ $mime = finfo_file($f, realpath($this->file_src_pathname));
2421
+ finfo_close($f);
2422
+ $this->file_src_mime = $mime;
2423
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;MIME type detected as ' . $this->file_src_mime . ' by Fileinfo PECL extension<br />';
2424
+ if (preg_match("/^([\.-\w]+)\/([\.-\w]+)(.*)$/i", $this->file_src_mime)) {
2425
+ $this->file_src_mime = preg_replace("/^([\.-\w]+)\/([\.-\w]+)(.*)$/i", '$1/$2', $this->file_src_mime);
2426
+ $this->log .= '-&nbsp;MIME validated as ' . $this->file_src_mime . '<br />';
2427
+ } else {
2428
+ $this->file_src_mime = null;
2429
+ }
2430
+ } else {
2431
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;Fileinfo PECL extension failed (finfo_open)<br />';
2432
+ }
2433
+ } elseif (class_exists('finfo')) {
2434
+ $f = new finfo( FILEINFO_MIME );
2435
+ if ($f) {
2436
+ $this->file_src_mime = $f->file(realpath($this->file_src_pathname));
2437
+ $this->log .= '- MIME type detected as ' . $this->file_src_mime . ' by Fileinfo PECL extension<br />';
2438
+ if (preg_match("/^([\.-\w]+)\/([\.-\w]+)(.*)$/i", $this->file_src_mime)) {
2439
+ $this->file_src_mime = preg_replace("/^([\.-\w]+)\/([\.-\w]+)(.*)$/i", '$1/$2', $this->file_src_mime);
2440
+ $this->log .= '-&nbsp;MIME validated as ' . $this->file_src_mime . '<br />';
2441
+ } else {
2442
+ $this->file_src_mime = null;
2443
+ }
2444
+ } else {
2445
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;Fileinfo PECL extension failed (finfo)<br />';
2446
+ }
2447
+ } else {
2448
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;Fileinfo PECL extension not available<br />';
2449
+ }
2450
+ } else {
2451
+ $this->log .= '- Fileinfo PECL extension deactivated<br />';
2452
+ }
2453
+ }
2454
+
2455
+ // checks MIME type with shell if unix access is authorized
2456
+ if (!$this->file_src_mime || !is_string($this->file_src_mime) || empty($this->file_src_mime) || strpos($this->file_src_mime, '/') === FALSE) {
2457
+ if ($this->mime_file) {
2458
+ $this->log .= '- Checking MIME type with UNIX file() command<br />';
2459
+ if (substr(PHP_OS, 0, 3) != 'WIN') {
2460
+ if (strlen($mime = @exec("file -bi ".escapeshellarg($this->file_src_pathname))) != 0) {
2461
+ $this->file_src_mime = trim($mime);
2462
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;MIME type detected as ' . $this->file_src_mime . ' by UNIX file() command<br />';
2463
+ if (preg_match("/^([\.-\w]+)\/([\.-\w]+)(.*)$/i", $this->file_src_mime)) {
2464
+ $this->file_src_mime = preg_replace("/^([\.-\w]+)\/([\.-\w]+)(.*)$/i", '$1/$2', $this->file_src_mime);
2465
+ $this->log .= '-&nbsp;MIME validated as ' . $this->file_src_mime . '<br />';
2466
+ } else {
2467
+ $this->file_src_mime = null;
2468
+ }
2469
+ } else {
2470
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;UNIX file() command failed<br />';
2471
+ }
2472
+ } else {
2473
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;UNIX file() command not availabled<br />';
2474
+ }
2475
+ } else {
2476
+ $this->log .= '- UNIX file() command is deactivated<br />';
2477
+ }
2478
+ }
2479
+
2480
+ // checks MIME type with mime_magic
2481
+ if (!$this->file_src_mime || !is_string($this->file_src_mime) || empty($this->file_src_mime) || strpos($this->file_src_mime, '/') === FALSE) {
2482
+ if ($this->mime_magic) {
2483
+ $this->log .= '- Checking MIME type with mime.magic file (mime_content_type())<br />';
2484
+ if (function_exists('mime_content_type')) {
2485
+ $this->file_src_mime = mime_content_type($this->file_src_pathname);
2486
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;MIME type detected as ' . $this->file_src_mime . ' by mime_content_type()<br />';
2487
+ if (preg_match("/^([\.-\w]+)\/([\.-\w]+)(.*)$/i", $this->file_src_mime)) {
2488
+ $this->file_src_mime = preg_replace("/^([\.-\w]+)\/([\.-\w]+)(.*)$/i", '$1/$2', $this->file_src_mime);
2489
+ $this->log .= '-&nbsp;MIME validated as ' . $this->file_src_mime . '<br />';
2490
+ } else {
2491
+ $this->file_src_mime = null;
2492
+ }
2493
+ } else {
2494
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;mime_content_type() is not available<br />';
2495
+ }
2496
+ } else {
2497
+ $this->log .= '- mime.magic file (mime_content_type()) is deactivated<br />';
2498
+ }
2499
+ }
2500
+
2501
+ // checks MIME type with getimagesize()
2502
+ if (!$this->file_src_mime || !is_string($this->file_src_mime) || empty($this->file_src_mime) || strpos($this->file_src_mime, '/') === FALSE) {
2503
+ if ($this->mime_getimagesize) {
2504
+ $this->log .= '- Checking MIME type with getimagesize()<br />';
2505
+ $info = getimagesize($this->file_src_pathname);
2506
+ if (is_array($info) && array_key_exists('mime', $info)) {
2507
+ $this->file_src_mime = trim($info['mime']);
2508
+ if (empty($this->file_src_mime)) {
2509
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;MIME empty, guessing from type<br />';
2510
+ $mime = (is_array($info) && array_key_exists(2, $info) ? $info[2] : null); // 1 = GIF, 2 = JPG, 3 = PNG
2511
+ $this->file_src_mime = ($mime==IMAGETYPE_GIF ? 'image/gif' : ($mime==IMAGETYPE_JPEG ? 'image/jpeg' : ($mime==IMAGETYPE_PNG ? 'image/png' : ($mime==IMAGETYPE_BMP ? 'image/bmp' : null))));
2512
+ }
2513
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;MIME type detected as ' . $this->file_src_mime . ' by PHP getimagesize() function<br />';
2514
+ if (preg_match("/^([\.-\w]+)\/([\.-\w]+)(.*)$/i", $this->file_src_mime)) {
2515
+ $this->file_src_mime = preg_replace("/^([\.-\w]+)\/([\.-\w]+)(.*)$/i", '$1/$2', $this->file_src_mime);
2516
+ $this->log .= '-&nbsp;MIME validated as ' . $this->file_src_mime . '<br />';
2517
+ } else {
2518
+ $this->file_src_mime = null;
2519
+ }
2520
+ } else {
2521
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;getimagesize() failed<br />';
2522
+ }
2523
+ } else {
2524
+ $this->log .= '- getimagesize() is deactivated<br />';
2525
+ }
2526
+ }
2527
+
2528
+ // default to MIME from browser (or Flash)
2529
+ if (!empty($mime_from_browser) && !$this->file_src_mime || !is_string($this->file_src_mime) || empty($this->file_src_mime)) {
2530
+ $this->file_src_mime =$mime_from_browser;
2531
+ $this->log .= '- MIME type detected as ' . $this->file_src_mime . ' by browser<br />';
2532
+ if (preg_match("/^([\.-\w]+)\/([\.-\w]+)(.*)$/i", $this->file_src_mime)) {
2533
+ $this->file_src_mime = preg_replace("/^([\.-\w]+)\/([\.-\w]+)(.*)$/i", '$1/$2', $this->file_src_mime);
2534
+ $this->log .= '-&nbsp;MIME validated as ' . $this->file_src_mime . '<br />';
2535
+ } else {
2536
+ $this->file_src_mime = null;
2537
+ }
2538
+ }
2539
+
2540
+ // we need to work some magic if we upload via Flash
2541
+ if ($this->file_src_mime == 'application/octet-stream' || !$this->file_src_mime || !is_string($this->file_src_mime) || empty($this->file_src_mime) || strpos($this->file_src_mime, '/') === FALSE) {
2542
+ if ($this->file_src_mime == 'application/octet-stream') $this->log .= '- Flash may be rewriting MIME as application/octet-stream<br />';
2543
+ $this->log .= '- Try to guess MIME type from file extension (' . $this->file_src_name_ext . '): ';
2544
+ switch($this->file_src_name_ext) {
2545
+ case 'jpg':
2546
+ case 'jpeg':
2547
+ case 'jpe':
2548
+ $this->file_src_mime = 'image/jpeg';
2549
+ break;
2550
+ case 'gif':
2551
+ $this->file_src_mime = 'image/gif';
2552
+ break;
2553
+ case 'png':
2554
+ $this->file_src_mime = 'image/png';
2555
+ break;
2556
+ case 'bmp':
2557
+ $this->file_src_mime = 'image/bmp';
2558
+ break;
2559
+ case 'flv':
2560
+ $this->file_src_mime = 'video/x-flv';
2561
+ break;
2562
+ case 'js' :
2563
+ $this->file_src_mime = 'application/x-javascript';
2564
+ break;
2565
+ case 'json' :
2566
+ $this->file_src_mime = 'application/json';
2567
+ break;
2568
+ case 'tiff' :
2569
+ $this->file_src_mime = 'image/tiff';
2570
+ break;
2571
+ case 'css' :
2572
+ $this->file_src_mime = 'text/css';
2573
+ break;
2574
+ case 'xml' :
2575
+ $this->file_src_mime = 'application/xml';
2576
+ break;
2577
+ case 'doc' :
2578
+ case 'docx' :
2579
+ $this->file_src_mime = 'application/msword';
2580
+ break;
2581
+ case 'xls' :
2582
+ case 'xlt' :
2583
+ case 'xlm' :
2584
+ case 'xld' :
2585
+ case 'xla' :
2586
+ case 'xlc' :
2587
+ case 'xlw' :
2588
+ case 'xll' :
2589
+ $this->file_src_mime = 'application/vnd.ms-excel';
2590
+ break;
2591
+ case 'ppt' :
2592
+ case 'pps' :
2593
+ $this->file_src_mime = 'application/vnd.ms-powerpoint';
2594
+ break;
2595
+ case 'rtf' :
2596
+ $this->file_src_mime = 'application/rtf';
2597
+ break;
2598
+ case 'pdf' :
2599
+ $this->file_src_mime = 'application/pdf';
2600
+ break;
2601
+ case 'html' :
2602
+ case 'htm' :
2603
+ case 'php' :
2604
+ $this->file_src_mime = 'text/html';
2605
+ break;
2606
+ case 'txt' :
2607
+ $this->file_src_mime = 'text/plain';
2608
+ break;
2609
+ case 'mpeg' :
2610
+ case 'mpg' :
2611
+ case 'mpe' :
2612
+ $this->file_src_mime = 'video/mpeg';
2613
+ break;
2614
+ case 'mp3' :
2615
+ $this->file_src_mime = 'audio/mpeg3';
2616
+ break;
2617
+ case 'wav' :
2618
+ $this->file_src_mime = 'audio/wav';
2619
+ break;
2620
+ case 'aiff' :
2621
+ case 'aif' :
2622
+ $this->file_src_mime = 'audio/aiff';
2623
+ break;
2624
+ case 'avi' :
2625
+ $this->file_src_mime = 'video/msvideo';
2626
+ break;
2627
+ case 'wmv' :
2628
+ $this->file_src_mime = 'video/x-ms-wmv';
2629
+ break;
2630
+ case 'mov' :
2631
+ $this->file_src_mime = 'video/quicktime';
2632
+ break;
2633
+ case 'zip' :
2634
+ $this->file_src_mime = 'application/zip';
2635
+ break;
2636
+ case 'tar' :
2637
+ $this->file_src_mime = 'application/x-tar';
2638
+ break;
2639
+ case 'swf' :
2640
+ $this->file_src_mime = 'application/x-shockwave-flash';
2641
+ break;
2642
+ case 'odt':
2643
+ $this->file_src_mime = 'application/vnd.oasis.opendocument.text';
2644
+ break;
2645
+ case 'ott':
2646
+ $this->file_src_mime = 'application/vnd.oasis.opendocument.text-template';
2647
+ break;
2648
+ case 'oth':
2649
+ $this->file_src_mime = 'application/vnd.oasis.opendocument.text-web';
2650
+ break;
2651
+ case 'odm':
2652
+ $this->file_src_mime = 'application/vnd.oasis.opendocument.text-master';
2653
+ break;
2654
+ case 'odg':
2655
+ $this->file_src_mime = 'application/vnd.oasis.opendocument.graphics';
2656
+ break;
2657
+ case 'otg':
2658
+ $this->file_src_mime = 'application/vnd.oasis.opendocument.graphics-template';
2659
+ break;
2660
+ case 'odp':
2661
+ $this->file_src_mime = 'application/vnd.oasis.opendocument.presentation';
2662
+ break;
2663
+ case 'otp':
2664
+ $this->file_src_mime = 'application/vnd.oasis.opendocument.presentation-template';
2665
+ break;
2666
+ case 'ods':
2667
+ $this->file_src_mime = 'application/vnd.oasis.opendocument.spreadsheet';
2668
+ break;
2669
+ case 'ots':
2670
+ $this->file_src_mime = 'application/vnd.oasis.opendocument.spreadsheet-template';
2671
+ break;
2672
+ case 'odc':
2673
+ $this->file_src_mime = 'application/vnd.oasis.opendocument.chart';
2674
+ break;
2675
+ case 'odf':
2676
+ $this->file_src_mime = 'application/vnd.oasis.opendocument.formula';
2677
+ break;
2678
+ case 'odb':
2679
+ $this->file_src_mime = 'application/vnd.oasis.opendocument.database';
2680
+ break;
2681
+ case 'odi':
2682
+ $this->file_src_mime = 'application/vnd.oasis.opendocument.image';
2683
+ break;
2684
+ case 'oxt':
2685
+ $this->file_src_mime = 'application/vnd.openofficeorg.extension';
2686
+ break;
2687
+ case 'docx':
2688
+ $this->file_src_mime = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
2689
+ break;
2690
+ case 'docm':
2691
+ $this->file_src_mime = 'application/vnd.ms-word.document.macroEnabled.12';
2692
+ break;
2693
+ case 'dotx':
2694
+ $this->file_src_mime = 'application/vnd.openxmlformats-officedocument.wordprocessingml.template';
2695
+ break;
2696
+ case 'dotm':
2697
+ $this->file_src_mime = 'application/vnd.ms-word.template.macroEnabled.12';
2698
+ break;
2699
+ case 'xlsx':
2700
+ $this->file_src_mime = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
2701
+ break;
2702
+ case 'xlsm':
2703
+ $this->file_src_mime = 'application/vnd.ms-excel.sheet.macroEnabled.12';
2704
+ break;
2705
+ case 'xltx':
2706
+ $this->file_src_mime = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template';
2707
+ break;
2708
+ case 'xltm':
2709
+ $this->file_src_mime = 'application/vnd.ms-excel.template.macroEnabled.12';
2710
+ break;
2711
+ case 'xlsb':
2712
+ $this->file_src_mime = 'application/vnd.ms-excel.sheet.binary.macroEnabled.12';
2713
+ break;
2714
+ case 'xlam':
2715
+ $this->file_src_mime = 'application/vnd.ms-excel.addin.macroEnabled.12';
2716
+ break;
2717
+ case 'pptx':
2718
+ $this->file_src_mime = 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
2719
+ break;
2720
+ case 'pptm':
2721
+ $this->file_src_mime = 'application/vnd.ms-powerpoint.presentation.macroEnabled.12';
2722
+ break;
2723
+ case 'ppsx':
2724
+ $this->file_src_mime = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow';
2725
+ break;
2726
+ case 'ppsm':
2727
+ $this->file_src_mime = 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12';
2728
+ break;
2729
+ case 'potx':
2730
+ $this->file_src_mime = 'application/vnd.openxmlformats-officedocument.presentationml.template';
2731
+ break;
2732
+ case 'potm':
2733
+ $this->file_src_mime = 'application/vnd.ms-powerpoint.template.macroEnabled.12';
2734
+ break;
2735
+ case 'ppam':
2736
+ $this->file_src_mime = 'application/vnd.ms-powerpoint.addin.macroEnabled.12';
2737
+ break;
2738
+ case 'sldx':
2739
+ $this->file_src_mime = 'application/vnd.openxmlformats-officedocument.presentationml.slide';
2740
+ break;
2741
+ case 'sldm':
2742
+ $this->file_src_mime = 'application/vnd.ms-powerpoint.slide.macroEnabled.12';
2743
+ break;
2744
+ case 'thmx':
2745
+ $this->file_src_mime = 'application/vnd.ms-officetheme';
2746
+ break;
2747
+ case 'onetoc':
2748
+ case 'onetoc2':
2749
+ case 'onetmp':
2750
+ case 'onepkg':
2751
+ $this->file_src_mime = 'application/onenote';
2752
+ break;
2753
+ }
2754
+ if ($this->file_src_mime == 'application/octet-stream') {
2755
+ $this->log .= 'doesn\'t look like anything known<br />';
2756
+ } else {
2757
+ $this->log .= 'MIME type set to ' . $this->file_src_mime . '<br />';
2758
+ }
2759
+ }
2760
+
2761
+ if (!$this->file_src_mime || !is_string($this->file_src_mime) || empty($this->file_src_mime) || strpos($this->file_src_mime, '/') === FALSE) {
2762
+ $this->log .= '- MIME type couldn\'t be detected! (' . (string) $this->file_src_mime . ')<br />';
2763
+ }
2764
+
2765
+ // determine whether the file is an image
2766
+ if ($this->file_src_mime && is_string($this->file_src_mime) && !empty($this->file_src_mime) && array_key_exists($this->file_src_mime, $this->image_supported)) {
2767
+ $this->file_is_image = true;
2768
+ $this->image_src_type = $this->image_supported[$this->file_src_mime];
2769
+ }
2770
+
2771
+ // if the file is an image, we gather some useful data
2772
+ if ($this->file_is_image) {
2773
+ if ($h = fopen($this->file_src_pathname, 'r')) {
2774
+ fclose($h);
2775
+ $info = getimagesize($this->file_src_pathname);
2776
+ if (is_array($info)) {
2777
+ $this->image_src_x = $info[0];
2778
+ $this->image_src_y = $info[1];
2779
+ $this->image_dst_x = $this->image_src_x;
2780
+ $this->image_dst_y = $this->image_src_y;
2781
+ $this->image_src_pixels = $this->image_src_x * $this->image_src_y;
2782
+ $this->image_src_bits = array_key_exists('bits', $info) ? $info['bits'] : null;
2783
+ } else {
2784
+ $this->file_is_image = false;
2785
+ $this->uploaded = false;
2786
+ $this->log .= '- can\'t retrieve image information, image may have been tampered with<br />';
2787
+ $this->error = $this->translate('incorrect_file');
2788
+ }
2789
+ } else {
2790
+ $this->log .= '- can\'t read source file directly. open_basedir restriction in place?<br />';
2791
+ }
2792
+ }
2793
+
2794
+ $this->log .= '<b>source variables</b><br />';
2795
+ $this->log .= '- You can use all these before calling process()<br />';
2796
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;file_src_name : ' . $this->file_src_name . '<br />';
2797
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;file_src_name_body : ' . $this->file_src_name_body . '<br />';
2798
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;file_src_name_ext : ' . $this->file_src_name_ext . '<br />';
2799
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;file_src_pathname : ' . $this->file_src_pathname . '<br />';
2800
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;file_src_mime : ' . $this->file_src_mime . '<br />';
2801
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;file_src_size : ' . $this->file_src_size . ' (max= ' . $this->file_max_size . ')<br />';
2802
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;file_src_error : ' . $this->file_src_error . '<br />';
2803
+
2804
+ if ($this->file_is_image) {
2805
+ $this->log .= '- source file is an image<br />';
2806
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;image_src_x : ' . $this->image_src_x . '<br />';
2807
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;image_src_y : ' . $this->image_src_y . '<br />';
2808
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;image_src_pixels : ' . $this->image_src_pixels . '<br />';
2809
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;image_src_type : ' . $this->image_src_type . '<br />';
2810
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;image_src_bits : ' . $this->image_src_bits . '<br />';
2811
+ }
2812
+ }
2813
+
2814
+ }
2815
+
2816
+ /**
2817
+ * Returns the version of GD
2818
+ *
2819
+ * @access public
2820
+ * @param boolean $full Optional flag to get precise version
2821
+ * @return float GD version
2822
+ */
2823
+ function gdversion($full = false) {
2824
+ static $gd_version = null;
2825
+ static $gd_full_version = null;
2826
+ if ($gd_version === null) {
2827
+ if (function_exists('gd_info')) {
2828
+ $gd = gd_info();
2829
+ $gd = $gd["GD Version"];
2830
+ $regex = "/([\d\.]+)/i";
2831
+ } else {
2832
+ ob_start();
2833
+ phpinfo(8);
2834
+ $gd = ob_get_contents();
2835
+ ob_end_clean();
2836
+ $regex = "/\bgd\s+version\b[^\d\n\r]+?([\d\.]+)/i";
2837
+ }
2838
+ if (preg_match($regex, $gd, $m)) {
2839
+ $gd_full_version = (string) $m[1];
2840
+ $gd_version = (float) $m[1];
2841
+ } else {
2842
+ $gd_full_version = 'none';
2843
+ $gd_version = 0;
2844
+ }
2845
+ }
2846
+ if ($full) {
2847
+ return $gd_full_version;
2848
+ } else {
2849
+ return $gd_version;
2850
+ }
2851
+ }
2852
+
2853
+
2854
+ /**
2855
+ * Creates directories recursively
2856
+ *
2857
+ * @access private
2858
+ * @param string $path Path to create
2859
+ * @param integer $mode Optional permissions
2860
+ * @return boolean Success
2861
+ */
2862
+ function rmkdir($path, $mode = 0777) {
2863
+ return is_dir($path) || ( $this->rmkdir(dirname($path), $mode) && $this->_mkdir($path, $mode) );
2864
+ }
2865
+
2866
+
2867
+ /**
2868
+ * Creates directory
2869
+ *
2870
+ * @access private
2871
+ * @param string $path Path to create
2872
+ * @param integer $mode Optional permissions
2873
+ * @return boolean Success
2874
+ */
2875
+ function _mkdir($path, $mode = 0777) {
2876
+ $old = umask(0);
2877
+ $res = @mkdir($path, $mode);
2878
+ umask($old);
2879
+ return $res;
2880
+ }
2881
+
2882
+
2883
+ /**
2884
+ * Translate error messages
2885
+ *
2886
+ * @access private
2887
+ * @param string $str Message to translate
2888
+ * @param array $tokens Optional token values
2889
+ * @return string Translated string
2890
+ */
2891
+ function translate($str, $tokens = array()) {
2892
+ if (array_key_exists($str, $this->translation)) $str = $this->translation[$str];
2893
+ if (is_array($tokens) && sizeof($tokens) > 0) $str = vsprintf($str, $tokens);
2894
+ return $str;
2895
+ }
2896
+
2897
+ /**
2898
+ * Decodes colors
2899
+ *
2900
+ * @access private
2901
+ * @param string $color Color string
2902
+ * @return array RGB colors
2903
+ */
2904
+ function getcolors($color) {
2905
+ $r = sscanf($color, "#%2x%2x%2x");
2906
+ $red = (array_key_exists(0, $r) && is_numeric($r[0]) ? $r[0] : 0);
2907
+ $green = (array_key_exists(1, $r) && is_numeric($r[1]) ? $r[1] : 0);
2908
+ $blue = (array_key_exists(2, $r) && is_numeric($r[2]) ? $r[2] : 0);
2909
+ return array($red, $green, $blue);
2910
+ }
2911
+
2912
+ /**
2913
+ * Creates a container image
2914
+ *
2915
+ * @access private
2916
+ * @param integer $x Width
2917
+ * @param integer $y Height
2918
+ * @param boolean $fill Optional flag to draw the background color or not
2919
+ * @param boolean $trsp Optional flag to set the background to be transparent
2920
+ * @return resource Container image
2921
+ */
2922
+ function imagecreatenew($x, $y, $fill = true, $trsp = false) {
2923
+ if ($x < 1) $x = 1; if ($y < 1) $y = 1;
2924
+ if ($this->gdversion() >= 2 && !$this->image_is_palette) {
2925
+ // create a true color image
2926
+ $dst_im = imagecreatetruecolor($x, $y);
2927
+ // this preserves transparency in PNGs, in true color
2928
+ if (empty($this->image_background_color) || $trsp) {
2929
+ imagealphablending($dst_im, false );
2930
+ imagefilledrectangle($dst_im, 0, 0, $x, $y, imagecolorallocatealpha($dst_im, 0, 0, 0, 127));
2931
+ }
2932
+ } else {
2933
+ // creates a palette image
2934
+ $dst_im = imagecreate($x, $y);
2935
+ // preserves transparency for palette images, if the original image has transparency
2936
+ if (($fill && $this->image_is_transparent && empty($this->image_background_color)) || $trsp) {
2937
+ imagefilledrectangle($dst_im, 0, 0, $x, $y, $this->image_transparent_color);
2938
+ imagecolortransparent($dst_im, $this->image_transparent_color);
2939
+ }
2940
+ }
2941
+ // fills with background color if any is set
2942
+ if ($fill && !empty($this->image_background_color) && !$trsp) {
2943
+ list($red, $green, $blue) = $this->getcolors($this->image_background_color);
2944
+ $background_color = imagecolorallocate($dst_im, $red, $green, $blue);
2945
+ imagefilledrectangle($dst_im, 0, 0, $x, $y, $background_color);
2946
+ }
2947
+ return $dst_im;
2948
+ }
2949
+
2950
+
2951
+ /**
2952
+ * Transfers an image from the container to the destination image
2953
+ *
2954
+ * @access private
2955
+ * @param resource $src_im Container image
2956
+ * @param resource $dst_im Destination image
2957
+ * @return resource Destination image
2958
+ */
2959
+ function imagetransfer($src_im, $dst_im) {
2960
+ if (is_resource($dst_im)) imagedestroy($dst_im);
2961
+ $dst_im = & $src_im;
2962
+ return $dst_im;
2963
+ }
2964
+
2965
+ /**
2966
+ * Merges two images
2967
+ *
2968
+ * If the output format is PNG, then we do it pixel per pixel to retain the alpha channel
2969
+ *
2970
+ * @access private
2971
+ * @param resource $dst_img Destination image
2972
+ * @param resource $src_img Overlay image
2973
+ * @param int $dst_x x-coordinate of destination point
2974
+ * @param int $dst_y y-coordinate of destination point
2975
+ * @param int $src_x x-coordinate of source point
2976
+ * @param int $src_y y-coordinate of source point
2977
+ * @param int $src_w Source width
2978
+ * @param int $src_h Source height
2979
+ * @param int $pct Optional percentage of the overlay, between 0 and 100 (default: 100)
2980
+ * @return resource Destination image
2981
+ */
2982
+ function imagecopymergealpha(&$dst_im, &$src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct = 0) {
2983
+ $dst_x = (int) $dst_x;
2984
+ $dst_y = (int) $dst_y;
2985
+ $src_x = (int) $src_x;
2986
+ $src_y = (int) $src_y;
2987
+ $src_w = (int) $src_w;
2988
+ $src_h = (int) $src_h;
2989
+ $pct = (int) $pct;
2990
+ $dst_w = imagesx($dst_im);
2991
+ $dst_h = imagesy($dst_im);
2992
+
2993
+ for ($y = $src_y; $y < $src_h; $y++) {
2994
+ for ($x = $src_x; $x < $src_w; $x++) {
2995
+
2996
+ if ($x + $dst_x >= 0 && $x + $dst_x < $dst_w && $x + $src_x >= 0 && $x + $src_x < $src_w
2997
+ && $y + $dst_y >= 0 && $y + $dst_y < $dst_h && $y + $src_y >= 0 && $y + $src_y < $src_h) {
2998
+
2999
+ $dst_pixel = imagecolorsforindex($dst_im, imagecolorat($dst_im, $x + $dst_x, $y + $dst_y));
3000
+ $src_pixel = imagecolorsforindex($src_im, imagecolorat($src_im, $x + $src_x, $y + $src_y));
3001
+
3002
+ $src_alpha = 1 - ($src_pixel['alpha'] / 127);
3003
+ $dst_alpha = 1 - ($dst_pixel['alpha'] / 127);
3004
+ $opacity = $src_alpha * $pct / 100;
3005
+ if ($dst_alpha >= $opacity) $alpha = $dst_alpha;
3006
+ if ($dst_alpha < $opacity) $alpha = $opacity;
3007
+ if ($alpha > 1) $alpha = 1;
3008
+
3009
+ if ($opacity > 0) {
3010
+ $dst_red = round(( ($dst_pixel['red'] * $dst_alpha * (1 - $opacity)) ) );
3011
+ $dst_green = round(( ($dst_pixel['green'] * $dst_alpha * (1 - $opacity)) ) );
3012
+ $dst_blue = round(( ($dst_pixel['blue'] * $dst_alpha * (1 - $opacity)) ) );
3013
+ $src_red = round((($src_pixel['red'] * $opacity)) );
3014
+ $src_green = round((($src_pixel['green'] * $opacity)) );
3015
+ $src_blue = round((($src_pixel['blue'] * $opacity)) );
3016
+ $red = round(($dst_red + $src_red ) / ($dst_alpha * (1 - $opacity) + $opacity));
3017
+ $green = round(($dst_green + $src_green) / ($dst_alpha * (1 - $opacity) + $opacity));
3018
+ $blue = round(($dst_blue + $src_blue ) / ($dst_alpha * (1 - $opacity) + $opacity));
3019
+ if ($red > 255) $red = 255;
3020
+ if ($green > 255) $green = 255;
3021
+ if ($blue > 255) $blue = 255;
3022
+ $alpha = round((1 - $alpha) * 127);
3023
+ $color = imagecolorallocatealpha($dst_im, $red, $green, $blue, $alpha);
3024
+ imagesetpixel($dst_im, $x + $dst_x, $y + $dst_y, $color);
3025
+ }
3026
+ }
3027
+ }
3028
+ }
3029
+ return true;
3030
+ }
3031
+
3032
+
3033
+
3034
+ /**
3035
+ * Actually uploads the file, and act on it according to the set processing class variables
3036
+ *
3037
+ * This function copies the uploaded file to the given location, eventually performing actions on it.
3038
+ * Typically, you can call {@link process} several times for the same file,
3039
+ * for instance to create a resized image and a thumbnail of the same file.
3040
+ * The original uploaded file remains intact in its temporary location, so you can use {@link process} several times.
3041
+ * You will be able to delete the uploaded file with {@link clean} when you have finished all your {@link process} calls.
3042
+ *
3043
+ * According to the processing class variables set in the calling file, the file can be renamed,
3044
+ * and if it is an image, can be resized or converted.
3045
+ *
3046
+ * When the processing is completed, and the file copied to its new location, the
3047
+ * processing class variables will be reset to their default value.
3048
+ * This allows you to set new properties, and perform another {@link process} on the same uploaded file
3049
+ *
3050
+ * If the function is called with a null or empty argument, then it will return the content of the picture
3051
+ *
3052
+ * It will set {@link processed} (and {@link error} is an error occurred)
3053
+ *
3054
+ * @access public
3055
+ * @param string $server_path Optional path location of the uploaded file, with an ending slash
3056
+ * @return string Optional content of the image
3057
+ */
3058
+ function process($server_path = null) {
3059
+
3060
+ $this->error = '';
3061
+ $this->processed = true;
3062
+ $return_mode = false;
3063
+ $return_content = null;
3064
+
3065
+ if (!$this->uploaded) {
3066
+ $this->error = $this->translate('file_not_uploaded');
3067
+ $this->processed = false;
3068
+ }
3069
+
3070
+ if ($this->processed) {
3071
+ if (empty($server_path) || is_null($server_path)) {
3072
+ $this->log .= '<b>process file and return the content</b><br />';
3073
+ $return_mode = true;
3074
+ } else {
3075
+ if(strtolower(substr(PHP_OS, 0, 3)) === 'win') {
3076
+ if (substr($server_path, -1, 1) != '\\') $server_path = $server_path . '\\';
3077
+ } else {
3078
+ if (substr($server_path, -1, 1) != '/') $server_path = $server_path . '/';
3079
+ }
3080
+ $this->log .= '<b>process file to ' . $server_path . '</b><br />';
3081
+ }
3082
+ }
3083
+
3084
+ if ($this->processed) {
3085
+ // checks file max size
3086
+ if ($this->file_src_size > $this->file_max_size ) {
3087
+ $this->processed = false;
3088
+ $this->error = $this->translate('file_too_big');
3089
+ } else {
3090
+ $this->log .= '- file size OK<br />';
3091
+ }
3092
+ }
3093
+
3094
+ if ($this->processed) {
3095
+ // turn dangerous scripts into text files
3096
+ if ($this->no_script) {
3097
+ if (((substr($this->file_src_mime, 0, 5) == 'text/' || strpos($this->file_src_mime, 'javascript') !== false) && (substr($this->file_src_name, -4) != '.txt'))
3098
+ || preg_match('/\.(php|pl|py|cgi|asp)$/i', $this->file_src_name) || empty($this->file_src_name_ext)) {
3099
+ $this->file_src_mime = 'text/plain';
3100
+ $this->log .= '- script ' . $this->file_src_name . ' renamed as ' . $this->file_src_name . '.txt!<br />';
3101
+ $this->file_src_name_ext .= (empty($this->file_src_name_ext) ? 'txt' : '.txt');
3102
+ }
3103
+ }
3104
+
3105
+ if ($this->mime_check && empty($this->file_src_mime)) {
3106
+ $this->processed = false;
3107
+ $this->error = $this->translate('no_mime');
3108
+ } else if ($this->mime_check && !empty($this->file_src_mime) && strpos($this->file_src_mime, '/') !== false) {
3109
+ list($m1, $m2) = explode('/', $this->file_src_mime);
3110
+ $allowed = false;
3111
+ // check wether the mime type is allowed
3112
+ foreach($this->allowed as $k => $v) {
3113
+ list($v1, $v2) = explode('/', $v);
3114
+ if (($v1 == '*' && $v2 == '*') || ($v1 == $m1 && ($v2 == $m2 || $v2 == '*'))) {
3115
+ $allowed = true;
3116
+ break;
3117
+ }
3118
+ }
3119
+ // check wether the mime type is forbidden
3120
+ foreach($this->forbidden as $k => $v) {
3121
+ list($v1, $v2) = explode('/', $v);
3122
+ if (($v1 == '*' && $v2 == '*') || ($v1 == $m1 && ($v2 == $m2 || $v2 == '*'))) {
3123
+ $allowed = false;
3124
+ break;
3125
+ }
3126
+ }
3127
+ if (!$allowed) {
3128
+ $this->processed = false;
3129
+ $this->error = $this->translate('incorrect_file');
3130
+ } else {
3131
+ $this->log .= '- file mime OK : ' . $this->file_src_mime . '<br />';
3132
+ }
3133
+ } else {
3134
+ $this->log .= '- file mime (not checked) : ' . $this->file_src_mime . '<br />';
3135
+ }
3136
+
3137
+ // if the file is an image, we can check on its dimensions
3138
+ // these checks are not available if open_basedir restrictions are in place
3139
+ if ($this->file_is_image) {
3140
+ if (is_numeric($this->image_src_x) && is_numeric($this->image_src_y)) {
3141
+ $ratio = $this->image_src_x / $this->image_src_y;
3142
+ if (!is_null($this->image_max_width) && $this->image_src_x > $this->image_max_width) {
3143
+ $this->processed = false;
3144
+ $this->error = $this->translate('image_too_wide');
3145
+ }
3146
+ if (!is_null($this->image_min_width) && $this->image_src_x < $this->image_min_width) {
3147
+ $this->processed = false;
3148
+ $this->error = $this->translate('image_too_narrow');
3149
+ }
3150
+ if (!is_null($this->image_max_height) && $this->image_src_y > $this->image_max_height) {
3151
+ $this->processed = false;
3152
+ $this->error = $this->translate('image_too_high');
3153
+ }
3154
+ if (!is_null($this->image_min_height) && $this->image_src_y < $this->image_min_height) {
3155
+ $this->processed = false;
3156
+ $this->error = $this->translate('image_too_short');
3157
+ }
3158
+ if (!is_null($this->image_max_ratio) && $ratio > $this->image_max_ratio) {
3159
+ $this->processed = false;
3160
+ $this->error = $this->translate('ratio_too_high');
3161
+ }
3162
+ if (!is_null($this->image_min_ratio) && $ratio < $this->image_min_ratio) {
3163
+ $this->processed = false;
3164
+ $this->error = $this->translate('ratio_too_low');
3165
+ }
3166
+ if (!is_null($this->image_max_pixels) && $this->image_src_pixels > $this->image_max_pixels) {
3167
+ $this->processed = false;
3168
+ $this->error = $this->translate('too_many_pixels');
3169
+ }
3170
+ if (!is_null($this->image_min_pixels) && $this->image_src_pixels < $this->image_min_pixels) {
3171
+ $this->processed = false;
3172
+ $this->error = $this->translate('not_enough_pixels');
3173
+ }
3174
+ } else {
3175
+ $this->log .= '- no image properties available, can\'t enforce dimension checks : ' . $this->file_src_mime . '<br />';
3176
+ }
3177
+ }
3178
+ }
3179
+
3180
+ if ($this->processed) {
3181
+ $this->file_dst_path = $server_path;
3182
+
3183
+ // repopulate dst variables from src
3184
+ $this->file_dst_name = $this->file_src_name;
3185
+ $this->file_dst_name_body = $this->file_src_name_body;
3186
+ $this->file_dst_name_ext = $this->file_src_name_ext;
3187
+ if ($this->file_overwrite) $this->file_auto_rename = false;
3188
+
3189
+ if ($this->image_convert != '') { // if we convert as an image
3190
+ $this->file_dst_name_ext = $this->image_convert;
3191
+ $this->log .= '- new file name ext : ' . $this->image_convert . '<br />';
3192
+ }
3193
+ if ($this->file_new_name_body != '') { // rename file body
3194
+ $this->file_dst_name_body = $this->file_new_name_body;
3195
+ $this->log .= '- new file name body : ' . $this->file_new_name_body . '<br />';
3196
+ }
3197
+ if ($this->file_new_name_ext != '') { // rename file ext
3198
+ $this->file_dst_name_ext = $this->file_new_name_ext;
3199
+ $this->log .= '- new file name ext : ' . $this->file_new_name_ext . '<br />';
3200
+ }
3201
+ if ($this->file_name_body_add != '') { // append a string to the name
3202
+ $this->file_dst_name_body = $this->file_dst_name_body . $this->file_name_body_add;
3203
+ $this->log .= '- file name body append : ' . $this->file_name_body_add . '<br />';
3204
+ }
3205
+ if ($this->file_name_body_pre != '') { // prepend a string to the name
3206
+ $this->file_dst_name_body = $this->file_name_body_pre . $this->file_dst_name_body;
3207
+ $this->log .= '- file name body prepend : ' . $this->file_name_body_pre . '<br />';
3208
+ }
3209
+ if ($this->file_safe_name) { // formats the name
3210
+ $this->file_dst_name_body = str_replace(array(' ', '-'), array('_','_'), $this->file_dst_name_body) ;
3211
+ $this->file_dst_name_body = preg_replace('/[^A-Za-z0-9_]/', '', $this->file_dst_name_body) ;
3212
+ $this->log .= '- file name safe format<br />';
3213
+ }
3214
+
3215
+ $this->log .= '- destination variables<br />';
3216
+ if (empty($this->file_dst_path) || is_null($this->file_dst_path)) {
3217
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;file_dst_path : n/a<br />';
3218
+ } else {
3219
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;file_dst_path : ' . $this->file_dst_path . '<br />';
3220
+ }
3221
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;file_dst_name_body : ' . $this->file_dst_name_body . '<br />';
3222
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;file_dst_name_ext : ' . $this->file_dst_name_ext . '<br />';
3223
+
3224
+ // do we do some image manipulation?
3225
+ $image_manipulation = ($this->file_is_image && (
3226
+ $this->image_resize
3227
+ || $this->image_convert != ''
3228
+ || is_numeric($this->image_brightness)
3229
+ || is_numeric($this->image_contrast)
3230
+ || is_numeric($this->image_threshold)
3231
+ || !empty($this->image_tint_color)
3232
+ || !empty($this->image_overlay_color)
3233
+ || !empty($this->image_text)
3234
+ || $this->image_greyscale
3235
+ || $this->image_negative
3236
+ || !empty($this->image_watermark)
3237
+ || is_numeric($this->image_rotate)
3238
+ || is_numeric($this->jpeg_size)
3239
+ || !empty($this->image_flip)
3240
+ || !empty($this->image_crop)
3241
+ || !empty($this->image_precrop)
3242
+ || !empty($this->image_border)
3243
+ || $this->image_frame > 0
3244
+ || $this->image_bevel > 0
3245
+ || $this->image_reflection_height));
3246
+
3247
+ if ($image_manipulation) {
3248
+ if ($this->image_convert=='') {
3249
+ $this->file_dst_name = $this->file_dst_name_body . (!empty($this->file_dst_name_ext) ? '.' . $this->file_dst_name_ext : '');
3250
+ $this->log .= '- image operation, keep extension<br />';
3251
+ } else {
3252
+ $this->file_dst_name = $this->file_dst_name_body . '.' . $this->image_convert;
3253
+ $this->log .= '- image operation, change extension for conversion type<br />';
3254
+ }
3255
+ } else {
3256
+ $this->file_dst_name = $this->file_dst_name_body . (!empty($this->file_dst_name_ext) ? '.' . $this->file_dst_name_ext : '');
3257
+ $this->log .= '- no image operation, keep extension<br />';
3258
+ }
3259
+
3260
+ if (!$return_mode) {
3261
+ if (!$this->file_auto_rename) {
3262
+ $this->log .= '- no auto_rename if same filename exists<br />';
3263
+ $this->file_dst_pathname = $this->file_dst_path . $this->file_dst_name;
3264
+ } else {
3265
+ $this->log .= '- checking for auto_rename<br />';
3266
+ $this->file_dst_pathname = $this->file_dst_path . $this->file_dst_name;
3267
+ $body = $this->file_dst_name_body;
3268
+ $cpt = 1;
3269
+ while (@file_exists($this->file_dst_pathname)) {
3270
+ $this->file_dst_name_body = $body . '_' . $cpt;
3271
+ $this->file_dst_name = $this->file_dst_name_body . (!empty($this->file_dst_name_ext) ? '.' . $this->file_dst_name_ext : '');
3272
+ $cpt++;
3273
+ $this->file_dst_pathname = $this->file_dst_path . $this->file_dst_name;
3274
+ }
3275
+ if ($cpt>1) $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;auto_rename to ' . $this->file_dst_name . '<br />';
3276
+ }
3277
+
3278
+ $this->log .= '- destination file details<br />';
3279
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;file_dst_name : ' . $this->file_dst_name . '<br />';
3280
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;file_dst_pathname : ' . $this->file_dst_pathname . '<br />';
3281
+
3282
+ if ($this->file_overwrite) {
3283
+ $this->log .= '- no overwrite checking<br />';
3284
+ } else {
3285
+ if (@file_exists($this->file_dst_pathname)) {
3286
+ $this->processed = false;
3287
+ $this->error = $this->translate('already_exists', array($this->file_dst_name));
3288
+ } else {
3289
+ $this->log .= '- ' . $this->file_dst_name . ' doesn\'t exist already<br />';
3290
+ }
3291
+ }
3292
+ }
3293
+ }
3294
+
3295
+ if ($this->processed) {
3296
+ // if we have already moved the uploaded file, we use the temporary copy as source file, and check if it exists
3297
+ if (!empty($this->file_src_temp)) {
3298
+ $this->log .= '- use the temp file instead of the original file since it is a second process<br />';
3299
+ $this->file_src_pathname = $this->file_src_temp;
3300
+ if (!file_exists($this->file_src_pathname)) {
3301
+ $this->processed = false;
3302
+ $this->error = $this->translate('temp_file_missing');
3303
+ }
3304
+ // if we haven't a temp file, and that we do check on uploads, we use is_uploaded_file()
3305
+ } else if (!$this->no_upload_check) {
3306
+ if (!is_uploaded_file($this->file_src_pathname)) {
3307
+ $this->processed = false;
3308
+ $this->error = $this->translate('source_missing');
3309
+ }
3310
+ // otherwise, if we don't check on uploaded files (local file for instance), we use file_exists()
3311
+ } else {
3312
+ if (!file_exists($this->file_src_pathname)) {
3313
+ $this->processed = false;
3314
+ $this->error = $this->translate('source_missing');
3315
+ }
3316
+ }
3317
+
3318
+ // checks if the destination directory exists, and attempt to create it
3319
+ if (!$return_mode) {
3320
+ if ($this->processed && !file_exists($this->file_dst_path)) {
3321
+ if ($this->dir_auto_create) {
3322
+ $this->log .= '- ' . $this->file_dst_path . ' doesn\'t exist. Attempting creation:';
3323
+ if (!$this->rmkdir($this->file_dst_path, $this->dir_chmod)) {
3324
+ $this->log .= ' failed<br />';
3325
+ $this->processed = false;
3326
+ $this->error = $this->translate('destination_dir');
3327
+ } else {
3328
+ $this->log .= ' success<br />';
3329
+ }
3330
+ } else {
3331
+ $this->error = $this->translate('destination_dir_missing');
3332
+ }
3333
+ }
3334
+
3335
+ if ($this->processed && !is_dir($this->file_dst_path)) {
3336
+ $this->processed = false;
3337
+ $this->error = $this->translate('destination_path_not_dir');
3338
+ }
3339
+
3340
+ // checks if the destination directory is writeable, and attempt to make it writeable
3341
+ $hash = md5($this->file_dst_name_body . rand(1, 1000));
3342
+ if ($this->processed && !($f = @fopen($this->file_dst_path . $hash . '.' . $this->file_dst_name_ext, 'a+'))) {
3343
+ if ($this->dir_auto_chmod) {
3344
+ $this->log .= '- ' . $this->file_dst_path . ' is not writeable. Attempting chmod:';
3345
+ if (!@chmod($this->file_dst_path, $this->dir_chmod)) {
3346
+ $this->log .= ' failed<br />';
3347
+ $this->processed = false;
3348
+ $this->error = $this->translate('destination_dir_write');
3349
+ } else {
3350
+ $this->log .= ' success<br />';
3351
+ if (!($f = @fopen($this->file_dst_path . $hash . '.' . $this->file_dst_name_ext, 'a+'))) { // we re-check
3352
+ $this->processed = false;
3353
+ $this->error = $this->translate('destination_dir_write');
3354
+ } else {
3355
+ @fclose($f);
3356
+ }
3357
+ }
3358
+ } else {
3359
+ $this->processed = false;
3360
+ $this->error = $this->translate('destination_path_write');
3361
+ }
3362
+ } else {
3363
+ if ($this->processed) @fclose($f);
3364
+ @unlink($this->file_dst_path . $hash . '.' . $this->file_dst_name_ext);
3365
+ }
3366
+
3367
+
3368
+ // if we have an uploaded file, and if it is the first process, and if we can't access the file directly (open_basedir restriction)
3369
+ // then we create a temp file that will be used as the source file in subsequent processes
3370
+ // the third condition is there to check if the file is not accessible *directly* (it already has positively gone through is_uploaded_file(), so it exists)
3371
+ if (!$this->no_upload_check && empty($this->file_src_temp) && !@file_exists($this->file_src_pathname)) {
3372
+ $this->log .= '- attempting to use a temp file:';
3373
+ $hash = md5($this->file_dst_name_body . rand(1, 1000));
3374
+ if (move_uploaded_file($this->file_src_pathname, $this->file_dst_path . $hash . '.' . $this->file_dst_name_ext)) {
3375
+ $this->file_src_pathname = $this->file_dst_path . $hash . '.' . $this->file_dst_name_ext;
3376
+ $this->file_src_temp = $this->file_src_pathname;
3377
+ $this->log .= ' file created<br />';
3378
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;temp file is: ' . $this->file_src_temp . '<br />';
3379
+ } else {
3380
+ $this->log .= ' failed<br />';
3381
+ $this->processed = false;
3382
+ $this->error = $this->translate('temp_file');
3383
+ }
3384
+ }
3385
+ }
3386
+ }
3387
+
3388
+ if ($this->processed) {
3389
+
3390
+ // we do a quick check to ensure the file is really an image
3391
+ // we can do this only now, as it would have failed before in case of open_basedir
3392
+ if ($image_manipulation && !@getimagesize($this->file_src_pathname)) {
3393
+ $this->log .= '- the file is not an image!<br />';
3394
+ $image_manipulation = false;
3395
+ }
3396
+
3397
+ if ($image_manipulation) {
3398
+
3399
+ // checks if the source file is readable
3400
+ if ($this->processed && !($f = @fopen($this->file_src_pathname, 'r'))) {
3401
+ $this->processed = false;
3402
+ $this->error = $this->translate('source_not_readable');
3403
+ } else {
3404
+ @fclose($f);
3405
+ }
3406
+
3407
+ // we now do all the image manipulations
3408
+ $this->log .= '- image resizing or conversion wanted<br />';
3409
+ if ($this->gdversion()) {
3410
+ switch($this->image_src_type) {
3411
+ case 'jpg':
3412
+ if (!function_exists('imagecreatefromjpeg')) {
3413
+ $this->processed = false;
3414
+ $this->error = $this->translate('no_create_support', array('JPEG'));
3415
+ } else {
3416
+ $image_src = @imagecreatefromjpeg($this->file_src_pathname);
3417
+ if (!$image_src) {
3418
+ $this->processed = false;
3419
+ $this->error = $this->translate('create_error', array('JPEG'));
3420
+ } else {
3421
+ $this->log .= '- source image is JPEG<br />';
3422
+ }
3423
+ }
3424
+ break;
3425
+ case 'png':
3426
+ if (!function_exists('imagecreatefrompng')) {
3427
+ $this->processed = false;
3428
+ $this->error = $this->translate('no_create_support', array('PNG'));
3429
+ } else {
3430
+ $image_src = @imagecreatefrompng($this->file_src_pathname);
3431
+ if (!$image_src) {
3432
+ $this->processed = false;
3433
+ $this->error = $this->translate('create_error', array('PNG'));
3434
+ } else {
3435
+ $this->log .= '- source image is PNG<br />';
3436
+ }
3437
+ }
3438
+ break;
3439
+ case 'gif':
3440
+ if (!function_exists('imagecreatefromgif')) {
3441
+ $this->processed = false;
3442
+ $this->error = $this->translate('no_create_support', array('GIF'));
3443
+ } else {
3444
+ $image_src = @imagecreatefromgif($this->file_src_pathname);
3445
+ if (!$image_src) {
3446
+ $this->processed = false;
3447
+ $this->error = $this->translate('create_error', array('GIF'));
3448
+ } else {
3449
+ $this->log .= '- source image is GIF<br />';
3450
+ }
3451
+ }
3452
+ break;
3453
+ case 'bmp':
3454
+ if (!method_exists($this, 'imagecreatefrombmp')) {
3455
+ $this->processed = false;
3456
+ $this->error = $this->translate('no_create_support', array('BMP'));
3457
+ } else {
3458
+ $image_src = @$this->imagecreatefrombmp($this->file_src_pathname);
3459
+ if (!$image_src) {
3460
+ $this->processed = false;
3461
+ $this->error = $this->translate('create_error', array('BMP'));
3462
+ } else {
3463
+ $this->log .= '- source image is BMP<br />';
3464
+ }
3465
+ }
3466
+ break;
3467
+ default:
3468
+ $this->processed = false;
3469
+ $this->error = $this->translate('source_invalid');
3470
+ }
3471
+ } else {
3472
+ $this->processed = false;
3473
+ $this->error = $this->translate('gd_missing');
3474
+ }
3475
+
3476
+ if ($this->processed && $image_src) {
3477
+
3478
+ // we have to set image_convert if it is not already
3479
+ if (empty($this->image_convert)) {
3480
+ $this->log .= '- setting destination file type to ' . $this->file_src_name_ext . '<br />';
3481
+ $this->image_convert = $this->file_src_name_ext;
3482
+ }
3483
+
3484
+ if (!in_array($this->image_convert, $this->image_supported)) {
3485
+ $this->image_convert = 'jpg';
3486
+ }
3487
+
3488
+ // we set the default color to be the background color if we don't output in a transparent format
3489
+ if ($this->image_convert != 'png' && $this->image_convert != 'gif' && !empty($this->image_default_color) && empty($this->image_background_color)) $this->image_background_color = $this->image_default_color;
3490
+ if (!empty($this->image_background_color)) $this->image_default_color = $this->image_background_color;
3491
+ if (empty($this->image_default_color)) $this->image_default_color = '#FFFFFF';
3492
+
3493
+ $this->image_src_x = imagesx($image_src);
3494
+ $this->image_src_y = imagesy($image_src);
3495
+ $gd_version = $this->gdversion();
3496
+ $ratio_crop = null;
3497
+
3498
+ if (!imageistruecolor($image_src)) { // $this->image_src_type == 'gif'
3499
+ $this->log .= '- image is detected as having a palette<br />';
3500
+ $this->image_is_palette = true;
3501
+ $this->image_transparent_color = imagecolortransparent($image_src);
3502
+ if ($this->image_transparent_color >= 0 && imagecolorstotal($image_src) > $this->image_transparent_color) {
3503
+ $this->image_is_transparent = true;
3504
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;palette image is detected as transparent<br />';
3505
+ }
3506
+ // if the image has a palette (GIF), we convert it to true color, preserving transparency
3507
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;convert palette image to true color<br />';
3508
+ $true_color = imagecreatetruecolor($this->image_src_x, $this->image_src_y);
3509
+ imagealphablending($true_color, false);
3510
+ imagesavealpha($true_color, true);
3511
+ for ($x = 0; $x < $this->image_src_x; $x++) {
3512
+ for ($y = 0; $y < $this->image_src_y; $y++) {
3513
+ if ($this->image_transparent_color >= 0 && imagecolorat($image_src, $x, $y) == $this->image_transparent_color) {
3514
+ imagesetpixel($true_color, $x, $y, 127 << 24);
3515
+ } else {
3516
+ $rgb = imagecolorsforindex($image_src, imagecolorat($image_src, $x, $y));
3517
+ imagesetpixel($true_color, $x, $y, ($rgb['alpha'] << 24) | ($rgb['red'] << 16) | ($rgb['green'] << 8) | $rgb['blue']);
3518
+ }
3519
+ }
3520
+ }
3521
+ $image_src = $this->imagetransfer($true_color, $image_src);
3522
+ imagealphablending($image_src, false);
3523
+ imagesavealpha($image_src, true);
3524
+ $this->image_is_palette = false;
3525
+ }
3526
+
3527
+
3528
+ $image_dst = & $image_src;
3529
+
3530
+ // pre-crop image, before resizing
3531
+ if ((!empty($this->image_precrop))) {
3532
+ if (is_array($this->image_precrop)) {
3533
+ $vars = $this->image_precrop;
3534
+ } else {
3535
+ $vars = explode(' ', $this->image_precrop);
3536
+ }
3537
+ if (sizeof($vars) == 4) {
3538
+ $ct = $vars[0]; $cr = $vars[1]; $cb = $vars[2]; $cl = $vars[3];
3539
+ } else if (sizeof($vars) == 2) {
3540
+ $ct = $vars[0]; $cr = $vars[1]; $cb = $vars[0]; $cl = $vars[1];
3541
+ } else {
3542
+ $ct = $vars[0]; $cr = $vars[0]; $cb = $vars[0]; $cl = $vars[0];
3543
+ }
3544
+ if (strpos($ct, '%')>0) $ct = $this->image_src_y * (str_replace('%','',$ct) / 100);
3545
+ if (strpos($cr, '%')>0) $cr = $this->image_src_x * (str_replace('%','',$cr) / 100);
3546
+ if (strpos($cb, '%')>0) $cb = $this->image_src_y * (str_replace('%','',$cb) / 100);
3547
+ if (strpos($cl, '%')>0) $cl = $this->image_src_x * (str_replace('%','',$cl) / 100);
3548
+ if (strpos($ct, 'px')>0) $ct = str_replace('px','',$ct);
3549
+ if (strpos($cr, 'px')>0) $cr = str_replace('px','',$cr);
3550
+ if (strpos($cb, 'px')>0) $cb = str_replace('px','',$cb);
3551
+ if (strpos($cl, 'px')>0) $cl = str_replace('px','',$cl);
3552
+ $ct = (int) $ct;
3553
+ $cr = (int) $cr;
3554
+ $cb = (int) $cb;
3555
+ $cl = (int) $cl;
3556
+ $this->log .= '- pre-crop image : ' . $ct . ' ' . $cr . ' ' . $cb . ' ' . $cl . ' <br />';
3557
+ $this->image_src_x = $this->image_src_x - $cl - $cr;
3558
+ $this->image_src_y = $this->image_src_y - $ct - $cb;
3559
+ if ($this->image_src_x < 1) $this->image_src_x = 1;
3560
+ if ($this->image_src_y < 1) $this->image_src_y = 1;
3561
+ $tmp = $this->imagecreatenew($this->image_src_x, $this->image_src_y);
3562
+
3563
+ // we copy the image into the recieving image
3564
+ imagecopy($tmp, $image_dst, 0, 0, $cl, $ct, $this->image_src_x, $this->image_src_y);
3565
+
3566
+ // if we crop with negative margins, we have to make sure the extra bits are the right color, or transparent
3567
+ if ($ct < 0 || $cr < 0 || $cb < 0 || $cl < 0 ) {
3568
+ // use the background color if present
3569
+ if (!empty($this->image_background_color)) {
3570
+ list($red, $green, $blue) = $this->getcolors($this->image_background_color);
3571
+ $fill = imagecolorallocate($tmp, $red, $green, $blue);
3572
+ } else {
3573
+ $fill = imagecolorallocatealpha($tmp, 0, 0, 0, 127);
3574
+ }
3575
+ // fills eventual negative margins
3576
+ if ($ct < 0) imagefilledrectangle($tmp, 0, 0, $this->image_src_x, -$ct, $fill);
3577
+ if ($cr < 0) imagefilledrectangle($tmp, $this->image_src_x + $cr, 0, $this->image_src_x, $this->image_src_y, $fill);
3578
+ if ($cb < 0) imagefilledrectangle($tmp, 0, $this->image_src_y + $cb, $this->image_src_x, $this->image_src_y, $fill);
3579
+ if ($cl < 0) imagefilledrectangle($tmp, 0, 0, -$cl, $this->image_src_y, $fill);
3580
+ }
3581
+
3582
+ // we transfert tmp into image_dst
3583
+ $image_dst = $this->imagetransfer($tmp, $image_dst);
3584
+ }
3585
+
3586
+ // resize image (and move image_src_x, image_src_y dimensions into image_dst_x, image_dst_y)
3587
+ if ($this->image_resize) {
3588
+ $this->log .= '- resizing...<br />';
3589
+
3590
+ if ($this->image_ratio_x) {
3591
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;calculate x size<br />';
3592
+ $this->image_dst_x = round(($this->image_src_x * $this->image_y) / $this->image_src_y);
3593
+ $this->image_dst_y = $this->image_y;
3594
+ } else if ($this->image_ratio_y) {
3595
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;calculate y size<br />';
3596
+ $this->image_dst_x = $this->image_x;
3597
+ $this->image_dst_y = round(($this->image_src_y * $this->image_x) / $this->image_src_x);
3598
+ } else if (is_numeric($this->image_ratio_pixels)) {
3599
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;calculate x/y size to match a number of pixels<br />';
3600
+ $pixels = $this->image_src_y * $this->image_src_x;
3601
+ $diff = sqrt($this->image_ratio_pixels / $pixels);
3602
+ $this->image_dst_x = round($this->image_src_x * $diff);
3603
+ $this->image_dst_y = round($this->image_src_y * $diff);
3604
+ } else if ($this->image_ratio || $this->image_ratio_crop || $this->image_ratio_fill || $this->image_ratio_no_zoom_in || $this->image_ratio_no_zoom_out) {
3605
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;check x/y sizes<br />';
3606
+ if ((!$this->image_ratio_no_zoom_in && !$this->image_ratio_no_zoom_out)
3607
+ || ($this->image_ratio_no_zoom_in && ($this->image_src_x > $this->image_x || $this->image_src_y > $this->image_y))
3608
+ || ($this->image_ratio_no_zoom_out && $this->image_src_x < $this->image_x && $this->image_src_y < $this->image_y)) {
3609
+ $this->image_dst_x = $this->image_x;
3610
+ $this->image_dst_y = $this->image_y;
3611
+ if ($this->image_ratio_crop) {
3612
+ if (!is_string($this->image_ratio_crop)) $this->image_ratio_crop = '';
3613
+ $this->image_ratio_crop = strtolower($this->image_ratio_crop);
3614
+ if (($this->image_src_x/$this->image_x) > ($this->image_src_y/$this->image_y)) {
3615
+ $this->image_dst_y = $this->image_y;
3616
+ $this->image_dst_x = intval($this->image_src_x*($this->image_y / $this->image_src_y));
3617
+ $ratio_crop = array();
3618
+ $ratio_crop['x'] = $this->image_dst_x - $this->image_x;
3619
+ if (strpos($this->image_ratio_crop, 'l') !== false) {
3620
+ $ratio_crop['l'] = 0;
3621
+ $ratio_crop['r'] = $ratio_crop['x'];
3622
+ } else if (strpos($this->image_ratio_crop, 'r') !== false) {
3623
+ $ratio_crop['l'] = $ratio_crop['x'];
3624
+ $ratio_crop['r'] = 0;
3625
+ } else {
3626
+ $ratio_crop['l'] = round($ratio_crop['x']/2);
3627
+ $ratio_crop['r'] = $ratio_crop['x'] - $ratio_crop['l'];
3628
+ }
3629
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;ratio_crop_x : ' . $ratio_crop['x'] . ' (' . $ratio_crop['l'] . ';' . $ratio_crop['r'] . ')<br />';
3630
+ if (is_null($this->image_crop)) $this->image_crop = array(0, 0, 0, 0);
3631
+ } else {
3632
+ $this->image_dst_x = $this->image_x;
3633
+ $this->image_dst_y = intval($this->image_src_y*($this->image_x / $this->image_src_x));
3634
+ $ratio_crop = array();
3635
+ $ratio_crop['y'] = $this->image_dst_y - $this->image_y;
3636
+ if (strpos($this->image_ratio_crop, 't') !== false) {
3637
+ $ratio_crop['t'] = 0;
3638
+ $ratio_crop['b'] = $ratio_crop['y'];
3639
+ } else if (strpos($this->image_ratio_crop, 'b') !== false) {
3640
+ $ratio_crop['t'] = $ratio_crop['y'];
3641
+ $ratio_crop['b'] = 0;
3642
+ } else {
3643
+ $ratio_crop['t'] = round($ratio_crop['y']/2);
3644
+ $ratio_crop['b'] = $ratio_crop['y'] - $ratio_crop['t'];
3645
+ }
3646
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;ratio_crop_y : ' . $ratio_crop['y'] . ' (' . $ratio_crop['t'] . ';' . $ratio_crop['b'] . ')<br />';
3647
+ if (is_null($this->image_crop)) $this->image_crop = array(0, 0, 0, 0);
3648
+ }
3649
+ } else if ($this->image_ratio_fill) {
3650
+ if (!is_string($this->image_ratio_fill)) $this->image_ratio_fill = '';
3651
+ $this->image_ratio_fill = strtolower($this->image_ratio_fill);
3652
+ if (($this->image_src_x/$this->image_x) < ($this->image_src_y/$this->image_y)) {
3653
+ $this->image_dst_y = $this->image_y;
3654
+ $this->image_dst_x = intval($this->image_src_x*($this->image_y / $this->image_src_y));
3655
+ $ratio_crop = array();
3656
+ $ratio_crop['x'] = $this->image_dst_x - $this->image_x;
3657
+ if (strpos($this->image_ratio_fill, 'l') !== false) {
3658
+ $ratio_crop['l'] = 0;
3659
+ $ratio_crop['r'] = $ratio_crop['x'];
3660
+ } else if (strpos($this->image_ratio_fill, 'r') !== false) {
3661
+ $ratio_crop['l'] = $ratio_crop['x'];
3662
+ $ratio_crop['r'] = 0;
3663
+ } else {
3664
+ $ratio_crop['l'] = round($ratio_crop['x']/2);
3665
+ $ratio_crop['r'] = $ratio_crop['x'] - $ratio_crop['l'];
3666
+ }
3667
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;ratio_fill_x : ' . $ratio_crop['x'] . ' (' . $ratio_crop['l'] . ';' . $ratio_crop['r'] . ')<br />';
3668
+ if (is_null($this->image_crop)) $this->image_crop = array(0, 0, 0, 0);
3669
+ } else {
3670
+ $this->image_dst_x = $this->image_x;
3671
+ $this->image_dst_y = intval($this->image_src_y*($this->image_x / $this->image_src_x));
3672
+ $ratio_crop = array();
3673
+ $ratio_crop['y'] = $this->image_dst_y - $this->image_y;
3674
+ if (strpos($this->image_ratio_fill, 't') !== false) {
3675
+ $ratio_crop['t'] = 0;
3676
+ $ratio_crop['b'] = $ratio_crop['y'];
3677
+ } else if (strpos($this->image_ratio_fill, 'b') !== false) {
3678
+ $ratio_crop['t'] = $ratio_crop['y'];
3679
+ $ratio_crop['b'] = 0;
3680
+ } else {
3681
+ $ratio_crop['t'] = round($ratio_crop['y']/2);
3682
+ $ratio_crop['b'] = $ratio_crop['y'] - $ratio_crop['t'];
3683
+ }
3684
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;ratio_fill_y : ' . $ratio_crop['y'] . ' (' . $ratio_crop['t'] . ';' . $ratio_crop['b'] . ')<br />';
3685
+ if (is_null($this->image_crop)) $this->image_crop = array(0, 0, 0, 0);
3686
+ }
3687
+ } else {
3688
+ if (($this->image_src_x/$this->image_x) > ($this->image_src_y/$this->image_y)) {
3689
+ $this->image_dst_x = $this->image_x;
3690
+ $this->image_dst_y = intval($this->image_src_y*($this->image_x / $this->image_src_x));
3691
+ } else {
3692
+ $this->image_dst_y = $this->image_y;
3693
+ $this->image_dst_x = intval($this->image_src_x*($this->image_y / $this->image_src_y));
3694
+ }
3695
+ }
3696
+ } else {
3697
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;doesn\'t calculate x/y sizes<br />';
3698
+ $this->image_dst_x = $this->image_src_x;
3699
+ $this->image_dst_y = $this->image_src_y;
3700
+ }
3701
+ } else {
3702
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;use plain sizes<br />';
3703
+ $this->image_dst_x = $this->image_x;
3704
+ $this->image_dst_y = $this->image_y;
3705
+ }
3706
+
3707
+ if ($this->image_dst_x < 1) $this->image_dst_x = 1;
3708
+ if ($this->image_dst_y < 1) $this->image_dst_y = 1;
3709
+ $tmp = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y);
3710
+
3711
+ if ($gd_version >= 2) {
3712
+ $res = imagecopyresampled($tmp, $image_src, 0, 0, 0, 0, $this->image_dst_x, $this->image_dst_y, $this->image_src_x, $this->image_src_y);
3713
+ } else {
3714
+ $res = imagecopyresized($tmp, $image_src, 0, 0, 0, 0, $this->image_dst_x, $this->image_dst_y, $this->image_src_x, $this->image_src_y);
3715
+ }
3716
+
3717
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;resized image object created<br />';
3718
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;image_src_x y : ' . $this->image_src_x . ' x ' . $this->image_src_y . '<br />';
3719
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;image_dst_x y : ' . $this->image_dst_x . ' x ' . $this->image_dst_y . '<br />';
3720
+ // we transfert tmp into image_dst
3721
+ $image_dst = $this->imagetransfer($tmp, $image_dst);
3722
+
3723
+ } else {
3724
+ $this->image_dst_x = $this->image_src_x;
3725
+ $this->image_dst_y = $this->image_src_y;
3726
+ }
3727
+
3728
+ // crop image (and also crops if image_ratio_crop is used)
3729
+ if ((!empty($this->image_crop) || !is_null($ratio_crop))) {
3730
+ if (is_array($this->image_crop)) {
3731
+ $vars = $this->image_crop;
3732
+ } else {
3733
+ $vars = explode(' ', $this->image_crop);
3734
+ }
3735
+ if (sizeof($vars) == 4) {
3736
+ $ct = $vars[0]; $cr = $vars[1]; $cb = $vars[2]; $cl = $vars[3];
3737
+ } else if (sizeof($vars) == 2) {
3738
+ $ct = $vars[0]; $cr = $vars[1]; $cb = $vars[0]; $cl = $vars[1];
3739
+ } else {
3740
+ $ct = $vars[0]; $cr = $vars[0]; $cb = $vars[0]; $cl = $vars[0];
3741
+ }
3742
+ if (strpos($ct, '%')>0) $ct = $this->image_dst_y * (str_replace('%','',$ct) / 100);
3743
+ if (strpos($cr, '%')>0) $cr = $this->image_dst_x * (str_replace('%','',$cr) / 100);
3744
+ if (strpos($cb, '%')>0) $cb = $this->image_dst_y * (str_replace('%','',$cb) / 100);
3745
+ if (strpos($cl, '%')>0) $cl = $this->image_dst_x * (str_replace('%','',$cl) / 100);
3746
+ if (strpos($ct, 'px')>0) $ct = str_replace('px','',$ct);
3747
+ if (strpos($cr, 'px')>0) $cr = str_replace('px','',$cr);
3748
+ if (strpos($cb, 'px')>0) $cb = str_replace('px','',$cb);
3749
+ if (strpos($cl, 'px')>0) $cl = str_replace('px','',$cl);
3750
+ $ct = (int) $ct;
3751
+ $cr = (int) $cr;
3752
+ $cb = (int) $cb;
3753
+ $cl = (int) $cl;
3754
+ // we adjust the cropping if we use image_ratio_crop
3755
+ if (!is_null($ratio_crop)) {
3756
+ if (array_key_exists('t', $ratio_crop)) $ct += $ratio_crop['t'];
3757
+ if (array_key_exists('r', $ratio_crop)) $cr += $ratio_crop['r'];
3758
+ if (array_key_exists('b', $ratio_crop)) $cb += $ratio_crop['b'];
3759
+ if (array_key_exists('l', $ratio_crop)) $cl += $ratio_crop['l'];
3760
+ }
3761
+ $this->log .= '- crop image : ' . $ct . ' ' . $cr . ' ' . $cb . ' ' . $cl . ' <br />';
3762
+ $this->image_dst_x = $this->image_dst_x - $cl - $cr;
3763
+ $this->image_dst_y = $this->image_dst_y - $ct - $cb;
3764
+ if ($this->image_dst_x < 1) $this->image_dst_x = 1;
3765
+ if ($this->image_dst_y < 1) $this->image_dst_y = 1;
3766
+ $tmp = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y);
3767
+
3768
+ // we copy the image into the recieving image
3769
+ imagecopy($tmp, $image_dst, 0, 0, $cl, $ct, $this->image_dst_x, $this->image_dst_y);
3770
+
3771
+ // if we crop with negative margins, we have to make sure the extra bits are the right color, or transparent
3772
+ if ($ct < 0 || $cr < 0 || $cb < 0 || $cl < 0 ) {
3773
+ // use the background color if present
3774
+ if (!empty($this->image_background_color)) {
3775
+ list($red, $green, $blue) = $this->getcolors($this->image_background_color);
3776
+ $fill = imagecolorallocate($tmp, $red, $green, $blue);
3777
+ } else {
3778
+ $fill = imagecolorallocatealpha($tmp, 0, 0, 0, 127);
3779
+ }
3780
+ // fills eventual negative margins
3781
+ if ($ct < 0) imagefilledrectangle($tmp, 0, 0, $this->image_dst_x, -$ct, $fill);
3782
+ if ($cr < 0) imagefilledrectangle($tmp, $this->image_dst_x + $cr, 0, $this->image_dst_x, $this->image_dst_y, $fill);
3783
+ if ($cb < 0) imagefilledrectangle($tmp, 0, $this->image_dst_y + $cb, $this->image_dst_x, $this->image_dst_y, $fill);
3784
+ if ($cl < 0) imagefilledrectangle($tmp, 0, 0, -$cl, $this->image_dst_y, $fill);
3785
+ }
3786
+
3787
+ // we transfert tmp into image_dst
3788
+ $image_dst = $this->imagetransfer($tmp, $image_dst);
3789
+ }
3790
+
3791
+ // flip image
3792
+ if ($gd_version >= 2 && !empty($this->image_flip)) {
3793
+ $this->image_flip = strtolower($this->image_flip);
3794
+ $this->log .= '- flip image : ' . $this->image_flip . '<br />';
3795
+ $tmp = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y);
3796
+ for ($x = 0; $x < $this->image_dst_x; $x++) {
3797
+ for ($y = 0; $y < $this->image_dst_y; $y++){
3798
+ if (strpos($this->image_flip, 'v') !== false) {
3799
+ imagecopy($tmp, $image_dst, $this->image_dst_x - $x - 1, $y, $x, $y, 1, 1);
3800
+ } else {
3801
+ imagecopy($tmp, $image_dst, $x, $this->image_dst_y - $y - 1, $x, $y, 1, 1);
3802
+ }
3803
+ }
3804
+ }
3805
+ // we transfert tmp into image_dst
3806
+ $image_dst = $this->imagetransfer($tmp, $image_dst);
3807
+ }
3808
+
3809
+ // rotate image
3810
+ if ($gd_version >= 2 && is_numeric($this->image_rotate)) {
3811
+ if (!in_array($this->image_rotate, array(0, 90, 180, 270))) $this->image_rotate = 0;
3812
+ if ($this->image_rotate != 0) {
3813
+ if ($this->image_rotate == 90 || $this->image_rotate == 270) {
3814
+ $tmp = $this->imagecreatenew($this->image_dst_y, $this->image_dst_x);
3815
+ } else {
3816
+ $tmp = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y);
3817
+ }
3818
+ $this->log .= '- rotate image : ' . $this->image_rotate . '<br />';
3819
+ for ($x = 0; $x < $this->image_dst_x; $x++) {
3820
+ for ($y = 0; $y < $this->image_dst_y; $y++){
3821
+ if ($this->image_rotate == 90) {
3822
+ imagecopy($tmp, $image_dst, $y, $x, $x, $this->image_dst_y - $y - 1, 1, 1);
3823
+ } else if ($this->image_rotate == 180) {
3824
+ imagecopy($tmp, $image_dst, $x, $y, $this->image_dst_x - $x - 1, $this->image_dst_y - $y - 1, 1, 1);
3825
+ } else if ($this->image_rotate == 270) {
3826
+ imagecopy($tmp, $image_dst, $y, $x, $this->image_dst_x - $x - 1, $y, 1, 1);
3827
+ } else {
3828
+ imagecopy($tmp, $image_dst, $x, $y, $x, $y, 1, 1);
3829
+ }
3830
+ }
3831
+ }
3832
+ if ($this->image_rotate == 90 || $this->image_rotate == 270) {
3833
+ $t = $this->image_dst_y;
3834
+ $this->image_dst_y = $this->image_dst_x;
3835
+ $this->image_dst_x = $t;
3836
+ }
3837
+ // we transfert tmp into image_dst
3838
+ $image_dst = $this->imagetransfer($tmp, $image_dst);
3839
+ }
3840
+ }
3841
+
3842
+ // add color overlay
3843
+ if ($gd_version >= 2 && (is_numeric($this->image_overlay_percent) && $this->image_overlay_percent > 0 && !empty($this->image_overlay_color))) {
3844
+ $this->log .= '- apply color overlay<br />';
3845
+ list($red, $green, $blue) = $this->getcolors($this->image_overlay_color);
3846
+ $filter = imagecreatetruecolor($this->image_dst_x, $this->image_dst_y);
3847
+ $color = imagecolorallocate($filter, $red, $green, $blue);
3848
+ imagefilledrectangle($filter, 0, 0, $this->image_dst_x, $this->image_dst_y, $color);
3849
+ $this->imagecopymergealpha($image_dst, $filter, 0, 0, 0, 0, $this->image_dst_x, $this->image_dst_y, $this->image_overlay_percent);
3850
+ imagedestroy($filter);
3851
+ }
3852
+
3853
+ // add brightness, contrast and tint, turns to greyscale and inverts colors
3854
+ if ($gd_version >= 2 && ($this->image_negative || $this->image_greyscale || is_numeric($this->image_threshold)|| is_numeric($this->image_brightness) || is_numeric($this->image_contrast) || !empty($this->image_tint_color))) {
3855
+ $this->log .= '- apply tint, light, contrast correction, negative, greyscale and threshold<br />';
3856
+ if (!empty($this->image_tint_color)) list($tint_red, $tint_green, $tint_blue) = $this->getcolors($this->image_tint_color);
3857
+ imagealphablending($image_dst, true);
3858
+ for($y=0; $y < $this->image_dst_y; $y++) {
3859
+ for($x=0; $x < $this->image_dst_x; $x++) {
3860
+ if ($this->image_greyscale) {
3861
+ $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y));
3862
+ $r = $g = $b = round((0.2125 * $pixel['red']) + (0.7154 * $pixel['green']) + (0.0721 * $pixel['blue']));
3863
+ $color = imagecolorallocatealpha($image_dst, $r, $g, $b, $pixel['alpha']);
3864
+ imagesetpixel($image_dst, $x, $y, $color);
3865
+ }
3866
+ if (is_numeric($this->image_threshold)) {
3867
+ $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y));
3868
+ $c = (round($pixel['red'] + $pixel['green'] + $pixel['blue']) / 3) - 127;
3869
+ $r = $g = $b = ($c > $this->image_threshold ? 255 : 0);
3870
+ $color = imagecolorallocatealpha($image_dst, $r, $g, $b, $pixel['alpha']);
3871
+ imagesetpixel($image_dst, $x, $y, $color);
3872
+ }
3873
+ if (is_numeric($this->image_brightness)) {
3874
+ $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y));
3875
+ $r = max(min(round($pixel['red'] + (($this->image_brightness * 2))), 255), 0);
3876
+ $g = max(min(round($pixel['green'] + (($this->image_brightness * 2))), 255), 0);
3877
+ $b = max(min(round($pixel['blue'] + (($this->image_brightness * 2))), 255), 0);
3878
+ $color = imagecolorallocatealpha($image_dst, $r, $g, $b, $pixel['alpha']);
3879
+ imagesetpixel($image_dst, $x, $y, $color);
3880
+ }
3881
+ if (is_numeric($this->image_contrast)) {
3882
+ $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y));
3883
+ $r = max(min(round(($this->image_contrast + 128) * $pixel['red'] / 128), 255), 0);
3884
+ $g = max(min(round(($this->image_contrast + 128) * $pixel['green'] / 128), 255), 0);
3885
+ $b = max(min(round(($this->image_contrast + 128) * $pixel['blue'] / 128), 255), 0);
3886
+ $color = imagecolorallocatealpha($image_dst, $r, $g, $b, $pixel['alpha']);
3887
+ imagesetpixel($image_dst, $x, $y, $color);
3888
+ }
3889
+ if (!empty($this->image_tint_color)) {
3890
+ $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y));
3891
+ $r = min(round($tint_red * $pixel['red'] / 169), 255);
3892
+ $g = min(round($tint_green * $pixel['green'] / 169), 255);
3893
+ $b = min(round($tint_blue * $pixel['blue'] / 169), 255);
3894
+ $color = imagecolorallocatealpha($image_dst, $r, $g, $b, $pixel['alpha']);
3895
+ imagesetpixel($image_dst, $x, $y, $color);
3896
+ }
3897
+ if (!empty($this->image_negative)) {
3898
+ $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y));
3899
+ $r = round(255 - $pixel['red']);
3900
+ $g = round(255 - $pixel['green']);
3901
+ $b = round(255 - $pixel['blue']);
3902
+ $color = imagecolorallocatealpha($image_dst, $r, $g, $b, $pixel['alpha']);
3903
+ imagesetpixel($image_dst, $x, $y, $color);
3904
+ }
3905
+ }
3906
+ }
3907
+ }
3908
+
3909
+ // adds a border
3910
+ if ($gd_version >= 2 && !empty($this->image_border)) {
3911
+ if (is_array($this->image_border)) {
3912
+ $vars = $this->image_border;
3913
+ $this->log .= '- add border : ' . implode(' ', $this->image_border) . '<br />';
3914
+ } else {
3915
+ $this->log .= '- add border : ' . $this->image_border . '<br />';
3916
+ $vars = explode(' ', $this->image_border);
3917
+ }
3918
+ if (sizeof($vars) == 4) {
3919
+ $ct = $vars[0]; $cr = $vars[1]; $cb = $vars[2]; $cl = $vars[3];
3920
+ } else if (sizeof($vars) == 2) {
3921
+ $ct = $vars[0]; $cr = $vars[1]; $cb = $vars[0]; $cl = $vars[1];
3922
+ } else {
3923
+ $ct = $vars[0]; $cr = $vars[0]; $cb = $vars[0]; $cl = $vars[0];
3924
+ }
3925
+ if (strpos($ct, '%')>0) $ct = $this->image_dst_y * (str_replace('%','',$ct) / 100);
3926
+ if (strpos($cr, '%')>0) $cr = $this->image_dst_x * (str_replace('%','',$cr) / 100);
3927
+ if (strpos($cb, '%')>0) $cb = $this->image_dst_y * (str_replace('%','',$cb) / 100);
3928
+ if (strpos($cl, '%')>0) $cl = $this->image_dst_x * (str_replace('%','',$cl) / 100);
3929
+ if (strpos($ct, 'px')>0) $ct = str_replace('px','',$ct);
3930
+ if (strpos($cr, 'px')>0) $cr = str_replace('px','',$cr);
3931
+ if (strpos($cb, 'px')>0) $cb = str_replace('px','',$cb);
3932
+ if (strpos($cl, 'px')>0) $cl = str_replace('px','',$cl);
3933
+ $ct = (int) $ct;
3934
+ $cr = (int) $cr;
3935
+ $cb = (int) $cb;
3936
+ $cl = (int) $cl;
3937
+ $this->image_dst_x = $this->image_dst_x + $cl + $cr;
3938
+ $this->image_dst_y = $this->image_dst_y + $ct + $cb;
3939
+ if (!empty($this->image_border_color)) list($red, $green, $blue) = $this->getcolors($this->image_border_color);
3940
+ // we now create an image, that we fill with the border color
3941
+ $tmp = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y);
3942
+ $background = imagecolorallocatealpha($tmp, $red, $green, $blue, 0);
3943
+ imagefilledrectangle($tmp, 0, 0, $this->image_dst_x, $this->image_dst_y, $background);
3944
+ // we then copy the source image into the new image, without merging so that only the border is actually kept
3945
+ imagecopy($tmp, $image_dst, $cl, $ct, 0, 0, $this->image_dst_x - $cr - $cl, $this->image_dst_y - $cb - $ct);
3946
+ // we transfert tmp into image_dst
3947
+ $image_dst = $this->imagetransfer($tmp, $image_dst);
3948
+ }
3949
+
3950
+ // add frame border
3951
+ if (is_numeric($this->image_frame)) {
3952
+ if (is_array($this->image_frame_colors)) {
3953
+ $vars = $this->image_frame_colors;
3954
+ $this->log .= '- add frame : ' . implode(' ', $this->image_frame_colors) . '<br />';
3955
+ } else {
3956
+ $this->log .= '- add frame : ' . $this->image_frame_colors . '<br />';
3957
+ $vars = explode(' ', $this->image_frame_colors);
3958
+ }
3959
+ $nb = sizeof($vars);
3960
+ $this->image_dst_x = $this->image_dst_x + ($nb * 2);
3961
+ $this->image_dst_y = $this->image_dst_y + ($nb * 2);
3962
+ $tmp = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y);
3963
+ imagecopy($tmp, $image_dst, $nb, $nb, 0, 0, $this->image_dst_x - ($nb * 2), $this->image_dst_y - ($nb * 2));
3964
+ for ($i=0; $i<$nb; $i++) {
3965
+ list($red, $green, $blue) = $this->getcolors($vars[$i]);
3966
+ $c = imagecolorallocate($tmp, $red, $green, $blue);
3967
+ if ($this->image_frame == 1) {
3968
+ imageline($tmp, $i, $i, $this->image_dst_x - $i -1, $i, $c);
3969
+ imageline($tmp, $this->image_dst_x - $i -1, $this->image_dst_y - $i -1, $this->image_dst_x - $i -1, $i, $c);
3970
+ imageline($tmp, $this->image_dst_x - $i -1, $this->image_dst_y - $i -1, $i, $this->image_dst_y - $i -1, $c);
3971
+ imageline($tmp, $i, $i, $i, $this->image_dst_y - $i -1, $c);
3972
+ } else {
3973
+ imageline($tmp, $i, $i, $this->image_dst_x - $i -1, $i, $c);
3974
+ imageline($tmp, $this->image_dst_x - $nb + $i, $this->image_dst_y - $nb + $i, $this->image_dst_x - $nb + $i, $nb - $i, $c);
3975
+ imageline($tmp, $this->image_dst_x - $nb + $i, $this->image_dst_y - $nb + $i, $nb - $i, $this->image_dst_y - $nb + $i, $c);
3976
+ imageline($tmp, $i, $i, $i, $this->image_dst_y - $i -1, $c);
3977
+ }
3978
+ }
3979
+ // we transfert tmp into image_dst
3980
+ $image_dst = $this->imagetransfer($tmp, $image_dst);
3981
+ }
3982
+
3983
+ // add bevel border
3984
+ if ($this->image_bevel > 0) {
3985
+ if (empty($this->image_bevel_color1)) $this->image_bevel_color1 = '#FFFFFF';
3986
+ if (empty($this->image_bevel_color2)) $this->image_bevel_color2 = '#000000';
3987
+ list($red1, $green1, $blue1) = $this->getcolors($this->image_bevel_color1);
3988
+ list($red2, $green2, $blue2) = $this->getcolors($this->image_bevel_color2);
3989
+ $tmp = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y);
3990
+ imagecopy($tmp, $image_dst, 0, 0, 0, 0, $this->image_dst_x, $this->image_dst_y);
3991
+ imagealphablending($tmp, true);
3992
+ for ($i=0; $i<$this->image_bevel; $i++) {
3993
+ $alpha = round(($i / $this->image_bevel) * 127);
3994
+ $c1 = imagecolorallocatealpha($tmp, $red1, $green1, $blue1, $alpha);
3995
+ $c2 = imagecolorallocatealpha($tmp, $red2, $green2, $blue2, $alpha);
3996
+ imageline($tmp, $i, $i, $this->image_dst_x - $i -1, $i, $c1);
3997
+ imageline($tmp, $this->image_dst_x - $i -1, $this->image_dst_y - $i, $this->image_dst_x - $i -1, $i, $c2);
3998
+ imageline($tmp, $this->image_dst_x - $i -1, $this->image_dst_y - $i -1, $i, $this->image_dst_y - $i -1, $c2);
3999
+ imageline($tmp, $i, $i, $i, $this->image_dst_y - $i -1, $c1);
4000
+ }
4001
+ // we transfert tmp into image_dst
4002
+ $image_dst = $this->imagetransfer($tmp, $image_dst);
4003
+ }
4004
+
4005
+ // add watermark image
4006
+ if ($this->image_watermark!='' && file_exists($this->image_watermark)) {
4007
+ $this->log .= '- add watermark<br />';
4008
+ $this->image_watermark_position = strtolower($this->image_watermark_position);
4009
+ $watermark_info = getimagesize($this->image_watermark);
4010
+ $watermark_type = (array_key_exists(2, $watermark_info) ? $watermark_info[2] : null); // 1 = GIF, 2 = JPG, 3 = PNG
4011
+ $watermark_checked = false;
4012
+ if ($watermark_type == IMAGETYPE_GIF) {
4013
+ if (!function_exists('imagecreatefromgif')) {
4014
+ $this->error = $this->translate('watermark_no_create_support', array('GIF'));
4015
+ } else {
4016
+ $filter = @imagecreatefromgif($this->image_watermark);
4017
+ if (!$filter) {
4018
+ $this->error = $this->translate('watermark_create_error', array('GIF'));
4019
+ } else {
4020
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;watermark source image is GIF<br />';
4021
+ $watermark_checked = true;
4022
+ }
4023
+ }
4024
+ } else if ($watermark_type == IMAGETYPE_JPEG) {
4025
+ if (!function_exists('imagecreatefromjpeg')) {
4026
+ $this->error = $this->translate('watermark_no_create_support', array('JPEG'));
4027
+ } else {
4028
+ $filter = @imagecreatefromjpeg($this->image_watermark);
4029
+ if (!$filter) {
4030
+ $this->error = $this->translate('watermark_create_error', array('JPEG'));
4031
+ } else {
4032
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;watermark source image is JPEG<br />';
4033
+ $watermark_checked = true;
4034
+ }
4035
+ }
4036
+ } else if ($watermark_type == IMAGETYPE_PNG) {
4037
+ if (!function_exists('imagecreatefrompng')) {
4038
+ $this->error = $this->translate('watermark_no_create_support', array('PNG'));
4039
+ } else {
4040
+ $filter = @imagecreatefrompng($this->image_watermark);
4041
+ if (!$filter) {
4042
+ $this->error = $this->translate('watermark_create_error', array('PNG'));
4043
+ } else {
4044
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;watermark source image is PNG<br />';
4045
+ $watermark_checked = true;
4046
+ }
4047
+ }
4048
+ } else if ($watermark_type == IMAGETYPE_BMP) {
4049
+ if (!method_exists($this, 'imagecreatefrombmp')) {
4050
+ $this->error = $this->translate('watermark_no_create_support', array('BMP'));
4051
+ } else {
4052
+ $filter = @$this->imagecreatefrombmp($this->image_watermark);
4053
+ if (!$filter) {
4054
+ $this->error = $this->translate('watermark_create_error', array('BMP'));
4055
+ } else {
4056
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;watermark source image is BMP<br />';
4057
+ $watermark_checked = true;
4058
+ }
4059
+ }
4060
+ } else {
4061
+ $this->error = $this->translate('watermark_invalid');
4062
+ }
4063
+ if ($watermark_checked) {
4064
+ $watermark_width = imagesx($filter);
4065
+ $watermark_height = imagesy($filter);
4066
+ $watermark_x = 0;
4067
+ $watermark_y = 0;
4068
+ if (is_numeric($this->image_watermark_x)) {
4069
+ if ($this->image_watermark_x < 0) {
4070
+ $watermark_x = $this->image_dst_x - $watermark_width + $this->image_watermark_x;
4071
+ } else {
4072
+ $watermark_x = $this->image_watermark_x;
4073
+ }
4074
+ } else {
4075
+ if (strpos($this->image_watermark_position, 'r') !== false) {
4076
+ $watermark_x = $this->image_dst_x - $watermark_width;
4077
+ } else if (strpos($this->image_watermark_position, 'l') !== false) {
4078
+ $watermark_x = 0;
4079
+ } else {
4080
+ $watermark_x = ($this->image_dst_x - $watermark_width) / 2;
4081
+ }
4082
+ }
4083
+ if (is_numeric($this->image_watermark_y)) {
4084
+ if ($this->image_watermark_y < 0) {
4085
+ $watermark_y = $this->image_dst_y - $watermark_height + $this->image_watermark_y;
4086
+ } else {
4087
+ $watermark_y = $this->image_watermark_y;
4088
+ }
4089
+ } else {
4090
+ if (strpos($this->image_watermark_position, 'b') !== false) {
4091
+ $watermark_y = $this->image_dst_y - $watermark_height;
4092
+ } else if (strpos($this->image_watermark_position, 't') !== false) {
4093
+ $watermark_y = 0;
4094
+ } else {
4095
+ $watermark_y = ($this->image_dst_y - $watermark_height) / 2;
4096
+ }
4097
+ }
4098
+ imagecopyresampled ($image_dst, $filter, $watermark_x, $watermark_y, 0, 0, $watermark_width, $watermark_height, $watermark_width, $watermark_height);
4099
+ } else {
4100
+ $this->error = $this->translate('watermark_invalid');
4101
+ }
4102
+ }
4103
+
4104
+ // add text
4105
+ if (!empty($this->image_text)) {
4106
+ $this->log .= '- add text<br />';
4107
+
4108
+ // calculate sizes in human readable format
4109
+ $src_size = $this->file_src_size / 1024;
4110
+ $src_size_mb = number_format($src_size / 1024, 1, ".", " ");
4111
+ $src_size_kb = number_format($src_size, 1, ".", " ");
4112
+ $src_size_human = ($src_size > 1024 ? $src_size_mb . " MB" : $src_size_kb . " kb");
4113
+
4114
+ $this->image_text = str_replace(
4115
+ array('[src_name]',
4116
+ '[src_name_body]',
4117
+ '[src_name_ext]',
4118
+ '[src_pathname]',
4119
+ '[src_mime]',
4120
+ '[src_size]',
4121
+ '[src_size_kb]',
4122
+ '[src_size_mb]',
4123
+ '[src_size_human]',
4124
+ '[src_x]',
4125
+ '[src_y]',
4126
+ '[src_pixels]',
4127
+ '[src_type]',
4128
+ '[src_bits]',
4129
+ '[dst_path]',
4130
+ '[dst_name_body]',
4131
+ '[dst_name_ext]',
4132
+ '[dst_name]',
4133
+ '[dst_pathname]',
4134
+ '[dst_x]',
4135
+ '[dst_y]',
4136
+ '[date]',
4137
+ '[time]',
4138
+ '[host]',
4139
+ '[server]',
4140
+ '[ip]',
4141
+ '[gd_version]'),
4142
+ array($this->file_src_name,
4143
+ $this->file_src_name_body,
4144
+ $this->file_src_name_ext,
4145
+ $this->file_src_pathname,
4146
+ $this->file_src_mime,
4147
+ $this->file_src_size,
4148
+ $src_size_kb,
4149
+ $src_size_mb,
4150
+ $src_size_human,
4151
+ $this->image_src_x,
4152
+ $this->image_src_y,
4153
+ $this->image_src_pixels,
4154
+ $this->image_src_type,
4155
+ $this->image_src_bits,
4156
+ $this->file_dst_path,
4157
+ $this->file_dst_name_body,
4158
+ $this->file_dst_name_ext,
4159
+ $this->file_dst_name,
4160
+ $this->file_dst_pathname,
4161
+ $this->image_dst_x,
4162
+ $this->image_dst_y,
4163
+ date('Y-m-d'),
4164
+ date('H:i:s'),
4165
+ (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'n/a'),
4166
+ (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'n/a'),
4167
+ (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : 'n/a'),
4168
+ $this->gdversion(true)),
4169
+ $this->image_text);
4170
+
4171
+ if (!is_numeric($this->image_text_padding)) $this->image_text_padding = 0;
4172
+ if (!is_numeric($this->image_text_line_spacing)) $this->image_text_line_spacing = 0;
4173
+ if (!is_numeric($this->image_text_padding_x)) $this->image_text_padding_x = $this->image_text_padding;
4174
+ if (!is_numeric($this->image_text_padding_y)) $this->image_text_padding_y = $this->image_text_padding;
4175
+ $this->image_text_position = strtolower($this->image_text_position);
4176
+ $this->image_text_direction = strtolower($this->image_text_direction);
4177
+ $this->image_text_alignment = strtolower($this->image_text_alignment);
4178
+
4179
+ // if the font is a string, we assume that we might want to load a font
4180
+ if (!is_numeric($this->image_text_font) && strlen($this->image_text_font) > 4 && substr(strtolower($this->image_text_font), -4) == '.gdf') {
4181
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;try to load font ' . $this->image_text_font . '... ';
4182
+ if ($this->image_text_font = @imageloadfont($this->image_text_font)) {
4183
+ $this->log .= 'success<br />';
4184
+ } else {
4185
+ $this->log .= 'error<br />';
4186
+ $this->image_text_font = 5;
4187
+ }
4188
+ }
4189
+
4190
+ $text = explode("\n", $this->image_text);
4191
+ $char_width = imagefontwidth($this->image_text_font);
4192
+ $char_height = imagefontheight($this->image_text_font);
4193
+ $text_height = 0;
4194
+ $text_width = 0;
4195
+ $line_height = 0;
4196
+ $line_width = 0;
4197
+
4198
+ foreach ($text as $k => $v) {
4199
+ if ($this->image_text_direction == 'v') {
4200
+ $h = ($char_width * strlen($v));
4201
+ if ($h > $text_height) $text_height = $h;
4202
+ $line_width = $char_height;
4203
+ $text_width += $line_width + ($k < (sizeof($text)-1) ? $this->image_text_line_spacing : 0);
4204
+ } else {
4205
+ $w = ($char_width * strlen($v));
4206
+ if ($w > $text_width) $text_width = $w;
4207
+ $line_height = $char_height;
4208
+ $text_height += $line_height + ($k < (sizeof($text)-1) ? $this->image_text_line_spacing : 0);
4209
+ }
4210
+ }
4211
+ $text_width += (2 * $this->image_text_padding_x);
4212
+ $text_height += (2 * $this->image_text_padding_y);
4213
+ $text_x = 0;
4214
+ $text_y = 0;
4215
+ if (is_numeric($this->image_text_x)) {
4216
+ if ($this->image_text_x < 0) {
4217
+ $text_x = $this->image_dst_x - $text_width + $this->image_text_x;
4218
+ } else {
4219
+ $text_x = $this->image_text_x;
4220
+ }
4221
+ } else {
4222
+ if (strpos($this->image_text_position, 'r') !== false) {
4223
+ $text_x = $this->image_dst_x - $text_width;
4224
+ } else if (strpos($this->image_text_position, 'l') !== false) {
4225
+ $text_x = 0;
4226
+ } else {
4227
+ $text_x = ($this->image_dst_x - $text_width) / 2;
4228
+ }
4229
+ }
4230
+ if (is_numeric($this->image_text_y)) {
4231
+ if ($this->image_text_y < 0) {
4232
+ $text_y = $this->image_dst_y - $text_height + $this->image_text_y;
4233
+ } else {
4234
+ $text_y = $this->image_text_y;
4235
+ }
4236
+ } else {
4237
+ if (strpos($this->image_text_position, 'b') !== false) {
4238
+ $text_y = $this->image_dst_y - $text_height;
4239
+ } else if (strpos($this->image_text_position, 't') !== false) {
4240
+ $text_y = 0;
4241
+ } else {
4242
+ $text_y = ($this->image_dst_y - $text_height) / 2;
4243
+ }
4244
+ }
4245
+
4246
+ // add a background, maybe transparent
4247
+ if (!empty($this->image_text_background)) {
4248
+ list($red, $green, $blue) = $this->getcolors($this->image_text_background);
4249
+ if ($gd_version >= 2 && (is_numeric($this->image_text_background_percent)) && $this->image_text_background_percent >= 0 && $this->image_text_background_percent <= 100) {
4250
+ $filter = imagecreatetruecolor($text_width, $text_height);
4251
+ $background_color = imagecolorallocate($filter, $red, $green, $blue);
4252
+ imagefilledrectangle($filter, 0, 0, $text_width, $text_height, $background_color);
4253
+ $this->imagecopymergealpha($image_dst, $filter, $text_x, $text_y, 0, 0, $text_width, $text_height, $this->image_text_background_percent);
4254
+ imagedestroy($filter);
4255
+ } else {
4256
+ $background_color = imagecolorallocate($image_dst ,$red, $green, $blue);
4257
+ imagefilledrectangle($image_dst, $text_x, $text_y, $text_x + $text_width, $text_y + $text_height, $background_color);
4258
+ }
4259
+ }
4260
+
4261
+ $text_x += $this->image_text_padding_x;
4262
+ $text_y += $this->image_text_padding_y;
4263
+ $t_width = $text_width - (2 * $this->image_text_padding_x);
4264
+ $t_height = $text_height - (2 * $this->image_text_padding_y);
4265
+ list($red, $green, $blue) = $this->getcolors($this->image_text_color);
4266
+
4267
+ // add the text, maybe transparent
4268
+ if ($gd_version >= 2 && (is_numeric($this->image_text_percent)) && $this->image_text_percent >= 0 && $this->image_text_percent <= 100) {
4269
+ if ($t_width < 0) $t_width = 0;
4270
+ if ($t_height < 0) $t_height = 0;
4271
+ $filter = $this->imagecreatenew($t_width, $t_height, false, true);
4272
+ $text_color = imagecolorallocate($filter ,$red, $green, $blue);
4273
+
4274
+ foreach ($text as $k => $v) {
4275
+ if ($this->image_text_direction == 'v') {
4276
+ imagestringup($filter,
4277
+ $this->image_text_font,
4278
+ $k * ($line_width + ($k > 0 && $k < (sizeof($text)) ? $this->image_text_line_spacing : 0)),
4279
+ $text_height - (2 * $this->image_text_padding_y) - ($this->image_text_alignment == 'l' ? 0 : (($t_height - strlen($v) * $char_width) / ($this->image_text_alignment == 'r' ? 1 : 2))) ,
4280
+ $v,
4281
+ $text_color);
4282
+ } else {
4283
+ imagestring($filter,
4284
+ $this->image_text_font,
4285
+ ($this->image_text_alignment == 'l' ? 0 : (($t_width - strlen($v) * $char_width) / ($this->image_text_alignment == 'r' ? 1 : 2))),
4286
+ $k * ($line_height + ($k > 0 && $k < (sizeof($text)) ? $this->image_text_line_spacing : 0)),
4287
+ $v,
4288
+ $text_color);
4289
+ }
4290
+ }
4291
+ $this->imagecopymergealpha($image_dst, $filter, $text_x, $text_y, 0, 0, $t_width, $t_height, $this->image_text_percent);
4292
+ imagedestroy($filter);
4293
+
4294
+ } else {
4295
+ $text_color = imageColorAllocate($image_dst ,$red, $green, $blue);
4296
+ foreach ($text as $k => $v) {
4297
+ if ($this->image_text_direction == 'v') {
4298
+ imagestringup($image_dst,
4299
+ $this->image_text_font,
4300
+ $text_x + $k * ($line_width + ($k > 0 && $k < (sizeof($text)) ? $this->image_text_line_spacing : 0)),
4301
+ $text_y + $text_height - (2 * $this->image_text_padding_y) - ($this->image_text_alignment == 'l' ? 0 : (($t_height - strlen($v) * $char_width) / ($this->image_text_alignment == 'r' ? 1 : 2))),
4302
+ $v,
4303
+ $text_color);
4304
+ } else {
4305
+ imagestring($image_dst,
4306
+ $this->image_text_font,
4307
+ $text_x + ($this->image_text_alignment == 'l' ? 0 : (($t_width - strlen($v) * $char_width) / ($this->image_text_alignment == 'r' ? 1 : 2))),
4308
+ $text_y + $k * ($line_height + ($k > 0 && $k < (sizeof($text)) ? $this->image_text_line_spacing : 0)),
4309
+ $v,
4310
+ $text_color);
4311
+ }
4312
+ }
4313
+ }
4314
+ }
4315
+
4316
+ // add a reflection
4317
+ if ($this->image_reflection_height) {
4318
+ $this->log .= '- add reflection : ' . $this->image_reflection_height . '<br />';
4319
+ // we decode image_reflection_height, which can be a integer, a string in pixels or percentage
4320
+ $image_reflection_height = $this->image_reflection_height;
4321
+ if (strpos($image_reflection_height, '%')>0) $image_reflection_height = $this->image_dst_y * (str_replace('%','',$image_reflection_height / 100));
4322
+ if (strpos($image_reflection_height, 'px')>0) $image_reflection_height = str_replace('px','',$image_reflection_height);
4323
+ $image_reflection_height = (int) $image_reflection_height;
4324
+ if ($image_reflection_height > $this->image_dst_y) $image_reflection_height = $this->image_dst_y;
4325
+ if (empty($this->image_reflection_opacity)) $this->image_reflection_opacity = 60;
4326
+ // create the new destination image
4327
+ $tmp = $this->imagecreatenew($this->image_dst_x, $this->image_dst_y + $image_reflection_height + $this->image_reflection_space, true);
4328
+ $transparency = $this->image_reflection_opacity;
4329
+
4330
+ // copy the original image
4331
+ imagecopy($tmp, $image_dst, 0, 0, 0, 0, $this->image_dst_x, $this->image_dst_y + ($this->image_reflection_space < 0 ? $this->image_reflection_space : 0));
4332
+
4333
+ // we have to make sure the extra bit is the right color, or transparent
4334
+ if ($image_reflection_height + $this->image_reflection_space > 0) {
4335
+ // use the background color if present
4336
+ if (!empty($this->image_background_color)) {
4337
+ list($red, $green, $blue) = $this->getcolors($this->image_background_color);
4338
+ $fill = imagecolorallocate($tmp, $red, $green, $blue);
4339
+ } else {
4340
+ $fill = imagecolorallocatealpha($tmp, 0, 0, 0, 127);
4341
+ }
4342
+ // fill in from the edge of the extra bit
4343
+ imagefill($tmp, round($this->image_dst_x / 2), $this->image_dst_y + $image_reflection_height + $this->image_reflection_space - 1, $fill);
4344
+ }
4345
+
4346
+ // copy the reflection
4347
+ for ($y = 0; $y < $image_reflection_height; $y++) {
4348
+ for ($x = 0; $x < $this->image_dst_x; $x++) {
4349
+ $pixel_b = imagecolorsforindex($tmp, imagecolorat($tmp, $x, $y + $this->image_dst_y + $this->image_reflection_space));
4350
+ $pixel_o = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $this->image_dst_y - $y - 1 + ($this->image_reflection_space < 0 ? $this->image_reflection_space : 0)));
4351
+ $alpha_o = 1 - ($pixel_o['alpha'] / 127);
4352
+ $alpha_b = 1 - ($pixel_b['alpha'] / 127);
4353
+ $opacity = $alpha_o * $transparency / 100;
4354
+ if ($opacity > 0) {
4355
+ $red = round((($pixel_o['red'] * $opacity) + ($pixel_b['red'] ) * $alpha_b) / ($alpha_b + $opacity));
4356
+ $green = round((($pixel_o['green'] * $opacity) + ($pixel_b['green']) * $alpha_b) / ($alpha_b + $opacity));
4357
+ $blue = round((($pixel_o['blue'] * $opacity) + ($pixel_b['blue'] ) * $alpha_b) / ($alpha_b + $opacity));
4358
+ $alpha = ($opacity + $alpha_b);
4359
+ if ($alpha > 1) $alpha = 1;
4360
+ $alpha = round((1 - $alpha) * 127);
4361
+ $color = imagecolorallocatealpha($tmp, $red, $green, $blue, $alpha);
4362
+ imagesetpixel($tmp, $x, $y + $this->image_dst_y + $this->image_reflection_space, $color);
4363
+ }
4364
+ }
4365
+ if ($transparency > 0) $transparency = $transparency - ($this->image_reflection_opacity / $image_reflection_height);
4366
+ }
4367
+
4368
+ // copy the resulting image into the destination image
4369
+ $this->image_dst_y = $this->image_dst_y + $image_reflection_height + $this->image_reflection_space;
4370
+ $image_dst = $this->imagetransfer($tmp, $image_dst);
4371
+ }
4372
+
4373
+ // reduce the JPEG image to a set desired size
4374
+ if (is_numeric($this->jpeg_size) && $this->jpeg_size > 0 && ($this->image_convert == 'jpeg' || $this->image_convert == 'jpg')) {
4375
+ // inspired by: JPEGReducer class version 1, 25 November 2004, Author: Huda M ElMatsani, justhuda at netscape dot net
4376
+ $this->log .= '- JPEG desired file size : ' . $this->jpeg_size . '<br />';
4377
+ // calculate size of each image. 75%, 50%, and 25% quality
4378
+ ob_start(); imagejpeg($image_dst,'',75); $buffer = ob_get_contents(); ob_end_clean();
4379
+ $size75 = strlen($buffer);
4380
+ ob_start(); imagejpeg($image_dst,'',50); $buffer = ob_get_contents(); ob_end_clean();
4381
+ $size50 = strlen($buffer);
4382
+ ob_start(); imagejpeg($image_dst,'',25); $buffer = ob_get_contents(); ob_end_clean();
4383
+ $size25 = strlen($buffer);
4384
+
4385
+ // calculate gradient of size reduction by quality
4386
+ $mgrad1 = 25 / ($size50-$size25);
4387
+ $mgrad2 = 25 / ($size75-$size50);
4388
+ $mgrad3 = 50 / ($size75-$size25);
4389
+ $mgrad = ($mgrad1 + $mgrad2 + $mgrad3) / 3;
4390
+ // result of approx. quality factor for expected size
4391
+ $q_factor = round($mgrad * ($this->jpeg_size - $size50) + 50);
4392
+
4393
+ if ($q_factor<1) {
4394
+ $this->jpeg_quality=1;
4395
+ } elseif ($q_factor>100) {
4396
+ $this->jpeg_quality=100;
4397
+ } else {
4398
+ $this->jpeg_quality=$q_factor;
4399
+ }
4400
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;JPEG quality factor set to ' . $this->jpeg_quality . '<br />';
4401
+ }
4402
+
4403
+ // converts image from true color, and fix transparency if needed
4404
+ $this->log .= '- converting...<br />';
4405
+ switch($this->image_convert) {
4406
+ case 'gif':
4407
+ // if the image is true color, we convert it to a palette
4408
+ if (imageistruecolor($image_dst)) {
4409
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;true color to palette<br />';
4410
+ // creates a black and white mask
4411
+ $mask = array(array());
4412
+ for ($x = 0; $x < $this->image_dst_x; $x++) {
4413
+ for ($y = 0; $y < $this->image_dst_y; $y++) {
4414
+ $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y));
4415
+ $mask[$x][$y] = $pixel['alpha'];
4416
+ }
4417
+ }
4418
+ list($red, $green, $blue) = $this->getcolors($this->image_default_color);
4419
+ // first, we merge the image with the background color, so we know which colors we will have
4420
+ for ($x = 0; $x < $this->image_dst_x; $x++) {
4421
+ for ($y = 0; $y < $this->image_dst_y; $y++) {
4422
+ if ($mask[$x][$y] > 0){
4423
+ // we have some transparency. we combine the color with the default color
4424
+ $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y));
4425
+ $alpha = ($mask[$x][$y] / 127);
4426
+ $pixel['red'] = round(($pixel['red'] * (1 -$alpha) + $red * ($alpha)));
4427
+ $pixel['green'] = round(($pixel['green'] * (1 -$alpha) + $green * ($alpha)));
4428
+ $pixel['blue'] = round(($pixel['blue'] * (1 -$alpha) + $blue * ($alpha)));
4429
+ $color = imagecolorallocate($image_dst, $pixel['red'], $pixel['green'], $pixel['blue']);
4430
+ imagesetpixel($image_dst, $x, $y, $color);
4431
+ }
4432
+ }
4433
+ }
4434
+ // transfrom the true color image into palette, with it merged default color in
4435
+ // we will have the best color possible, including the background
4436
+ if (empty($this->image_background_color)) {
4437
+ imagetruecolortopalette($image_dst, true, 255);
4438
+ $transparency = imagecolorallocate($image_dst, 254, 1, 253);
4439
+ imagecolortransparent($image_dst, $transparency);
4440
+ // make the transparent areas transparent
4441
+ for ($x = 0; $x < $this->image_dst_x; $x++) {
4442
+ for ($y = 0; $y < $this->image_dst_y; $y++) {
4443
+ // we test wether we have enough opacity to justify keeping the color
4444
+ if ($mask[$x][$y] > 120) imagesetpixel($image_dst, $x, $y, $transparency);
4445
+ }
4446
+ }
4447
+ }
4448
+ unset($mask);
4449
+ }
4450
+ break;
4451
+ case 'jpg':
4452
+ case 'bmp':
4453
+ // if the image doesn't support any transparency, then we merge it with the default color
4454
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;fills in transparency with default color<br />';
4455
+ list($red, $green, $blue) = $this->getcolors($this->image_default_color);
4456
+ $transparency = imagecolorallocate($image_dst, $red, $green, $blue);
4457
+ // make the transaparent areas transparent
4458
+ for ($x = 0; $x < $this->image_dst_x; $x++) {
4459
+ for ($y = 0; $y < $this->image_dst_y; $y++) {
4460
+ // we test wether we have some transparency, in which case we will merge the colors
4461
+ if (imageistruecolor($image_dst)) {
4462
+ $rgba = imagecolorat($image_dst, $x, $y);
4463
+ $pixel = array('red' => ($rgba >> 16) & 0xFF,
4464
+ 'green' => ($rgba >> 8) & 0xFF,
4465
+ 'blue' => $rgba & 0xFF,
4466
+ 'alpha' => ($rgba & 0x7F000000) >> 24);
4467
+ } else {
4468
+ $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y));
4469
+ }
4470
+ if ($pixel['alpha'] == 127) {
4471
+ // we have full transparency. we make the pixel transparent
4472
+ imagesetpixel($image_dst, $x, $y, $transparency);
4473
+ } else if ($pixel['alpha'] > 0) {
4474
+ // we have some transparency. we combine the color with the default color
4475
+ $alpha = ($pixel['alpha'] / 127);
4476
+ $pixel['red'] = round(($pixel['red'] * (1 -$alpha) + $red * ($alpha)));
4477
+ $pixel['green'] = round(($pixel['green'] * (1 -$alpha) + $green * ($alpha)));
4478
+ $pixel['blue'] = round(($pixel['blue'] * (1 -$alpha) + $blue * ($alpha)));
4479
+ $color = imagecolorclosest($image_dst, $pixel['red'], $pixel['green'], $pixel['blue']);
4480
+ imagesetpixel($image_dst, $x, $y, $color);
4481
+ }
4482
+ }
4483
+ }
4484
+
4485
+ break;
4486
+ default:
4487
+ break;
4488
+ }
4489
+
4490
+ // outputs image
4491
+ $this->log .= '- saving image...<br />';
4492
+ switch($this->image_convert) {
4493
+ case 'jpeg':
4494
+ case 'jpg':
4495
+ if (!$return_mode) {
4496
+ $result = @imagejpeg($image_dst, $this->file_dst_pathname, $this->jpeg_quality);
4497
+ } else {
4498
+ ob_start();
4499
+ $result = @imagejpeg($image_dst, '', $this->jpeg_quality);
4500
+ $return_content = ob_get_contents();
4501
+ ob_end_clean();
4502
+ }
4503
+ if (!$result) {
4504
+ $this->processed = false;
4505
+ $this->error = $this->translate('file_create', array('JPEG'));
4506
+ } else {
4507
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;JPEG image created<br />';
4508
+ }
4509
+ break;
4510
+ case 'png':
4511
+ imagealphablending( $image_dst, false );
4512
+ imagesavealpha( $image_dst, true );
4513
+ if (!$return_mode) {
4514
+ $result = @imagepng($image_dst, $this->file_dst_pathname);
4515
+ } else {
4516
+ ob_start();
4517
+ $result = @imagepng($image_dst);
4518
+ $return_content = ob_get_contents();
4519
+ ob_end_clean();
4520
+ }
4521
+ if (!$result) {
4522
+ $this->processed = false;
4523
+ $this->error = $this->translate('file_create', array('PNG'));
4524
+ } else {
4525
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;PNG image created<br />';
4526
+ }
4527
+ break;
4528
+ case 'gif':
4529
+ if (!$return_mode) {
4530
+ $result = @imagegif($image_dst, $this->file_dst_pathname);
4531
+ } else {
4532
+ ob_start();
4533
+ $result = @imagegif($image_dst);
4534
+ $return_content = ob_get_contents();
4535
+ ob_end_clean();
4536
+ }
4537
+ if (!$result) {
4538
+ $this->processed = false;
4539
+ $this->error = $this->translate('file_create', array('GIF'));
4540
+ } else {
4541
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;GIF image created<br />';
4542
+ }
4543
+ break;
4544
+ case 'bmp':
4545
+ if (!$return_mode) {
4546
+ $result = $this->imagebmp($image_dst, $this->file_dst_pathname);
4547
+ } else {
4548
+ ob_start();
4549
+ $result = $this->imagebmp($image_dst);
4550
+ $return_content = ob_get_contents();
4551
+ ob_end_clean();
4552
+ }
4553
+ if (!$result) {
4554
+ $this->processed = false;
4555
+ $this->error = $this->translate('file_create', array('BMP'));
4556
+ } else {
4557
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;BMP image created<br />';
4558
+ }
4559
+ break;
4560
+
4561
+ default:
4562
+ $this->processed = false;
4563
+ $this->error = $this->translate('no_conversion_type');
4564
+ }
4565
+ if ($this->processed) {
4566
+ if (is_resource($image_src)) imagedestroy($image_src);
4567
+ if (is_resource($image_dst)) imagedestroy($image_dst);
4568
+ $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;image objects destroyed<br />';
4569
+ }
4570
+ }
4571
+
4572
+ } else {
4573
+ $this->log .= '- no image processing wanted<br />';
4574
+
4575
+ if (!$return_mode) {
4576
+ // copy the file to its final destination. we don't use move_uploaded_file here
4577
+ // if we happen to have open_basedir restrictions, it is a temp file that we copy, not the original uploaded file
4578
+ if (!copy($this->file_src_pathname, $this->file_dst_pathname)) {
4579
+ $this->processed = false;
4580
+ $this->error = $this->translate('copy_failed');
4581
+ }
4582
+ } else {
4583
+ // returns the file, so that its content can be received by the caller
4584
+ $return_content = @file_get_contents($this->file_src_pathname);
4585
+ if ($return_content === FALSE) {
4586
+ $this->processed = false;
4587
+ $this->error = $this->translate('reading_failed');
4588
+ }
4589
+ }
4590
+ }
4591
+ }
4592
+
4593
+ if ($this->processed) {
4594
+ $this->log .= '- <b>process OK</b><br />';
4595
+ } else {
4596
+ $this->log .= '- <b>error</b>: ' . $this->error . '<br />';
4597
+ }
4598
+
4599
+ // we reinit all the vars
4600
+ $this->init();
4601
+
4602
+ // we may return the image content
4603
+ if ($return_mode) return $return_content;
4604
+
4605
+ }
4606
+
4607
+ /**
4608
+ * Deletes the uploaded file from its temporary location
4609
+ *
4610
+ * When PHP uploads a file, it stores it in a temporary location.
4611
+ * When you {@link process} the file, you actually copy the resulting file to the given location, it doesn't alter the original file.
4612
+ * Once you have processed the file as many times as you wanted, you can delete the uploaded file.
4613
+ * If there is open_basedir restrictions, the uploaded file is in fact a temporary file
4614
+ *
4615
+ * You might want not to use this function if you work on local files, as it will delete the source file
4616
+ *
4617
+ * @access public
4618
+ */
4619
+ function clean() {
4620
+ $this->log .= '<b>cleanup</b><br />';
4621
+ $this->log .= '- delete temp file ' . $this->file_src_pathname . '<br />';
4622
+ @unlink($this->file_src_pathname);
4623
+ }
4624
+
4625
+
4626
+ /**
4627
+ * Opens a BMP image
4628
+ *
4629
+ * This function has been written by DHKold, and is used with permission of the author
4630
+ *
4631
+ * @access public
4632
+ */
4633
+ function imagecreatefrombmp($filename) {
4634
+ if (! $f1 = fopen($filename,"rb")) return false;
4635
+
4636
+ $file = unpack("vfile_type/Vfile_size/Vreserved/Vbitmap_offset", fread($f1,14));
4637
+ if ($file['file_type'] != 19778) return false;
4638
+
4639
+ $bmp = unpack('Vheader_size/Vwidth/Vheight/vplanes/vbits_per_pixel'.
4640
+ '/Vcompression/Vsize_bitmap/Vhoriz_resolution'.
4641
+ '/Vvert_resolution/Vcolors_used/Vcolors_important', fread($f1,40));
4642
+ $bmp['colors'] = pow(2,$bmp['bits_per_pixel']);
4643
+ if ($bmp['size_bitmap'] == 0) $bmp['size_bitmap'] = $file['file_size'] - $file['bitmap_offset'];
4644
+ $bmp['bytes_per_pixel'] = $bmp['bits_per_pixel']/8;
4645
+ $bmp['bytes_per_pixel2'] = ceil($bmp['bytes_per_pixel']);
4646
+ $bmp['decal'] = ($bmp['width']*$bmp['bytes_per_pixel']/4);
4647
+ $bmp['decal'] -= floor($bmp['width']*$bmp['bytes_per_pixel']/4);
4648
+ $bmp['decal'] = 4-(4*$bmp['decal']);
4649
+ if ($bmp['decal'] == 4) $bmp['decal'] = 0;
4650
+
4651
+ $palette = array();
4652
+ if ($bmp['colors'] < 16777216) {
4653
+ $palette = unpack('V'.$bmp['colors'], fread($f1,$bmp['colors']*4));
4654
+ }
4655
+
4656
+ $im = fread($f1,$bmp['size_bitmap']);
4657
+ $vide = chr(0);
4658
+
4659
+ $res = imagecreatetruecolor($bmp['width'],$bmp['height']);
4660
+ $P = 0;
4661
+ $Y = $bmp['height']-1;
4662
+ while ($Y >= 0) {
4663
+ $X=0;
4664
+ while ($X < $bmp['width']) {
4665
+ if ($bmp['bits_per_pixel'] == 24)
4666
+ $color = unpack("V",substr($im,$P,3).$vide);
4667
+ elseif ($bmp['bits_per_pixel'] == 16) {
4668
+ $color = unpack("n",substr($im,$P,2));
4669
+ $color[1] = $palette[$color[1]+1];
4670
+ } elseif ($bmp['bits_per_pixel'] == 8) {
4671
+ $color = unpack("n",$vide.substr($im,$P,1));
4672
+ $color[1] = $palette[$color[1]+1];
4673
+ } elseif ($bmp['bits_per_pixel'] == 4) {
4674
+ $color = unpack("n",$vide.substr($im,floor($P),1));
4675
+ if (($P*2)%2 == 0) $color[1] = ($color[1] >> 4) ; else $color[1] = ($color[1] & 0x0F);
4676
+ $color[1] = $palette[$color[1]+1];
4677
+ } elseif ($bmp['bits_per_pixel'] == 1) {
4678
+ $color = unpack("n",$vide.substr($im,floor($P),1));
4679
+ if (($P*8)%8 == 0) $color[1] = $color[1] >>7;
4680
+ elseif (($P*8)%8 == 1) $color[1] = ($color[1] & 0x40)>>6;
4681
+ elseif (($P*8)%8 == 2) $color[1] = ($color[1] & 0x20)>>5;
4682
+ elseif (($P*8)%8 == 3) $color[1] = ($color[1] & 0x10)>>4;
4683
+ elseif (($P*8)%8 == 4) $color[1] = ($color[1] & 0x8)>>3;
4684
+ elseif (($P*8)%8 == 5) $color[1] = ($color[1] & 0x4)>>2;
4685
+ elseif (($P*8)%8 == 6) $color[1] = ($color[1] & 0x2)>>1;
4686
+ elseif (($P*8)%8 == 7) $color[1] = ($color[1] & 0x1);
4687
+ $color[1] = $palette[$color[1]+1];
4688
+ } else
4689
+ return FALSE;
4690
+ imagesetpixel($res,$X,$Y,$color[1]);
4691
+ $X++;
4692
+ $P += $bmp['bytes_per_pixel'];
4693
+ }
4694
+ $Y--;
4695
+ $P+=$bmp['decal'];
4696
+ }
4697
+ fclose($f1);
4698
+ return $res;
4699
+ }
4700
+
4701
+ /**
4702
+ * Saves a BMP image
4703
+ *
4704
+ * This function has been published on the PHP website, and can be used freely
4705
+ *
4706
+ * @access public
4707
+ */
4708
+ function imagebmp(&$im, $filename = "") {
4709
+
4710
+ if (!$im) return false;
4711
+ $w = imagesx($im);
4712
+ $h = imagesy($im);
4713
+ $result = '';
4714
+
4715
+ // if the image is not true color, we convert it first
4716
+ if (!imageistruecolor($im)) {
4717
+ $tmp = imagecreatetruecolor($w, $h);
4718
+ imagecopy($tmp, $im, 0, 0, 0, 0, $w, $h);
4719
+ imagedestroy($im);
4720
+ $im = & $tmp;
4721
+ }
4722
+
4723
+ $biBPLine = $w * 3;
4724
+ $biStride = ($biBPLine + 3) & ~3;
4725
+ $biSizeImage = $biStride * $h;
4726
+ $bfOffBits = 54;
4727
+ $bfSize = $bfOffBits + $biSizeImage;
4728
+
4729
+ $result .= substr('BM', 0, 2);
4730
+ $result .= pack ('VvvV', $bfSize, 0, 0, $bfOffBits);
4731
+ $result .= pack ('VVVvvVVVVVV', 40, $w, $h, 1, 24, 0, $biSizeImage, 0, 0, 0, 0);
4732
+
4733
+ $numpad = $biStride - $biBPLine;
4734
+ for ($y = $h - 1; $y >= 0; --$y) {
4735
+ for ($x = 0; $x < $w; ++$x) {
4736
+ $col = imagecolorat ($im, $x, $y);
4737
+ $result .= substr(pack ('V', $col), 0, 3);
4738
+ }
4739
+ for ($i = 0; $i < $numpad; ++$i)
4740
+ $result .= pack ('C', 0);
4741
+ }
4742
+
4743
+ if($filename==""){
4744
+ echo $result;
4745
+ } else {
4746
+ $file = fopen($filename, "wb");
4747
+ fwrite($file, $result);
4748
+ fclose($file);
4749
+ }
4750
+ return true;
4751
+ }
4752
+ }
images/capsman.png ADDED
Binary file
images/cman32.png ADDED
Binary file
includes/admin.php ADDED
@@ -0,0 +1,578 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * General Admin for Capability Manager.
4
+ * Provides admin pages to create and manage roles and capabilities.
5
+ *
6
+ * @version $Rev: 198515 $
7
+ * @author Jordi Canals, Kevin Behrens
8
+ * @copyright Copyright (C) 2009, 2010 Jordi Canals, (C) 2012 Kevin Behrens
9
+ * @license GNU General Public License version 2
10
+ * @link http://agapetry.net
11
+ *
12
+
13
+ Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
14
+ Modifications Copyright 2012, Kevin Behrens <kevin@agapetry.net>
15
+
16
+ This program is free software; you can redistribute it and/or
17
+ modify it under the terms of the GNU General Public License
18
+ version 2 as published by the Free Software Foundation.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+
29
+ $roles = $this->roles;
30
+ $default = $this->current;
31
+
32
+ if( defined('PP_VERSION') ) {
33
+ global $wpdb;
34
+
35
+ $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'" );
36
+ //dump($pp_supplemental_roles);
37
+
38
+ $pp_filtered_types = pp_get_enabled_types('post');
39
+ $pp_metagroup_caps = array();
40
+ $pp_cap_caster = pp_init_cap_caster();
41
+
42
+ foreach( $pp_supplemental_roles as $_role_name ) {
43
+ $role_specs = explode( ':', $_role_name );
44
+ if ( empty($role_specs[2]) || ! in_array( $role_specs[2], $pp_filtered_types ) )
45
+ continue;
46
+
47
+ // add all type-specific caps whose base property cap is included in this pattern role
48
+ // i.e. If 'edit_posts' is in the pattern role, grant $type_obj->cap->edit_posts
49
+ $pp_metagroup_caps = array_merge( $pp_metagroup_caps, array_fill_keys( $pp_cap_caster->get_typecast_caps( $_role_name, 'site' ), true ) );
50
+ }
51
+ } else {
52
+ $pp_metagroup_caps = array();
53
+ }
54
+
55
+ ?>
56
+ <div class="wrap">
57
+ <?php if( defined('PP_VERSION') ) :
58
+ pp_icon();
59
+ $style = 'style="height:60px;"';
60
+ ?>
61
+ <?php else:
62
+ $style = '';
63
+ ?>
64
+ <div id="icon-capsman-admin" class="icon32"></div>
65
+ <?php endif; ?>
66
+
67
+ <h2 <?php echo $style;?>><?php _e('Roles and Capabilities', $this->ID) ?></h2>
68
+
69
+ <form method="post" action="admin.php?page=<?php echo $this->ID ?>">
70
+ <?php wp_nonce_field('capsman-general-manager'); ?>
71
+ <fieldset>
72
+ <table id="akmin">
73
+ <tr>
74
+ <td class="content">
75
+ <dl>
76
+ <dt><?php printf(__('Capabilities for %s', $this->ID), $roles[$default]); ?></dt>
77
+ <dd>
78
+ <?php
79
+ if ( defined( 'PP_VERSION' ) ) {
80
+ if ( pp_get_option('display_hints') ) {
81
+ echo '<div>';
82
+ _e( 'Use this form to view and modify the capabilities WordPress natively associates with each role. Note:', $this->ID );
83
+ echo '</div><br />';
84
+ echo '<ul class="ul-disc"><li>';
85
+
86
+ if ( pp_get_option( 'advanced_options' ) )
87
+ $parenthetical = sprintf( __( 'see %1$sRole Usage%2$s: "Pattern Roles"', 'pp' ), "<a href='" . admin_url('admin.php?page=pp-role-usage') . "'>", '</a>' );
88
+ else
89
+ $parenthetical = sprintf( __( 'activate %1$sAdvanced settings%2$s, see Role Usage', 'pp' ), "<a href='" . admin_url('admin.php?page=pp-settings&pp_tab=advanced') . "'>", '</a>' );
90
+
91
+ printf( __( '"Posts" capabilities selected here also define type-specific role assignment for Permit Groups (%s).', $this->ID ), $parenthetical ) ;
92
+ echo '</li><li>';
93
+ printf( __( 'Capabilities for custom statuses can be manually added to a role here (see Conditions > Capability Mapping for applicable names). However, it is usually more convenient to use Permit Groups to assign a supplemental status-specific role.', $this->ID ), "<a href='" . admin_url('?page=pp-role-usage') . "'>", '</a>' ) ;
94
+ echo '</li></ul>';
95
+ }
96
+ } else {
97
+ echo '<div>';
98
+ _e( "Interested in further customizing editing or viewing access? Consider stepping up to <a href='#pp-more'>Press Permit</a>.", $this->ID );
99
+ echo '</div>';
100
+ ?>
101
+ <script type="text/javascript">
102
+ /* <![CDATA[ */
103
+ jQuery(document).ready( function($) {
104
+ $('a[href=#pp-more]').click( function() {
105
+ $('#pp_features').show();
106
+ return false;
107
+ });
108
+ $('a[href=#pp-hide]').click( function() {
109
+ $('#pp_features').hide();
110
+ return false;
111
+ });
112
+ });
113
+ /* ]]> */
114
+ </script>
115
+ <?php
116
+ echo '<br /><div style="display:none" id="pp_features"><ul class="ul-disc">';
117
+ echo '<li>';
118
+ _e( "Automatically define type-specific capabilities for your custom post types and taxonomies", $this->ID );
119
+ echo '</li>';
120
+ echo '<li>';
121
+ _e( "Supplemental per-type, per-category or per-page role assignments", $this->ID );
122
+ echo '</li>';
123
+ echo '<li>';
124
+ _e( "Custom Visibility statuses (require read_member_posts, read_premium_posts, etc.)", $this->ID );
125
+ echo '</li>';
126
+ echo '<li>';
127
+ _e( 'Custom Editability "statuses" - set alongside Visibility in Post and Category edit forms', $this->ID );
128
+ echo '</li>';
129
+ echo '<li>';
130
+ _e( "Custom Moderation statuses, enabling access-limited three tier moderation (Pending / Approved / Published)", $this->ID );
131
+ echo '</li>';
132
+ echo '<li>';
133
+ _e( "Grant Participant or Moderator access to specific bbPress forums or topics", $this->ID );
134
+ echo '</li>';
135
+ echo '<li>';
136
+ _e( "Grant supplemental page or category access to all members of a BuddyPress group", $this->ID );
137
+ echo '</li>';
138
+ echo '<li>';
139
+ _e( "WPML integration to mirror permissions to translations", $this->ID );
140
+ echo '</li>';
141
+ echo '<li>';
142
+ _e( "Professional support available", $this->ID );
143
+ echo '</li>';
144
+ echo '</ul><div>';
145
+ echo '<a href="http://presspermit.com">http://presspermit.com</a> &bull; <a href="#pp-hide">hide</a>';
146
+ echo '</div></div>';
147
+ }
148
+
149
+ $current = get_role($default);
150
+ $rcaps = $current->capabilities;
151
+
152
+ // ========= Begin Kevin B mod ===========
153
+ $is_administrator = current_user_can( 'administrator' );
154
+
155
+ $custom_types = get_post_types( array( '_builtin' => false ), 'names' );
156
+ $custom_tax = get_taxonomies( array( '_builtin' => false ), 'names' );
157
+
158
+ /*
159
+ if ( ( count($custom_types) || count($custom_tax) ) && ( $is_administrator || current_user_can( 'manage_pp_settings' ) ) ) {
160
+ $cap_properties[''] = array();
161
+ $force_distinct_ui = true;
162
+ }
163
+ */
164
+
165
+ $cap_properties['edit']['type'] = array( 'edit_posts', 'edit_others_posts' );
166
+ $cap_properties['edit']['type'] = array_merge( $cap_properties['edit']['type'], array( 'publish_posts', 'edit_published_posts', 'edit_private_posts' ) );
167
+
168
+ $cap_properties['edit']['taxonomy'] = array( 'manage_terms' );
169
+
170
+ if ( ! defined( 'PP_VERSION' ) )
171
+ $cap_properties['edit']['taxonomy'] = array_merge( $cap_properties['edit']['taxonomy'], array( 'edit_terms', 'assign_terms' ) );
172
+
173
+ $cap_properties['delete']['type'] = array( 'delete_posts', 'delete_others_posts' );
174
+ $cap_properties['delete']['type'] = array_merge( $cap_properties['delete']['type'], array( 'delete_published_posts', 'delete_private_posts' ) );
175
+
176
+ if ( ! defined( 'PP_VERSION' ) )
177
+ $cap_properties['delete']['taxonomy'] = array( 'delete_terms' );
178
+ else
179
+ $cap_properties['delete']['taxonomy'] = array();
180
+
181
+ $cap_properties['read']['type'] = array( 'read_private_posts' );
182
+ $cap_properties['read']['taxonomy'] = array();
183
+
184
+ $stati = get_post_stati( array( 'internal' => false ) );
185
+
186
+ //if ( count($stati) > 5 ) {
187
+ $cap_type_names = array(
188
+ '' => __( '&nbsp;', $this->ID ),
189
+ 'read' => __( 'Reading', $this->ID ),
190
+ 'edit' => __( 'Editing Capabilities', $this->ID ),
191
+ 'delete' => __( 'Deletion Capabilities', $this->ID )
192
+ );
193
+
194
+ //} else {
195
+
196
+ //}
197
+
198
+ $cap_tips = array(
199
+ 'read_private' => __( 'can read posts which are currently published with private visibility', $this->ID ),
200
+ 'edit' => __( 'has basic editing capability (but may need other capabilities based on post status and ownership)', $this->ID ),
201
+ 'edit_others' => __( 'can edit posts which were created by other users', $this->ID ),
202
+ 'edit_published' => __( 'can edit posts which are currently published', $this->ID ),
203
+ 'edit_private' => __( 'can edit posts which are currently published with private visibility', $this->ID ),
204
+ 'publish' => __( 'can make a post publicly visible', $this->ID ),
205
+ 'delete' => __( 'has basic deletion capability (but may need other capabilities based on post status and ownership)', $this->ID ),
206
+ 'delete_others' => __( 'can delete posts which were created by other users', $this->ID ),
207
+ 'delete_published' => __( 'can delete posts which are currently published', $this->ID ),
208
+ 'delete_private' => __( 'can delete posts which are currently published with private visibility', $this->ID ),
209
+ );
210
+
211
+ $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',
212
+ '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',
213
+ 'manage_categories'
214
+ );
215
+ $type_caps = array();
216
+
217
+ $defined = array();
218
+ $defined['type'] = get_post_types( array( 'public' => true ), 'object' );
219
+ $defined['taxonomy'] = get_taxonomies( array( 'public' => true ), 'object' );
220
+
221
+ // Press Permit grants attachment capabilities based on user's capabilities for the parent post
222
+ if ( defined( 'PP_VERSION' ) || defined('SCOPER_VERSION') )
223
+ unset( $defined['type']['attachment'] );
224
+
225
+ echo '<ul class="cme-listhoriz">';
226
+
227
+ // cap_types: read, edit, deletion
228
+ foreach( array_keys($cap_properties) as $cap_type ) {
229
+ echo '<li>';
230
+ echo '<h3>' . $cap_type_names[$cap_type] . '</h3>';
231
+ echo '<table class="cme-typecaps">';
232
+
233
+ foreach( array_keys($defined) as $item_type ) {
234
+ if ( ( 'delete' == $cap_type ) && ( 'taxonomy' == $item_type ) )
235
+ continue;
236
+
237
+ //if ( ! $cap_type ) {
238
+
239
+ //} else {
240
+ echo '<th></th>';
241
+
242
+ if ( ! count( $cap_properties[$cap_type][$item_type] ) )
243
+ continue;
244
+
245
+ // label cap properties
246
+ foreach( $cap_properties[$cap_type][$item_type] as $prop ) {
247
+ $prop = str_replace( '_posts', '', $prop );
248
+ $prop = str_replace( '_pages', '', $prop );
249
+ $prop = str_replace( '_terms', '', $prop );
250
+ $tip = ( isset( $cap_tips[$prop] ) ) ? "title='{$cap_tips[$prop]}'" : '';
251
+ $prop = str_replace( '_', '<br />', $prop );
252
+ echo "<th $tip>";
253
+ echo ucwords($prop);
254
+ echo '</th>';
255
+ }
256
+
257
+ foreach( $defined[$item_type] as $key => $type_obj ) {
258
+ $row = '<tr>';
259
+
260
+ if ( $cap_type ) {
261
+ if ( empty($force_distinct_ui) && empty( $cap_properties[$cap_type][$item_type] ) )
262
+ continue;
263
+
264
+ $row .= "<td><a class='cap_type' href='#toggle_type_caps'>" . $type_obj->labels->name . '</a></td>';
265
+
266
+ $display_row = ! empty($force_distinct_ui);
267
+
268
+ foreach( $cap_properties[$cap_type][$item_type] as $prop ) {
269
+ $row .= '<td>';
270
+ if ( ! empty($type_obj->cap->$prop) && ( in_array( $type_obj->name, array( 'post', 'page' ) )
271
+ || ! in_array( $type_obj->cap->$prop, $default_caps )
272
+ || ( ( 'manage_categories' == $type_obj->cap->$prop ) && ( 'manage_terms' == $prop ) && ( 'category' == $type_obj->name ) ) ) ) {
273
+ $cap_name = $type_obj->cap->$prop;
274
+
275
+ if ( $is_administrator || current_user_can($cap_name) ) {
276
+ if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
277
+ $title_text = sprintf( __( '%s: assigned by Permit Group', 'pp' ), $cap_name );
278
+ $disabled = 'disabled="disabled"';
279
+ $checked = ' checked="checked"';
280
+ } else {
281
+ $title_text = $cap_name;
282
+ $disabled = '';
283
+ $checked = checked(1, ! empty($rcaps[$cap_name]), false );
284
+ }
285
+
286
+ $row .= '<input id=caps[' . $cap_name . '] type="checkbox" title="' . $title_text . '" name="caps[' . $cap_name . ']" value="1" ' . $checked . $disabled . ' />';
287
+ $type_caps [$cap_name] = true;
288
+ $display_row = true;
289
+ }
290
+ }
291
+ $row .= '</td>';
292
+ }
293
+ }
294
+
295
+ if ( $display_row ) {
296
+ $row .= '</tr>';
297
+ echo $row;
298
+ }
299
+ }
300
+ //} // endif this iteration is for type caps checkbox display
301
+
302
+ } // end foreach item type
303
+
304
+ echo '</table>';
305
+
306
+ echo '</li>';
307
+ }
308
+
309
+ echo '</ul>';
310
+
311
+ // clicking on post type name toggles corresponding checkbox selections
312
+ ?>
313
+ <script type="text/javascript">
314
+ /* <![CDATA[ */
315
+ jQuery(document).ready( function($) {
316
+ $('a[href="#toggle_type_caps"]').click( function() {
317
+ var chks = $(this).closest('tr').find('input');
318
+ $(chks).attr( 'checked', ! $(chks).first().attr('checked') );
319
+ return false;
320
+ });
321
+ });
322
+ /* ]]> */
323
+ </script>
324
+ <?php
325
+
326
+ $core_caps = array_fill_keys( array( 'switch_themes', 'edit_themes', 'activate_plugins', 'edit_plugins', 'edit_users', 'edit_files', 'manage_options', 'moderate_comments',
327
+ 'manage_links', 'upload_files', 'import', 'unfiltered_html', 'read', 'delete_users', 'create_users', 'unfiltered_upload', 'edit_dashboard',
328
+ 'update_plugins', 'delete_plugins', 'install_plugins', 'update_themes', 'install_themes',
329
+ 'update_core', 'list_users', 'remove_users', 'add_users', 'promote_users', 'edit_theme_options', 'delete_themes', 'export' ), true );
330
+
331
+ ksort( $core_caps );
332
+
333
+ echo '<p>&nbsp;</p><h3>' . __( 'Other WordPress Core Capabilities', $this->ID ) . '</h3>';
334
+ echo '<table width="100%" class="form-table"><tr>';
335
+
336
+
337
+ $checks_per_row = $this->getOption( 'form-rows' );
338
+ $i = 0;
339
+
340
+ foreach( array_keys($core_caps) as $cap_name ) {
341
+ if ( ! $is_administrator && ! current_user_can($cap_name) )
342
+ continue;
343
+
344
+ if ( $i == $checks_per_row ) {
345
+ echo '</tr><tr>';
346
+ $i = 0;
347
+ }
348
+
349
+ if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
350
+ $title_text = sprintf( __( '%s: assigned by Permit Group', 'pp' ), $cap_name );
351
+ $disabled = 'disabled="disabled"';
352
+ $checked = ' checked="checked"';
353
+ } else {
354
+ $title_text = $cap_name;
355
+ $disabled = '';
356
+ $checked = checked(1, ! empty($rcaps[$cap_name]), false );
357
+ }
358
+
359
+ $class = ( ! empty($rcaps[$cap_name]) || ! empty($pp_metagroup_caps[$cap_name]) ) ? 'cap_yes' : 'cap_no';
360
+ echo "<td class='$class' title='$title_text'>";
361
+ echo ( '<input id=caps[' . $cap_name . '] type="checkbox" name="caps[' . $cap_name . ']" value="1" ' . $checked . $disabled . ' /> ' );
362
+ echo str_replace( '_', ' ', $cap_name );
363
+ echo '</td>';
364
+ $i++;
365
+ }
366
+
367
+ echo '</table>';
368
+
369
+ echo '<p>&nbsp;</p><h3>' . __( 'Additional Capabilities', $this->ID ) . '</h3>';
370
+
371
+ ?>
372
+ <table width='100%' class="form-table">
373
+ <tr>
374
+ <?php
375
+ $i = 0; $first_row = true;
376
+
377
+ foreach ( $this->capabilities as $cap_name => $cap ) :
378
+ if ( isset( $type_caps[$cap_name] ) || isset($core_caps[$cap_name]) )
379
+ continue;
380
+
381
+ if ( ! $is_administrator && ! current_user_can($cap_name) )
382
+ continue;
383
+
384
+ // ============ End Kevin B mod ===============
385
+
386
+ // Levels are not shown.
387
+ if ( preg_match( '/^level_(10|[0-9])$/i', $cap_name ) ) {
388
+ continue;
389
+ }
390
+
391
+ if ( $i == $checks_per_row ) {
392
+ echo '</tr><tr>';
393
+ $i = 0; $first_row = false;
394
+ }
395
+ //$style = ( ! empty($rcaps[$cap_name]) || ! empty($pp_metagroup_caps[$cap_name]) ) ? 'color:green;font-weight:bold;' : 'color:red;';
396
+ $class = ( ! empty($rcaps[$cap_name]) || ! empty($pp_metagroup_caps[$cap_name]) ) ? 'cap_yes' : 'cap_no';
397
+
398
+ if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
399
+ $title_text = sprintf( __( '%s: assigned by Permit Group', 'pp' ), $cap_name );
400
+ $disabled = 'disabled="disabled"';
401
+ $checked = ' checked="checked"';
402
+ } else {
403
+ $title_text = $cap_name;
404
+ $disabled = '';
405
+ $checked = checked(1, ! empty($rcaps[$cap_name]), false );
406
+ }
407
+
408
+ if ( 'manage_capabilities' == $cap_name ) {
409
+ if ( ! current_user_can('administrator') ) {
410
+ continue;
411
+ } elseif ( 'administrator' == $default ) {
412
+ $lock_manage_caps_capability = true;
413
+ $disabled = 'disabled="disabled"';
414
+ }
415
+ }
416
+ ?>
417
+ <td class="<?php echo $class; ?>"><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;?> />
418
+ <?php
419
+ echo $cap;
420
+ ?></label></td>
421
+ <?php
422
+ $i++;
423
+ endforeach;
424
+
425
+ if ( ! empty($lock_manage_caps_capability) ) {
426
+ echo '<input type="hidden" name="caps[manage_capabilities]" value="1" />';
427
+ }
428
+
429
+ if ( $i == $checks_per_row ) {
430
+ echo '</tr><tr>';
431
+ $i = 0;
432
+ }
433
+
434
+ $level = ak_caps2level($rcaps);
435
+ ?>
436
+ <td><?php _e('Level:', $this->ID) ;?><select name="level">
437
+ <?php for ( $l = $this->max_level; $l >= 0; $l-- ) {?>
438
+ <option value="<?php echo $l; ?>" style="text-align:right;"<?php selected($level, $l); ?>>&nbsp;<?php echo $l; ?>&nbsp;</option>
439
+ <?php }
440
+ ++$i;
441
+
442
+ if ( ! $first_row ) {
443
+ // Now close a wellformed table
444
+ for ( $i; $i < $checks_per_row; $i++ ){
445
+ echo '<td>&nbsp;</td>';
446
+ }
447
+ }
448
+ ?>
449
+ </select>
450
+
451
+ </tr>
452
+ </table>
453
+
454
+ <br />
455
+ <?php if ( ! defined('PP_VERSION') || pp_get_option('display_hints') ) :?>
456
+ <div class="cme-subtext">
457
+ <?php _e( 'Note: Underscores replace spaces in stored capability name ("edit users" => "edit_users").', 'pp' ); ?>
458
+ </div>
459
+ <?php endif;?>
460
+ </span>
461
+
462
+ </dd>
463
+ </dl>
464
+
465
+ <p class="submit">
466
+ <input type="hidden" name="action" value="update" />
467
+ <input type="hidden" name="current" value="<?php echo $default; ?>" />
468
+ <input type="submit" name="Save" value="<?php _e('Save Changes', $this->ID) ?>" class="button-primary" /> &nbsp;
469
+ <?php if ( current_user_can('administrator') && 'administrator' != $default ) : ?>
470
+ <a class="ak-delete" title="<?php echo esc_attr(__('Delete this role', $this->ID)) ?>" 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.", $this->ID), $roles[$default])); ?>') ) { return true;}return false;"><?php _e('Delete Role', $this->ID)?></a>
471
+ <?php endif; ?>
472
+ </p>
473
+
474
+ <br />
475
+ <?php ak_admin_footer($this->ID, 2009); ?>
476
+
477
+ </td>
478
+ <td class="sidebar">
479
+ <?php ak_admin_authoring($this->ID); ?>
480
+
481
+ <dl>
482
+ <dt><?php defined('WPLANG') && WPLANG ? _e('Select New Role', $this->ID) : _e('Select Role to View / Edit', $this->ID); ?></dt>
483
+ <dd style="text-align:center;">
484
+ <p><select name="role">
485
+ <?php
486
+ foreach ( $roles as $role => $name ) {
487
+ echo '<option value="' . $role .'"'; selected($default, $role); echo '> ' . $name . ' &nbsp;</option>';
488
+ }
489
+ ?>
490
+ </select><span style="margin-left:20px"><input type="submit" name="Load" value="<?php defined('WPLANG') && WPLANG ? _e('Change', $this->ID) : _e('Load', $this->ID) ?>" class="button" /></span></p>
491
+ </dd>
492
+ </dl>
493
+
494
+ <dl>
495
+ <dt><?php _e('Create New Role', $this->ID); ?></dt>
496
+ <dd style="text-align:center;">
497
+ <p><input type="text" name="create-name"" class="regular-text" placeholder="<?php _e('Name of new role', $this->ID) ?>" /><br />
498
+ <input type="submit" name="Create" value="<?php _e('Create', $this->ID) ?>" class="button" /></p>
499
+ </dd>
500
+ </dl>
501
+
502
+ <dl>
503
+ <dt><?php defined('WPLANG') && WPLANG ? _e('Copy this role to', $this->ID) : printf( __('Copy %s Role', $this->ID), $roles[$default]); ?></dt>
504
+ <dd style="text-align:center;">
505
+ <p><input type="text" name="copy-name" class="regular-text" placeholder="<?php _e('Name of copied role', $this->ID) ?>" /><br />
506
+ <input type="submit" name="Copy" value="<?php _e('Copy', $this->ID) ?>" class="button" /></p>
507
+ </dd>
508
+ </dl>
509
+
510
+ <dl>
511
+ <dt><?php _e('Add Capability', $this->ID); ?></dt>
512
+ <dd style="text-align:center;">
513
+ <p><input type="text" name="capability-name" class="regular-text" placeholder="<?php _e('capability name', $this->ID) ?>" /><br />
514
+ <input type="submit" name="AddCap" value="<?php _e('Add to role', $this->ID) ?>" class="button" /></p>
515
+ </dd>
516
+ </dl>
517
+
518
+ <?php if ( defined('PP_VERSION') && current_user_can( 'pp_manage_settings' ) ) :?>
519
+ <dl>
520
+ <dt><?php _e('Force Type-Specific Capabilities', $this->ID); ?></dt>
521
+ <dd style="text-align:center;">
522
+ <?php
523
+ $caption = __( 'Force unique capability names for:', 'pp' );
524
+ echo "<p>$caption</p><table style='width:100%'><tr>";
525
+
526
+ foreach( array_keys($defined) as $item_type ) {
527
+ echo '<td style="width:50%">';
528
+ $option_name = ( 'taxonomy' == $item_type ) ? 'enabled_taxonomies' : 'enabled_post_types';
529
+
530
+ $enabled = pp_get_option( $option_name );
531
+
532
+ foreach( $defined[$item_type] as $key => $type_obj ) {
533
+ if ( ! $key )
534
+ continue;
535
+
536
+ $id = "$option_name-" . $key;
537
+ ?>
538
+ <div style="text-align:left">
539
+ <?php if ( 'nav_menu' == $key ) :?>
540
+ <input name="<?php echo($id);?>" type="hidden" id="<?php echo($id);?>" value="1" />
541
+ <input name="<?php echo("{$option_name}-options[]");?>" type="hidden" value="<?php echo($key)?>" />
542
+
543
+ <?php else: ?>
544
+ <div class="agp-vspaced_input">
545
+ <label for="<?php echo($id);?>" title="<?php echo($key);?>">
546
+ <input name="<?php echo("{$option_name}-options[]");?>" type="hidden" value="<?php echo($key)?>" />
547
+ <input name="<?php echo($id);?>" type="checkbox" id="<?php echo($id);?>" value="1" <?php checked('1', isset($enabled[$key]) );?> /> <?php echo($type_obj->label);?>
548
+
549
+ <?php
550
+ echo ('</label></div>');
551
+
552
+ endif; // displaying checkbox UI
553
+
554
+ echo '</div>';
555
+ }
556
+ echo '</td>';
557
+ }
558
+ ?>
559
+ </tr></table>
560
+
561
+ <div class="cme-subtext">
562
+ <?php
563
+ if ( pp_get_option( 'display_hints' ) ) {
564
+ _e( '(PP Filtered Post Types, Taxonomies)', 'pp' );
565
+ }
566
+ ?>
567
+ </div>
568
+
569
+ <input type="submit" name="update_filtered_types" value="<?php _e('Update', $this->ID) ?>" class="button" />
570
+ </dd>
571
+ </dl>
572
+ <?php endif;?>
573
+ </td>
574
+ </tr>
575
+ </table>
576
+ </fieldset>
577
+ </form>
578
+ </div>
includes/author-widget.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Admin Pages Quthoring widget.
4
+ *
5
+ * @author Jordi Canals, Kevin Behrens
6
+ * @copyright Copyright (C) 2009, 2010 Jordi Canals; modifications Copyright (C) 2012 Kevin Behrens
7
+ * @license GNU General Public License version 2
8
+ * @link http://agapetry.net
9
+ * @package Alkivia
10
+ * @subpackage CapsMan
11
+ *
12
+
13
+ Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
14
+
15
+ This program is free software; you can redistribute it and/or
16
+ modify it under the terms of the GNU General Public License
17
+ version 2 as published by the Free Software Foundation.
18
+
19
+ This program is distributed in the hope that it will be useful,
20
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
+ GNU General Public License for more details.
23
+
24
+ You should have received a copy of the GNU General Public License
25
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
26
+ */
27
+ ?>
28
+
29
+ <dl>
30
+ <dt>Capability Manager</dt>
31
+ <dd>
32
+ <ul>
33
+ <li><a href="http://agapetry.com" class="capsman" target="_blank"><?php _e('Plugin Homepage', $this->ID); ?></a></li>
34
+ <li><a href="http://presspermit.com" class="docs" target="_blank"><?php _e('Documentation', $this->ID); ?></a></li>
35
+ <li><a href="http://agapetry.net/forum" class="help" target="_blank"><?php _e('Support Forum', $this->ID); ?></a></li>
36
+ <li><a href="http://agapetry.com" class="h-ome" target="_blank"><?php _e('Author Homepage', $this->ID)?></a></li>
37
+ <li><a href="http://agapetry.com" class="donate" target="_blank"><?php _e('Help donating', $this->ID)?></a></li>
38
+ </ul>
39
+ </dd>
40
+ </dl>
includes/backup.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Capability Manager Backup Tool.
4
+ * Provides backup and restore functionality to Capability Manager.
5
+ *
6
+ * @version $Rev: 198515 $
7
+ * @author Jordi Canals
8
+ * @copyright Copyright (C) 2009, 2010 Jordi Canals
9
+ * @license GNU General Public License version 2
10
+ * @link http://alkivia.org
11
+ * @package Alkivia
12
+ * @subpackage CapsMan
13
+ *
14
+
15
+ Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
16
+
17
+ This program is free software; you can redistribute it and/or
18
+ modify it under the terms of the GNU General Public License
19
+ version 2 as published by the Free Software Foundation.
20
+
21
+ This program is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
+
26
+ You should have received a copy of the GNU General Public License
27
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
28
+ */
29
+
30
+ ?>
31
+ <div class="wrap">
32
+ <div id="icon-capsman-admin" class="icon32"></div>
33
+ <h2><?php _e('Backup Tool for Capability Manager', $this->ID) ?></h2>
34
+
35
+ <form method="post" action="tools.php?page=<?php echo $this->ID ?>-tool">
36
+ <?php wp_nonce_field('capsman-backup-tool'); ?>
37
+ <fieldset>
38
+ <table id="akmin">
39
+ <tr>
40
+ <td class="content">
41
+ <dl>
42
+ <dt><?php _e('Backup and Restore', $this->ID); ?></dt>
43
+ <dd>
44
+ <table width='100%' class="form-table">
45
+ <tr>
46
+ <th scope="row"><?php _e('Select action:', $this->ID); ?></th>
47
+ <td>
48
+ <select name="action">
49
+ <option value="backup"> <?php _e('Backup roles and capabilities', $this->ID); ?> </option>
50
+ <option value="restore"> <?php _e('Restore last saved backup', $this->ID); ?> </option>
51
+ </select> &nbsp;
52
+ <input type="submit" name="Perform" value="<?php _e('Do Action', $this->ID) ?>" class="button-primary" />
53
+ </td>
54
+ </tr>
55
+ </table>
56
+ </dd>
57
+ </dl>
58
+
59
+ <dl>
60
+ <dt><?php _e('Reset WordPress Defaults', $this->ID)?></dt>
61
+ <dd>
62
+ <p style="text-align:center;"><strong><span style="color:red;"><?php _e('WARNING:', $this->ID); ?></span> <?php _e('Reseting default Roles and Capabilities will set them to the WordPress install defaults.', $this->ID); ?></strong><br />
63
+ <?php _e('If you have installed any plugin that adds new roles or capabilities, these will be lost.', $this->ID)?><br />
64
+ <strong><?php _e('It is recommended to use this only as a last resource!')?></strong></p>
65
+ <p style="text-align:center;"><a class="ak-delete" title="<?php echo esc_attr(__('Reset Roles and Capabilities to WordPress defaults', $this->ID)) ?>" 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.", $this->ID)); ?>') ) { return true;}return false;"><?php _e('Reset to WordPress defaults', $this->ID)?></a>
66
+
67
+ </dd>
68
+ </dl>
69
+
70
+ <?php ak_admin_footer($this->ID, 2009); ?>
71
+
72
+ </td>
73
+
74
+ <td class="sidebar">
75
+ <?php ak_admin_authoring($this->ID); ?>
76
+ </td>
77
+ </tr>
78
+ </table>
79
+ </fieldset>
80
+ </form>
81
+ </div>
includes/manager.php ADDED
@@ -0,0 +1,704 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Capability Manager.
4
+ * Plugin to create and manage roles and capabilities.
5
+ *
6
+ * @version $Rev: 199485 $
7
+ * @author Jordi Canals
8
+ * @copyright Copyright (C) 2009, 2010 Jordi Canals; Copyright (C) 2012 Kevin Behrens
9
+ * @license GNU General Public License version 2
10
+ * @link http://agapetry.net
11
+ *
12
+
13
+ Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
14
+ Modifications Copyright 2012 Kevin Behrens <kevin@agapetry.net>
15
+
16
+ This program is free software; you can redistribute it and/or
17
+ modify it under the terms of the GNU General Public License
18
+ version 2 as published by the Free Software Foundation.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
+
29
+ include_once ( AK_CLASSES . '/abstract/plugin.php' );
30
+
31
+ add_action( 'init', 'cme_update_pp_usage' ); // update early so resulting post type cap changes are applied for this request's UI construction
32
+
33
+ function cme_update_pp_usage() {
34
+ if ( defined( 'PP_VERSION' ) && current_user_can( 'pp_manage_settings' ) ) {
35
+ static $updated;
36
+ if ( ! empty($updated) ) { return true; }
37
+
38
+ // update Press Permit "Filtered Post Types". This determines whether type-specific capability definitions are forced
39
+ $options = array( 'enabled_post_types', 'enabled_taxonomies' );
40
+
41
+ foreach( $options as $option_basename ) {
42
+ if ( ! isset( $_POST["{$option_basename}-options"] ) )
43
+ continue;
44
+
45
+ $unselected = $value = array();
46
+
47
+ foreach( $_POST["{$option_basename}-options"] as $key ) {
48
+ if ( empty( $_POST["{$option_basename}-$key"] ) )
49
+ $unselected[$key] = true;
50
+ else
51
+ $value[$key] = true;
52
+ }
53
+
54
+ if ( $current = pp_get_option( $option_basename ) ) {
55
+ if ( $current = array_diff_key( $current, $unselected ) )
56
+ $value = array_merge( $value, $current ); // retain setting for any types which were previously enabled for filtering but are currently not registered
57
+ }
58
+
59
+ $value = stripslashes_deep($value);
60
+ pp_update_option( $option_basename, $value );
61
+
62
+ $updated = true;
63
+ }
64
+
65
+ if ( $updated ) {
66
+ pp_refresh_options();
67
+ }
68
+
69
+ return $updated;
70
+ }
71
+ }
72
+
73
+
74
+ /**
75
+ * Class cmanCapsManager.
76
+ * Sets the main environment for all Capability Manager components.
77
+ *
78
+ * @author Jordi Canals, Kevin Behrens
79
+ * @link http://agapetry.net
80
+ */
81
+ class CapabilityManager extends akPluginAbstract
82
+ {
83
+ /**
84
+ * Array with all capabilities to be managed. (Depends on user caps).
85
+ * The array keys are the capability, the value is its screen name.
86
+ * @var array
87
+ */
88
+ private $capabilities = array();
89
+
90
+ /**
91
+ * Array with roles that can be managed. (Depends on user roles).
92
+ * The array keys are the role name, the value is its translated name.
93
+ * @var array
94
+ */
95
+ private $roles = array();
96
+
97
+ /**
98
+ * Current role we are managing
99
+ * @var string
100
+ */
101
+ private $current;
102
+
103
+ /**
104
+ * Maximum level current manager can assign to a user.
105
+ * @var int
106
+ */
107
+ private $max_level;
108
+
109
+ /**
110
+ * Creates some filters at module load time.
111
+ *
112
+ * @see akModuleAbstract#moduleLoad()
113
+ *
114
+ * @return void
115
+ */
116
+ protected function moduleLoad ()
117
+ {
118
+ // Only roles that a user can administer can be assigned to others.
119
+ add_filter('editable_roles', array($this, 'filterEditRoles'));
120
+
121
+ // Users with roles that cannot be managed, are not allowed to be edited.
122
+ add_filter('map_meta_cap', array(&$this, 'filterUserEdit'), 10, 4);
123
+ }
124
+
125
+ /**
126
+ * Sets default settings values.
127
+ *
128
+ * @return void
129
+ */
130
+ protected function defaultOptions ()
131
+ {
132
+ $this->generateSysNames();
133
+
134
+ return array(
135
+ 'form-rows' => 5,
136
+ 'syscaps' => $this->capabilities
137
+ );
138
+ }
139
+
140
+ /**
141
+ * Activates the plugin and sets the new capability 'Manage Capabilities'
142
+ *
143
+ * @return void
144
+ */
145
+ protected function pluginActivate ()
146
+ {
147
+ $this->setAdminCapability();
148
+ }
149
+
150
+ /**
151
+ * Updates Capability Manager to a new version
152
+ *
153
+ * @return void
154
+ */
155
+ protected function pluginUpdate ( $version )
156
+ {
157
+ $backup = get_option($this->ID . '_backup');
158
+ if ( false === $backup ) { // No previous backup found. Save it!
159
+ global $wpdb;
160
+ $roles = get_option($wpdb->prefix . 'user_roles');
161
+ update_option($this->ID . '_backup', $roles);
162
+ }
163
+ }
164
+
165
+ /**
166
+ * Adds admin panel menus. (At plugins loading time. This is before plugins_loaded).
167
+ * User needs to have 'manage_capabilities' to access this menus.
168
+ * This is set as an action in the parent class constructor.
169
+ *
170
+ * @hook action admin_menu
171
+ * @return void
172
+ */
173
+ public function adminMenus ()
174
+ {
175
+ // First we check if user is administrator and can 'manage_capabilities'.
176
+ if ( current_user_can('administrator') && ! current_user_can('manage_capabilities') ) {
177
+ $this->setAdminCapability();
178
+ }
179
+
180
+ if ( defined( 'PP_VERSION' ) ) { // Press Permit integrates into Permissions menu
181
+ add_action( 'pp_permissions_menu', array( &$this, 'pp_menu' ) );
182
+ } else {
183
+ add_users_page( __('Capability Manager', $this->ID), __('Capabilities', $this->ID), 'manage_capabilities', $this->ID, array($this, 'generalManager'));
184
+ }
185
+
186
+ add_management_page(__('Capability Manager', $this->ID), __('Capability Manager', $this->ID), 'manage_capabilities', $this->ID . '-tool', array($this, 'backupTool'));
187
+ }
188
+
189
+ public function pp_menu() {
190
+ add_submenu_page( $GLOBALS['pp_admin']->get_menu('options'), __('Capability Manager', $this->ID), __('Role Capabilities', $this->ID), 'manage_capabilities', $this->ID, array($this, 'generalManager') );
191
+ }
192
+
193
+ /**
194
+ * Sets the 'manage_capabilities' cap to the administrator role.
195
+ *
196
+ * @return void
197
+ */
198
+ private function setAdminCapability ()
199
+ {
200
+ $admin = get_role('administrator');
201
+ $admin->add_cap('manage_capabilities');
202
+ }
203
+
204
+ /**
205
+ * Filters roles that can be shown in roles list.
206
+ * This is mainly used to prevent an user admin to create other users with
207
+ * higher capabilities.
208
+ *
209
+ * @hook 'editable_roles' filter.
210
+ *
211
+ * @param $roles List of roles to check.
212
+ * @return array Restircted roles list
213
+ */
214
+ function filterEditRoles ( $roles )
215
+ {
216
+ $this->generateNames();
217
+ $valid = array_keys($this->roles);
218
+
219
+ foreach ( $roles as $role => $caps ) {
220
+ if ( ! in_array($role, $valid) ) {
221
+ unset($roles[$role]);
222
+ }
223
+ }
224
+
225
+ return $roles;
226
+ }
227
+
228
+ /**
229
+ * Checks if a user can be edited or not by current administrator.
230
+ * Returns array('do_not_allow') if user cannot be edited.
231
+ *
232
+ * @hook 'map_meta_cap' filter
233
+ *
234
+ * @param array $caps Current user capabilities
235
+ * @param string $cap Capability to check
236
+ * @param int $user_id Current user ID
237
+ * @param array $args For our purpose, we receive edited user id at $args[0]
238
+ * @return array Allowed capabilities.
239
+ */
240
+ function filterUserEdit ( $caps, $cap, $user_id, $args )
241
+ {
242
+ if ( 'edit_user' != $cap || $user_id == (int) $args[0] ) {
243
+ return $caps;
244
+ }
245
+
246
+ $this->generateNames();
247
+ $valid = array_keys($this->roles);
248
+
249
+ $user = new WP_User( (int) $args[0] );
250
+ foreach ( $user->roles as $role ) {
251
+ if ( ! in_array($role, $valid) ) {
252
+ $caps = array('do_not_allow');
253
+ break;
254
+ }
255
+ }
256
+
257
+ return $caps;
258
+ }
259
+
260
+ /**
261
+ * Manages global settings admin.
262
+ *
263
+ * @hook add_submenu_page
264
+ * @return void
265
+ */
266
+ function generalManager ()
267
+ {
268
+ if ( ! current_user_can('manage_capabilities') && ! current_user_can('administrator') ) {
269
+ // TODO: Implement exceptions.
270
+ wp_die('<strong>' .__('What do you think you\'re doing?!?', $this->ID) . '</strong>');
271
+ }
272
+
273
+ global $wp_roles;
274
+ $this->current = get_option('default_role'); // By default we manage the default role.
275
+
276
+ if ( 'POST' == $_SERVER['REQUEST_METHOD'] ) {
277
+ check_admin_referer('capsman-general-manager');
278
+ $this->processAdminGeneral();
279
+ }
280
+
281
+ $this->generateNames();
282
+ $roles = array_keys($this->roles);
283
+
284
+ if ( isset($_GET['action']) && 'delete' == $_GET['action']) {
285
+ check_admin_referer('delete-role_' . $_GET['role']);
286
+ $this->adminDeleteRole();
287
+ }
288
+
289
+ if ( ! in_array($this->current, $roles) ) { // Current role has been deleted.
290
+ $this->current = array_shift($roles);
291
+ }
292
+
293
+ include ( AK_CMAN_LIB . '/admin.php' );
294
+ }
295
+
296
+ /**
297
+ * Manages backup, restore and resset roles and capabilities
298
+ *
299
+ * @hook add_management_page
300
+ * @return void
301
+ */
302
+ function backupTool ()
303
+ {
304
+ if ( ! current_user_can('manage_capabilities') && ! current_user_can('administrator') ) {
305
+ // TODO: Implement exceptions.
306
+ wp_die('<strong>' .__('What do you think you\'re doing?!?', $this->ID) . '</strong>');
307
+ }
308
+
309
+ if ( 'POST' == $_SERVER['REQUEST_METHOD'] ) {
310
+ check_admin_referer('capsman-backup-tool');
311
+ $this->processBackupTool();
312
+ }
313
+
314
+ if ( isset($_GET['action']) && 'reset-defaults' == $_GET['action']) {
315
+ check_admin_referer('capsman-reset-defaults');
316
+ $this->backupToolReset();
317
+ }
318
+
319
+ include ( AK_CMAN_LIB . '/backup.php' );
320
+ }
321
+
322
+ /**
323
+ * Processes and saves the changes in the general capabilities form.
324
+ *
325
+ * @return void
326
+ */
327
+ private function processAdminGeneral ()
328
+ {
329
+ global $wp_roles;
330
+
331
+ if (! isset($_POST['action']) || 'update' != $_POST['action'] ) {
332
+ // TODO: Implement exceptions. This must be a fatal error.
333
+ ak_admin_error(__('Bad form Received', $this->ID));
334
+ return;
335
+ }
336
+
337
+ $post = stripslashes_deep($_POST);
338
+ if ( empty ($post['caps']) ) {
339
+ $post['caps'] = array();
340
+ }
341
+
342
+ $this->saveRoleCapabilities($post['current'], $post['caps'], $post['level']);
343
+ $this->current = $post['current'];
344
+
345
+ // Select a new role.
346
+ if ( isset($post['Load']) && __('Load', $this->ID) == $post['Load'] ) {
347
+ $this->current = $post['role'];
348
+
349
+ // Create a new role.
350
+ } elseif ( isset($post['Create']) && __('Create', $this->ID) == $post['Create'] ) {
351
+ if ( $newrole = $this->createRole($post['create-name']) ) {
352
+ ak_admin_notify(__('New role created.', $this->ID));
353
+ $this->current = $newrole;
354
+ } else {
355
+ if ( empty($post['create-name']) && ( ! defined('WPLANG') || ! WPLANG ) )
356
+ ak_admin_error(__('Error: No role name specified.', $this->ID));
357
+ else
358
+ ak_admin_error(__('Error: Failed creating the new role.', $this->ID));
359
+ }
360
+
361
+ // Copy current role to a new one.
362
+ } elseif ( isset($post['Copy']) && __('Copy', $this->ID) == $post['Copy'] ) {
363
+ $current = get_role($post['current']);
364
+ if ( $newrole = $this->createRole($post['copy-name'], $current->capabilities) ) {
365
+ ak_admin_notify(__('New role created.', $this->ID));
366
+ $this->current = $newrole;
367
+ } else {
368
+ if ( empty($post['copy-name']) && ( ! defined('WPLANG') || ! WPLANG ) )
369
+ ak_admin_error(__('Error: No role name specified.', $this->ID));
370
+ else
371
+ ak_admin_error(__('Error: Failed creating the new role.', $this->ID));
372
+ }
373
+
374
+ // Save role changes. Already saved at start with self::saveRoleCapabilities().
375
+ }elseif ( isset($post['Save']) && __('Save Changes', $this->ID) == $post['Save'] ) {
376
+ ak_admin_notify(__('New capabilities saved.', $this->ID));
377
+
378
+ // Create New Capability and adds it to current role.
379
+ } elseif ( isset($post['AddCap']) && __('Add to role', $this->ID) == $post['AddCap'] ) {
380
+ $role = get_role($post['current']);
381
+
382
+ if ( $newname = $this->createNewName($post['capability-name']) ) {
383
+ $role->add_cap($newname['name']);
384
+ ak_admin_notify(__('New capability added to role.', $this->ID));
385
+ } else {
386
+ ak_admin_error(__('Incorrect capability name.', $this->ID));
387
+ }
388
+
389
+ } elseif ( isset($post['update_filtered_types']) && __('Update', $this->ID) == $post['update_filtered_types'] ) {
390
+ if ( cme_update_pp_usage() ) {
391
+ ak_admin_notify(__('Capability settings saved.', $this->ID));
392
+ } else {
393
+ ak_admin_error(__('Error saving capability settings.', $this->ID));
394
+ }
395
+ } else {
396
+ // TODO: Implement exceptions. This must be a fatal error.
397
+ ak_admin_error(__('Bad form received.', $this->ID));
398
+ }
399
+ }
400
+
401
+ /**
402
+ * Processes backups and restores.
403
+ *
404
+ * @return void
405
+ */
406
+ private function processBackupTool ()
407
+ {
408
+ if ( isset($_POST['Perform']) ) {
409
+ global $wpdb;
410
+ $wp_roles = $wpdb->prefix . 'user_roles';
411
+ $cm_roles = $this->ID . '_backup';
412
+
413
+ switch ( $_POST['action'] ) {
414
+ case 'backup':
415
+ $roles = get_option($wp_roles);
416
+ update_option($cm_roles, $roles);
417
+ ak_admin_notify(__('New backup saved.', $this->ID));
418
+ break;
419
+ case 'restore':
420
+ $roles = get_option($cm_roles);
421
+ if ( $roles ) {
422
+ update_option($wp_roles, $roles);
423
+ ak_admin_notify(__('Roles and Capabilities restored from last backup.', $this->ID));
424
+ } else {
425
+ ak_admin_error(__('Restore failed. No backup found.', $this->ID));
426
+ }
427
+ break;
428
+ }
429
+ }
430
+ }
431
+
432
+ /**
433
+ * Deletes a role.
434
+ * The role comes from the $_GET['role'] var and the nonce has already been checked.
435
+ * Default WordPress role cannot be deleted and if trying to do it, throws an error.
436
+ * Users with the deleted role, are moved to the WordPress default role.
437
+ *
438
+ * @return void
439
+ */
440
+ private function adminDeleteRole ()
441
+ {
442
+ global $wpdb;
443
+
444
+ $this->current = $_GET['role'];
445
+ $default = get_option('default_role');
446
+ if ( $default == $this->current ) {
447
+ ak_admin_error(sprintf(__('Cannot delete default role. You <a href="%s">have to change it first</a>.', $this->ID), 'options-general.php'));
448
+ return;
449
+ }
450
+
451
+ $query = "SELECT ID FROM {$wpdb->usermeta} INNER JOIN {$wpdb->users} "
452
+ . "ON {$wpdb->usermeta}.user_id = {$wpdb->users}.ID "
453
+ . "WHERE meta_key='{$wpdb->prefix}capabilities' AND meta_value LIKE '%{$this->current}%';";
454
+
455
+ $users = $wpdb->get_results($query);
456
+ $count = count($users);
457
+
458
+ foreach ( $users as $u ) {
459
+ $user = new WP_User($u->ID);
460
+ if ( $user->has_cap($this->current) ) { // Check again the user has the deleting role
461
+ $user->set_role($default);
462
+ }
463
+ }
464
+
465
+ remove_role($this->current);
466
+ unset($this->roles[$this->current]);
467
+
468
+ ak_admin_notify(sprintf(__('Role has been deleted. %1$d users moved to default role %2$s.', $this->ID), $count, $this->roles[$default]));
469
+ $this->current = $default;
470
+ }
471
+
472
+ /**
473
+ * Resets roles to WordPress defaults.
474
+ *
475
+ * @return void
476
+ */
477
+ private function backupToolReset ()
478
+ {
479
+ require_once(ABSPATH . 'wp-admin/includes/schema.php');
480
+
481
+ if ( ! function_exists('populate_roles') ) {
482
+ ak_admin_error(__('Needed function to create default roles not found!', $this->ID));
483
+ return;
484
+ }
485
+
486
+ $roles = array_keys($this->roles);
487
+ foreach ( $roles as $role) {
488
+ remove_role($role);
489
+ }
490
+
491
+ populate_roles();
492
+ $this->setAdminCapability();
493
+
494
+ $msg = __('Roles and Capabilities reset to WordPress defaults', $this->ID);
495
+
496
+ if ( function_exists( 'pp_populate_roles' ) ) {
497
+ pp_populate_roles();
498
+ } else {
499
+ // force PP to repopulate roles
500
+ if ( $pp_ver = get_option( 'pp_version', true ) ) {
501
+ $pp_ver['version'] = ( preg_match( "/dev|alpha|beta|rc/i", $pp_ver['version'] ) ) ? '0.1-beta' : 0.1;
502
+ } else {
503
+ $pp_ver = array( 'version' => '0.1', 'db_version' => '1.0' );
504
+ }
505
+
506
+ update_option( 'pp_version', $pp_ver );
507
+ delete_option( 'ppperm_added_role_caps_10beta' );
508
+ }
509
+
510
+ ak_admin_notify($msg);
511
+ }
512
+
513
+ /**
514
+ * Callback function to create names.
515
+ * Replaces underscores by spaces and uppercases the first letter.
516
+ *
517
+ * @access private
518
+ * @param string $cap Capability name.
519
+ * @return string The generated name.
520
+ */
521
+ function _capNamesCB ( $cap )
522
+ {
523
+ $cap = str_replace('_', ' ', $cap);
524
+ //$cap = ucfirst($cap);
525
+
526
+ return $cap;
527
+ }
528
+
529
+ /**
530
+ * Generates an array with the system capability names.
531
+ * The key is the capability and the value the created screen name.
532
+ *
533
+ * @uses self::_capNamesCB()
534
+ * @return void
535
+ */
536
+ private function generateSysNames ()
537
+ {
538
+ $this->max_level = 10;
539
+ $this->roles = ak_get_roles(true);
540
+ $caps = array();
541
+
542
+ foreach ( array_keys($this->roles) as $role ) {
543
+ $role_caps = get_role($role);
544
+ $caps = array_merge($caps, $role_caps->capabilities);
545
+ }
546
+
547
+ $keys = array_keys($caps);
548
+ $names = array_map(array($this, '_capNamesCB'), $keys);
549
+ $this->capabilities = array_combine($keys, $names);
550
+
551
+ $sys_caps = $this->getOption('syscaps');
552
+ if ( is_array($sys_caps) ) {
553
+ $this->capabilities = array_merge($sys_caps, $this->capabilities);
554
+ }
555
+
556
+ asort($this->capabilities);
557
+ }
558
+
559
+ /**
560
+ * Generates an array with the user capability names.
561
+ * If user has 'administrator' role, system roles are generated.
562
+ * The key is the capability and the value the created screen name.
563
+ * A user cannot manage more capabilities that has himself (Except for administrators).
564
+ *
565
+ * @uses self::_capNamesCB()
566
+ * @return void
567
+ */
568
+ private function generateNames ()
569
+ {
570
+ if ( current_user_can('administrator') ) {
571
+ $this->generateSysNames();
572
+ } else {
573
+ global $user_ID;
574
+ $user = new WP_User($user_ID);
575
+ $this->max_level = ak_caps2level($user->allcaps);
576
+
577
+ $keys = array_keys($user->allcaps);
578
+ $names = array_map(array($this, '_capNamesCB'), $keys);
579
+ $this->capabilities = array_combine($keys, $names);
580
+
581
+ $roles = ak_get_roles(true);
582
+ unset($roles['administrator']);
583
+
584
+ foreach ( $user->roles as $role ) { // Unset the roles from capability list.
585
+ unset ( $this->capabilities[$role] );
586
+ unset ( $roles[$role]); // User cannot manage his roles.
587
+ }
588
+ asort($this->capabilities);
589
+
590
+ foreach ( array_keys($roles) as $role ) {
591
+ $r = get_role($role);
592
+ $level = ak_caps2level($r->capabilities);
593
+
594
+ if ( $level > $this->max_level ) {
595
+ unset($roles[$role]);
596
+ }
597
+ }
598
+
599
+ $this->roles = $roles;
600
+ }
601
+ }
602
+
603
+ /**
604
+ * Creates a new role/capability name from user input name.
605
+ * Name rules are:
606
+ * - 2-40 charachers lenght.
607
+ * - Only letters, digits, spaces and underscores.
608
+ * - Must to start with a letter.
609
+ *
610
+ * @param string $name Name from user input.
611
+ * @return array|false An array with the name and display_name, or false if not valid $name.
612
+ */
613
+ private function createNewName( $name ) {
614
+ // Allow max 40 characters, letters, digits and spaces
615
+ $name = trim(substr($name, 0, 40));
616
+ $pattern = '/^[a-zA-Z][a-zA-Z0-9 _]+$/';
617
+
618
+ if ( preg_match($pattern, $name) ) {
619
+ $roles = ak_get_roles();
620
+
621
+ $name = strtolower($name);
622
+ $name = str_replace(' ', '_', $name);
623
+ if ( in_array($name, $roles) || array_key_exists($name, $this->capabilities) ) {
624
+ return false; // Already a role or capability with this name.
625
+ }
626
+
627
+ $display = explode('_', $name);
628
+ $display = array_map('ucfirst', $display);
629
+ $display = implode(' ', $display);
630
+
631
+ return compact('name', 'display');
632
+ } else {
633
+ return false;
634
+ }
635
+ }
636
+
637
+ /**
638
+ * Creates a new role.
639
+ *
640
+ * @param string $name Role name to create.
641
+ * @param array $caps Role capabilities.
642
+ * @return string|false Returns the name of the new role created or false if failed.
643
+ */
644
+ private function createRole( $name, $caps = array() ) {
645
+ $role = $this->createNewName($name);
646
+ if ( ! is_array($role) ) {
647
+ return false;
648
+ }
649
+
650
+ $new_role = add_role($role['name'], $role['display'], $caps);
651
+ if ( is_object($new_role) ) {
652
+ return $role['name'];
653
+ } else {
654
+ return false;
655
+ }
656
+ }
657
+
658
+ /**
659
+ * Saves capability changes to roles.
660
+ *
661
+ * @param string $role_name Role name to change its capabilities
662
+ * @param array $caps New capabilities for the role.
663
+ * @return void
664
+ */
665
+ private function saveRoleCapabilities( $role_name, $caps, $level ) {
666
+
667
+ $this->generateNames();
668
+ $role = get_role($role_name);
669
+
670
+ $old_caps = array_intersect_key($role->capabilities, $this->capabilities);
671
+ $new_caps = ( is_array($caps) ) ? array_map('intval', $caps) : array();
672
+ $new_caps = array_merge($new_caps, ak_level2caps($level));
673
+
674
+ // Find caps to add and remove
675
+ $add_caps = array_diff_key($new_caps, $old_caps);
676
+ $del_caps = array_diff_key($old_caps, $new_caps);
677
+
678
+ if ( ! $is_administrator = current_user_can('administrator') ) {
679
+ unset($add_caps['manage_capabilities']);
680
+ unset($del_caps['manage_capabilities']);
681
+ }
682
+
683
+ if ( 'administrator' == $role_name && isset($del_caps['manage_capabilities']) ) {
684
+ unset($del_caps['manage_capabilities']);
685
+ ak_admin_error(__('You cannot remove Manage Capabilities from Administrators', $this->ID));
686
+ }
687
+ // Add new capabilities to role
688
+ foreach ( $add_caps as $cap => $grant ) {
689
+ if ( $is_administrator || current_user_can($cap) )
690
+ $role->add_cap($cap);
691
+ }
692
+
693
+ // Remove capabilities from role
694
+ foreach ( $del_caps as $cap => $grant) {
695
+ if ( $is_administrator || current_user_can($cap) )
696
+ $role->remove_cap($cap);
697
+ }
698
+ }
699
+
700
+ protected function pluginDeactivate() {}
701
+ protected function pluginsLoaded() {}
702
+ protected function registerWidgets() {}
703
+ public function wpInit() {}
704
+ }
lang/capsman-by_BY.mo ADDED
Binary file
lang/capsman-by_BY.po ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Capability Manager\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-01-29 15:03+0100\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Jordi Canals <devel@jcanals.cat>\n"
8
+ "Language-Team: antsar.info <iliamrv@ya.ru>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
+ "X-Poedit-Language: Belarusian\n"
14
+ "X-Poedit-Country: BELARUS\n"
15
+ "X-Poedit-SourceCharset: utf-8\n"
16
+
17
+ #: ../capsman.php:53
18
+ msgid "Warning:"
19
+ msgstr "Папярэджанне:"
20
+
21
+ #: ../capsman.php:54
22
+ #, php-format
23
+ msgid "The active plugin %s is not compatible with your PHP version."
24
+ msgstr "Убудова %s не сумяшчальны з вашай версіяй PHP."
25
+
26
+ #: ../capsman.php:56
27
+ #, php-format
28
+ msgid "%s is required for this plugin."
29
+ msgstr "%s неабходзен лоя ўбудовы."
30
+
31
+ #: ../includes/admin.php:36
32
+ msgid "Roles and Capabilities"
33
+ msgstr "Ролі і магчымасці"
34
+
35
+ #: ../includes/admin.php:45
36
+ #, php-format
37
+ msgid "Capabilities for %s"
38
+ msgstr "Магчымасць для %s"
39
+
40
+ #: ../includes/admin.php:92
41
+ msgid "Level:"
42
+ msgstr "Узровень:"
43
+
44
+ #: ../includes/admin.php:115
45
+ #: ../includes/manager.php:319
46
+ msgid "Save Changes"
47
+ msgstr "Захаваць налады"
48
+
49
+ #: ../includes/admin.php:117
50
+ msgid "Delete this role"
51
+ msgstr "Выдаліць гэту ролю"
52
+
53
+ #: ../includes/admin.php:117
54
+ #, php-format
55
+ msgid ""
56
+ "You are about to delete the %s role.\n"
57
+ " 'Cancel' to stop, 'OK' to delete."
58
+ msgstr ""
59
+ "Вы пра выдаленне ролі %s.\n"
60
+ " 'Адмяніць' для прыпынку, 'ОК' для выдалення."
61
+
62
+ #: ../includes/admin.php:117
63
+ msgid "Delete Role"
64
+ msgstr "Выдаленне ролі"
65
+
66
+ #: ../includes/admin.php:128
67
+ msgid "Select New Role"
68
+ msgstr "Абраць новую ролю"
69
+
70
+ #: ../includes/admin.php:136
71
+ #: ../includes/manager.php:296
72
+ msgid "Change"
73
+ msgstr "Змяніць"
74
+
75
+ #: ../includes/admin.php:141
76
+ msgid "Create New Role"
77
+ msgstr "Стварыць новую ролю"
78
+
79
+ #: ../includes/admin.php:144
80
+ #: ../includes/manager.php:300
81
+ msgid "Create"
82
+ msgstr "Стварыць"
83
+
84
+ #: ../includes/admin.php:149
85
+ msgid "Copy this role to"
86
+ msgstr "Копія гэтай ролі"
87
+
88
+ #: ../includes/admin.php:152
89
+ #: ../includes/manager.php:309
90
+ msgid "Copy"
91
+ msgstr "Копія"
92
+
93
+ #: ../includes/admin.php:157
94
+ msgid "Add Capability"
95
+ msgstr "Дадаць магчымасць"
96
+
97
+ #: ../includes/admin.php:160
98
+ #: ../includes/manager.php:323
99
+ msgid "Add to role"
100
+ msgstr "Дадаць ролю"
101
+
102
+ #: ../includes/backup.php:33
103
+ msgid "Backup Tool for Capability Manager"
104
+ msgstr "Прылада для стварэння рэзервовай копіі для Capability Manager"
105
+
106
+ #: ../includes/backup.php:42
107
+ msgid "Backup and Restore"
108
+ msgstr "Рэзервовая копія і аднаўленне"
109
+
110
+ #: ../includes/backup.php:46
111
+ msgid "Select action:"
112
+ msgstr "Абраць дзеянне:"
113
+
114
+ #: ../includes/backup.php:49
115
+ msgid "Backup roles and capabilities"
116
+ msgstr "Рэзерв. копія роляў і магчымасцяў"
117
+
118
+ #: ../includes/backup.php:50
119
+ msgid "Restore last saved backup"
120
+ msgstr "Аднавіць з апошняга захаванага бэкапу"
121
+
122
+ #: ../includes/backup.php:52
123
+ msgid "Do Action"
124
+ msgstr "Няма дзеянняў"
125
+
126
+ #: ../includes/backup.php:60
127
+ msgid "Reset WordPress Defaults"
128
+ msgstr "Сбростить налады WordPress па змаўчанні"
129
+
130
+ #: ../includes/backup.php:62
131
+ msgid "WARNING:"
132
+ msgstr "УВАГА:"
133
+
134
+ #: ../includes/backup.php:62
135
+ msgid "Reseting default Roles and Capabilities will set them to the WordPress install defaults."
136
+ msgstr "Скід стандартных роляў і магчымасцяў павінен скінуць налады па змаўчанні пры установвке ў WordPress."
137
+
138
+ #: ../includes/backup.php:63
139
+ msgid "If you have installed any plugin that adds new roles or capabilities, these will be lost."
140
+ msgstr "Калі вы ўсталявалі іншую ўбудову, які дадае новыя ролі ці магчымасці, гэта павінна знікнуць. "
141
+
142
+ #: ../includes/backup.php:64
143
+ msgid "It is recommended to use this only as a last resource!"
144
+ msgstr "Гэта рэкамендуецца дя выкарыстанні толькі як последный рэсурс!"
145
+
146
+ #: ../includes/backup.php:65
147
+ msgid "Reset Roles and Capabilities to WordPress defaults"
148
+ msgstr "Скінуць ролі і воможности"
149
+
150
+ #: ../includes/backup.php:65
151
+ msgid ""
152
+ "You are about to reset Roles and Capabilities to WordPress defaults.\n"
153
+ " 'Cancel' to stop, 'OK' to reset."
154
+ msgstr ""
155
+ "Вы пра скід роляў і магчымасцяў %s.\n"
156
+ " 'Адмяніць' для прыпынку, 'ОК' для скіду."
157
+
158
+ #: ../includes/backup.php:65
159
+ msgid "Reset to WordPress defaults"
160
+ msgstr "Скінуць налады WordPress"
161
+
162
+ #: ../includes/manager.php:139
163
+ #: ../includes/manager.php:140
164
+ msgid "Capability Manager"
165
+ msgstr "Capability Manager"
166
+
167
+ #: ../includes/manager.php:139
168
+ msgid "Capabilities"
169
+ msgstr "Магчымасці"
170
+
171
+ #: ../includes/manager.php:220
172
+ #: ../includes/manager.php:256
173
+ msgid "What do you think you're doing?!?"
174
+ msgstr "Вы ведаеце, што робіце?!?"
175
+
176
+ #: ../includes/manager.php:283
177
+ msgid "Bad form Received"
178
+ msgstr "Se ha recibido un formulario incorrecto."
179
+
180
+ #: ../includes/manager.php:302
181
+ #: ../includes/manager.php:312
182
+ msgid "New role created."
183
+ msgstr "Новая роля створана."
184
+
185
+ #: ../includes/manager.php:305
186
+ #: ../includes/manager.php:315
187
+ msgid "Error: Failed creating the new role."
188
+ msgstr "Памылка: Новая роля не створана."
189
+
190
+ #: ../includes/manager.php:320
191
+ msgid "New capabilities saved."
192
+ msgstr "Новыя магчымасці захаваны."
193
+
194
+ #: ../includes/manager.php:328
195
+ msgid "New capability added to role."
196
+ msgstr "Новая воможность дададзена да ролі."
197
+
198
+ #: ../includes/manager.php:330
199
+ msgid "Incorrect capability name."
200
+ msgstr "Некарэктнае імя магчымасці."
201
+
202
+ #: ../includes/manager.php:334
203
+ msgid "Bad form received."
204
+ msgstr "Дрэнная форма адпраўкі."
205
+
206
+ #: ../includes/manager.php:354
207
+ msgid "New backup saved."
208
+ msgstr "Новы бэкап захаваны."
209
+
210
+ #: ../includes/manager.php:360
211
+ msgid "Roles and Capabilities restored from last backup."
212
+ msgstr "Ролі і магчымасці адноўлены з апошняга бэкапу."
213
+
214
+ #: ../includes/manager.php:362
215
+ msgid "Restore failed. No backup found."
216
+ msgstr "Аднаўленне спынена. Не знойдзена бэкапаў. "
217
+
218
+ #: ../includes/manager.php:384
219
+ #, php-format
220
+ msgid "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
221
+ msgstr "Не выдалена стандартная роля. Вы <a href=\"%s\">павінны спачатку змяніць гэта</a>."
222
+
223
+ #: ../includes/manager.php:405
224
+ #, php-format
225
+ msgid "Role has been deleted. %1$d users moved to default role %2$s."
226
+ msgstr "Роля была выдалена. %1$d карыстачоў перамешчана ў стандартную ролю %2$s."
227
+
228
+ #: ../includes/manager.php:419
229
+ msgid "Needed function to create default roles not found!"
230
+ msgstr "Неабходная функцыя па стварэнні роляў не знойдзена!"
231
+
232
+ #: ../includes/manager.php:431
233
+ msgid "Roles and Capabilities reset to WordPress defaults"
234
+ msgstr "Ролі і магчымасці скінуты да стандартных для WordPress "
235
+
236
+ #: ../includes/manager.php:606
237
+ msgid "You cannot remove Manage Capabilities from Administrators"
238
+ msgstr "Вы не можаце выдаліць Manage Capabilities праз адміністратараў ."
239
+
240
+ #~ msgid "The active plugin %s is not compatible with your WordPress version."
241
+ #~ msgstr "Актыўная ўбудова %s не сумяшчальны з бягучай версіяй WordPress."
242
+ #~ msgid "WordPress %s is required to run this plugin."
243
+ #~ msgstr "WordPress %s неабходзен для запуску гэтай убудовы."
244
+ #~ msgid "Standard sidebar functions are not present."
245
+ #~ msgstr "Стандартныя функцыі бакавой панэлі не прадстаўлены."
246
+ #~ msgid "It is required to use the standard sidebar to run %s"
247
+ #~ msgstr ""
248
+ #~ "Гэта неабходна для выкарыстання стандартнай бакавой панэлі для запуску %s"
249
+ #~ msgid "Settings saved."
250
+ #~ msgstr "Налады захаваны."
251
+ #~ msgid "Plugin Homepage"
252
+ #~ msgstr "Хатняя старонка ўбудовы"
253
+
254
+ #, fuzzy
255
+ #~ msgid "Theme Homepage"
256
+ #~ msgstr "Хатняя старонка аўтара"
257
+
258
+ #, fuzzy
259
+ #~ msgid "Documentation"
260
+ #~ msgstr "Няма дзеянняў"
261
+ #~ msgid "Support Forum"
262
+ #~ msgstr "Форум падтрымкі"
263
+ #~ msgid "Author Homepage"
264
+ #~ msgstr "Хатняя старонка аўтара"
265
+
266
+ #, fuzzy
267
+ #~ msgid "Incorrect type of file."
268
+ #~ msgstr "Некарэктнае імя магчымасці."
269
+
270
+ #, fuzzy
271
+ #~ msgid "Error in creating %s image from source."
272
+ #~ msgstr "Памылка: Новая роля не створана."
273
+
274
+ #, fuzzy
275
+ #~ msgid "Error reading the file."
276
+ #~ msgstr "Памылка: Новая роля не створана."
277
+ #~ msgid "Help donating"
278
+ #~ msgstr "Дапамога праз ахвяраванні"
279
+ #~ msgid "Managing %s"
280
+ #~ msgstr "Administrando %s"
281
+
lang/capsman-ca.mo ADDED
Binary file
lang/capsman-ca.po ADDED
@@ -0,0 +1,384 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Capability Manager\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-01-29 15:03+0100\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Jordi Canals <devel@jcanals.cat>\n"
8
+ "Language-Team: Jordi Canals | http://alkivia.org <devel@jcanals.cat>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
+ "X-Poedit-Language: Catalan\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+
16
+ #: ../capsman.php:53
17
+ msgid "Warning:"
18
+ msgstr "Atenció:"
19
+
20
+ #: ../capsman.php:54
21
+ #, php-format
22
+ msgid "The active plugin %s is not compatible with your PHP version."
23
+ msgstr "L'extensió activa %s no és compatible amb la teva versió de PHP."
24
+
25
+ #: ../capsman.php:56
26
+ #, php-format
27
+ msgid "%s is required for this plugin."
28
+ msgstr "Es requereix %s per aquesta extensió."
29
+
30
+ #: ../includes/admin.php:36
31
+ msgid "Roles and Capabilities"
32
+ msgstr "Rols i Competències"
33
+
34
+ #: ../includes/admin.php:45
35
+ #, php-format
36
+ msgid "Capabilities for %s"
37
+ msgstr "Competències per %s"
38
+
39
+ #: ../includes/admin.php:92
40
+ msgid "Level:"
41
+ msgstr "Nivell:"
42
+
43
+ #: ../includes/admin.php:115
44
+ #: ../includes/manager.php:319
45
+ msgid "Save Changes"
46
+ msgstr "Desa els canvis"
47
+
48
+ #: ../includes/admin.php:117
49
+ msgid "Delete this role"
50
+ msgstr "Elimina aquest rol"
51
+
52
+ #: ../includes/admin.php:117
53
+ #, php-format
54
+ msgid ""
55
+ "You are about to delete the %s role.\n"
56
+ " 'Cancel' to stop, 'OK' to delete."
57
+ msgstr ""
58
+ "Estàs apunt d'eliminar el rol %s.\n"
59
+ " 'Cancel·la' per sortir, 'D'acord' per eliminar."
60
+
61
+ #: ../includes/admin.php:117
62
+ msgid "Delete Role"
63
+ msgstr "Eliminar Rol"
64
+
65
+ #: ../includes/admin.php:128
66
+ msgid "Select New Role"
67
+ msgstr "Selecciona un nou Rol"
68
+
69
+ #: ../includes/admin.php:136
70
+ #: ../includes/manager.php:296
71
+ msgid "Change"
72
+ msgstr "Canvia"
73
+
74
+ #: ../includes/admin.php:141
75
+ msgid "Create New Role"
76
+ msgstr "Crear rol nou"
77
+
78
+ #: ../includes/admin.php:144
79
+ #: ../includes/manager.php:300
80
+ msgid "Create"
81
+ msgstr "Crear"
82
+
83
+ #: ../includes/admin.php:149
84
+ msgid "Copy this role to"
85
+ msgstr "Copia aquest rol a"
86
+
87
+ #: ../includes/admin.php:152
88
+ #: ../includes/manager.php:309
89
+ msgid "Copy"
90
+ msgstr "Copiar"
91
+
92
+ #: ../includes/admin.php:157
93
+ msgid "Add Capability"
94
+ msgstr "Afegeix Competència"
95
+
96
+ #: ../includes/admin.php:160
97
+ #: ../includes/manager.php:323
98
+ msgid "Add to role"
99
+ msgstr "Afegir al rol"
100
+
101
+ #: ../includes/backup.php:33
102
+ msgid "Backup Tool for Capability Manager"
103
+ msgstr "Eina de Copies de Seguretat per a Capability Manager"
104
+
105
+ #: ../includes/backup.php:42
106
+ msgid "Backup and Restore"
107
+ msgstr "Copia i Restaura"
108
+
109
+ #: ../includes/backup.php:46
110
+ msgid "Select action:"
111
+ msgstr "Selecciona una acció:"
112
+
113
+ #: ../includes/backup.php:49
114
+ msgid "Backup roles and capabilities"
115
+ msgstr "Desa una copia de rols i competències"
116
+
117
+ #: ../includes/backup.php:50
118
+ msgid "Restore last saved backup"
119
+ msgstr "Recupera la darrera còpia de seguretat"
120
+
121
+ #: ../includes/backup.php:52
122
+ msgid "Do Action"
123
+ msgstr "Executa l'Acció"
124
+
125
+ #: ../includes/backup.php:60
126
+ msgid "Reset WordPress Defaults"
127
+ msgstr "Restaura valors predeterminats de WordPress"
128
+
129
+ #: ../includes/backup.php:62
130
+ msgid "WARNING:"
131
+ msgstr "ATENCIÓ:"
132
+
133
+ #: ../includes/backup.php:62
134
+ msgid "Reseting default Roles and Capabilities will set them to the WordPress install defaults."
135
+ msgstr "Restaurant els valors predeterminats per a Rols i Competències, els configurarà als valors predeterminats de la instal·lació de WordPress."
136
+
137
+ #: ../includes/backup.php:63
138
+ msgid "If you have installed any plugin that adds new roles or capabilities, these will be lost."
139
+ msgstr "Si has instal·lat alguna extensió que afegeix nous rols o competències, aquests es perdran."
140
+
141
+ #: ../includes/backup.php:64
142
+ msgid "It is recommended to use this only as a last resource!"
143
+ msgstr "Es recomana utilitzar aquesta opció només com a últim recurs!"
144
+
145
+ #: ../includes/backup.php:65
146
+ msgid "Reset Roles and Capabilities to WordPress defaults"
147
+ msgstr "Restaura Rols i Competències als valors predeterminats de WordPress"
148
+
149
+ #: ../includes/backup.php:65
150
+ msgid ""
151
+ "You are about to reset Roles and Capabilities to WordPress defaults.\n"
152
+ " 'Cancel' to stop, 'OK' to reset."
153
+ msgstr ""
154
+ "Estàs apunt de restaurar els valors predeterminats de WordPress per a Rols i Competències.\n"
155
+ " 'Cancel·la' per abandonarr, 'D'acord' per restaurar."
156
+
157
+ #: ../includes/backup.php:65
158
+ msgid "Reset to WordPress defaults"
159
+ msgstr "Restaura els valors predeterminats de WordPress"
160
+
161
+ #: ../includes/manager.php:139
162
+ #: ../includes/manager.php:140
163
+ msgid "Capability Manager"
164
+ msgstr "Administrador de Compoetències"
165
+
166
+ #: ../includes/manager.php:139
167
+ msgid "Capabilities"
168
+ msgstr "Competències"
169
+
170
+ #: ../includes/manager.php:220
171
+ #: ../includes/manager.php:256
172
+ msgid "What do you think you're doing?!?"
173
+ msgstr "Que et penses que fas?"
174
+
175
+ #: ../includes/manager.php:283
176
+ msgid "Bad form Received"
177
+ msgstr "S'ha rebut un formulari incorrecte."
178
+
179
+ #: ../includes/manager.php:302
180
+ #: ../includes/manager.php:312
181
+ msgid "New role created."
182
+ msgstr "S'ha creat el nou rol."
183
+
184
+ #: ../includes/manager.php:305
185
+ #: ../includes/manager.php:315
186
+ msgid "Error: Failed creating the new role."
187
+ msgstr "Error: No s'ha pogut crear el nou rol."
188
+
189
+ #: ../includes/manager.php:320
190
+ msgid "New capabilities saved."
191
+ msgstr "S'han desat les noves competències."
192
+
193
+ #: ../includes/manager.php:328
194
+ msgid "New capability added to role."
195
+ msgstr "Nova competència afegida al rol."
196
+
197
+ #: ../includes/manager.php:330
198
+ msgid "Incorrect capability name."
199
+ msgstr "Nom incorrecte de competència."
200
+
201
+ #: ../includes/manager.php:334
202
+ msgid "Bad form received."
203
+ msgstr "S'ha rebut un formulari incorrecte."
204
+
205
+ #: ../includes/manager.php:354
206
+ msgid "New backup saved."
207
+ msgstr "S'ha creat la copia de seguretat."
208
+
209
+ #: ../includes/manager.php:360
210
+ msgid "Roles and Capabilities restored from last backup."
211
+ msgstr "S'han recuperat els Rols i Competències des de la copia de seguretat."
212
+
213
+ #: ../includes/manager.php:362
214
+ msgid "Restore failed. No backup found."
215
+ msgstr "Ha fallat la recuperació. No s'ha trobat cap copia de seguretat."
216
+
217
+ #: ../includes/manager.php:384
218
+ #, php-format
219
+ msgid "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
220
+ msgstr "No es pot eliminar el rol predeterminat. <a href=\"%s\" Abans has de canviar-lo</a>."
221
+
222
+ #: ../includes/manager.php:405
223
+ #, php-format
224
+ msgid "Role has been deleted. %1$d users moved to default role %2$s."
225
+ msgstr "El rol ha estat eliminat. S'han mogut %1$d usuaris al rol predeterminat %2$s."
226
+
227
+ #: ../includes/manager.php:419
228
+ msgid "Needed function to create default roles not found!"
229
+ msgstr "La funció per crear els rols predeterminats no s'ha trobat!"
230
+
231
+ #: ../includes/manager.php:431
232
+ msgid "Roles and Capabilities reset to WordPress defaults"
233
+ msgstr "S'han restaurat Rols i Competències als valors predeterminats de WordPress."
234
+
235
+ #: ../includes/manager.php:606
236
+ msgid "You cannot remove Manage Capabilities from Administrators"
237
+ msgstr "No pots eliminar 'Manage Capabilities' dels administradors"
238
+
239
+ #~ msgid "Option blocked by administrator."
240
+ #~ msgstr "Opció desactivada per l'administrador."
241
+ #~ msgid "The active plugin %s is not compatible with your WordPress version."
242
+ #~ msgstr ""
243
+ #~ "L'extensió activa %s no és compatible amb la teva versió de WordPress."
244
+ #~ msgid "WordPress %s is required to run this plugin."
245
+ #~ msgstr "Aquesta extensió requereix com a mínim WordPress %s."
246
+ #~ msgid "Standard sidebar functions are not present."
247
+ #~ msgstr "Les funcions de la barra lateral estàndard no es troben presents."
248
+ #~ msgid "It is required to use the standard sidebar to run %s"
249
+ #~ msgstr "És necessari utilitzar la barra lateral estàndard per executar %s"
250
+ #~ msgid "Settings saved."
251
+ #~ msgstr "Opcions desades."
252
+ #~ msgid "Just Now"
253
+ #~ msgstr "Ara mateix"
254
+ #~ msgid "1 minute ago"
255
+ #~ msgstr "Fa 1 minut"
256
+ #~ msgid "1 hour ago"
257
+ #~ msgstr "Fa 1 hora"
258
+ #~ msgid "Today at %s"
259
+ #~ msgstr "Avui a les %s"
260
+ #~ msgid "Yesterday at %s"
261
+ #~ msgstr "Ahir a les %s"
262
+ #~ msgid "Plugin Homepage"
263
+ #~ msgstr "Pàgina web de l'extensió"
264
+ #~ msgid "Theme Homepage"
265
+ #~ msgstr "Pàgina web del tema"
266
+ #~ msgid "Documentation"
267
+ #~ msgstr "Documentació"
268
+ #~ msgid "Support Forum"
269
+ #~ msgstr "Forum d'Ajuda"
270
+ #~ msgid "Author Homepage"
271
+ #~ msgstr "Lloc web de l'autor"
272
+ #~ msgid "Donate to project"
273
+ #~ msgstr "Fes un donatiu"
274
+ #~ msgid "File error. Please try again."
275
+ #~ msgstr "Error de fitxer. Si us plau, torneu-ho a provar."
276
+ #~ msgid "Local file doesn't exist."
277
+ #~ msgstr "El fitxer local no existeix."
278
+ #~ msgid "Local file is not readable."
279
+ #~ msgstr "El fitxer local no es pot llegir."
280
+ #~ msgid ""
281
+ #~ "File upload error (the uploaded file exceeds the upload_max_filesize "
282
+ #~ "directive in php.ini)."
283
+ #~ msgstr ""
284
+ #~ "Error de pujada de fitxer (El fitxer pujat excedeix de la directiva "
285
+ #~ "upload_max_filesize de php.ini)."
286
+ #~ msgid ""
287
+ #~ "File upload error (the uploaded file exceeds the MAX_FILE_SIZE directive "
288
+ #~ "that was specified in the html form)."
289
+ #~ msgstr ""
290
+ #~ "Error pujant el fitxer (el fitxer pujat excedeix la directiva "
291
+ #~ "MAX_FILE_SIZE que s'ha especificat al formulari HTML)."
292
+ #~ msgid "File upload error (the uploaded file was only partially uploaded)."
293
+ #~ msgstr "Error pujant el fitxer (El fitxer només s'ha rebut parcialment)."
294
+ #~ msgid "File upload error (no file was uploaded)."
295
+ #~ msgstr "Error pujant el fitxer (No s'ha rebut cap fitxer)."
296
+ #~ msgid "File upload error (missing a temporary folder)."
297
+ #~ msgstr "Error pujant el fitxer (manca la carpeta temporal)."
298
+ #~ msgid "File upload error (failed to write file to disk)."
299
+ #~ msgstr "Error pujant el fitxer (No s'ha pogut escriure al disc)."
300
+ #~ msgid "File upload error (file upload stopped by extension)."
301
+ #~ msgstr "Error pujant el fitxer (El fitxer s'ha bloquejat per extensió)."
302
+ #~ msgid "File upload error (unknown error code)."
303
+ #~ msgstr "Error pujant el fitxer (Codi d'error desconegut)."
304
+ #~ msgid "File upload error. Please try again."
305
+ #~ msgstr ""
306
+ #~ "S'ha produït un error pujant el fitxer. Torneu-ho a provar d'aquí una "
307
+ #~ "estona."
308
+ #~ msgid "File too big."
309
+ #~ msgstr "Fitxer massa gran."
310
+ #~ msgid "MIME type can't be detected."
311
+ #~ msgstr "No es pot detectar el tipus MIME."
312
+ #~ msgid "Incorrect type of file."
313
+ #~ msgstr "Tipus d'arxiu invàlid"
314
+ #~ msgid "Image too wide."
315
+ #~ msgstr "Imatge massa ample."
316
+ #~ msgid "Image too narrow."
317
+ #~ msgstr "Imatge massa estreta."
318
+ #~ msgid "Image too high."
319
+ #~ msgstr "Imatge massa alta."
320
+ #~ msgid "Image too short."
321
+ #~ msgstr "Imatge massa baixa."
322
+ #~ msgid "Image ratio too high (image too wide)."
323
+ #~ msgstr "Ratio d'imatge massa gran (Imatge massa ample)."
324
+ #~ msgid "Image ratio too low (image too high)."
325
+ #~ msgstr "Ratio d'imatge massa baix (Imatge massa alta)."
326
+ #~ msgid "Image has too many pixels."
327
+ #~ msgstr "La imatge té massa píxels."
328
+ #~ msgid "Image has not enough pixels."
329
+ #~ msgstr "La imatge no té prou píxels."
330
+ #~ msgid "File not uploaded. Can't carry on a process."
331
+ #~ msgstr "No s'ha pujat el fitxer. No s'ha pogut executar el procés."
332
+ #~ msgid "%s already exists. Please change the file name."
333
+ #~ msgstr "El fitxer %s ja existeix. Si en plau canvieu-ne el nom."
334
+ #~ msgid "No correct temp source file. Can't carry on a process."
335
+ #~ msgstr "El fitxer temporal no es correcte. No es pot executar el procés."
336
+ #~ msgid "No correct uploaded source file. Can't carry on a process."
337
+ #~ msgstr "El fitxer original no es correcte. No es pot executar el procés."
338
+ #~ msgid "Destination directory can't be created. Can't carry on a process."
339
+ #~ msgstr ""
340
+ #~ "No es pot crear el directori de destí. No es pot executar el procés."
341
+ #~ msgid "Destination directory doesn't exist. Can't carry on a process."
342
+ #~ msgstr "El directori de destí no existeix. No es pot executar el procés."
343
+ #~ msgid "Destination path is not a directory. Can't carry on a process."
344
+ #~ msgstr "La ruta de destí no és un directori. No es pot executar el procés."
345
+ #~ msgid ""
346
+ #~ "Destination directory can't be made writeable. Can't carry on a process."
347
+ #~ msgstr ""
348
+ #~ "No es pot canviar a 'escriure' els drets del directori de destí. No es "
349
+ #~ "pot executar el procés."
350
+ #~ msgid "Destination path is not a writeable. Can't carry on a process."
351
+ #~ msgstr ""
352
+ #~ "No es pot escriure en el directori de destí. No es pot executar el procés."
353
+ #~ msgid "Can't create the temporary file. Can't carry on a process."
354
+ #~ msgstr "No es pot crear un fitxer temporal. No es pot executar el procés."
355
+ #~ msgid "Source file is not readable. Can't carry on a process."
356
+ #~ msgstr "El fitxer d'origen no es pot llegir. No es pot executar el procés."
357
+ #~ msgid "No create from %s support."
358
+ #~ msgstr "No hi ha funcions per crear des de %s."
359
+ #~ msgid "Error in creating %s image from source."
360
+ #~ msgstr "Error creant la imatge %s des de l'original."
361
+ #~ msgid "Can't read image source. Not an image?."
362
+ #~ msgstr "No es pot llegir la imatge original. És una imatge?"
363
+ #~ msgid "GD doesn't seem to be present."
364
+ #~ msgstr "No sembla que la llibreria GD estigui present."
365
+ #~ msgid "No create from %s support, can't read watermark."
366
+ #~ msgstr ""
367
+ #~ "No hi ha funcions per crear des de %s, no es pot llegir la marca a "
368
+ #~ "l'aigua."
369
+ #~ msgid "No %s read support, can't create watermark."
370
+ #~ msgstr ""
371
+ #~ "No hi ha funcions per llegir %s, no es pot crear la marca a l'aigua."
372
+ #~ msgid "Unknown image format, can't read watermark."
373
+ #~ msgstr "Format d'imatge desconegut, no es pot llegir la marca a l'aigua."
374
+ #~ msgid "No %s create support."
375
+ #~ msgstr "No hi ha funcions per crear %s."
376
+ #~ msgid "No conversion type defined."
377
+ #~ msgstr "No s'ha definit cap tipus de conversió."
378
+ #~ msgid "Error copying file on the server. copy() failed."
379
+ #~ msgstr "Error copiant el fitxer al serivor. copy() ha fallat."
380
+ #~ msgid "Error reading the file."
381
+ #~ msgstr "Error llegint el fitxer."
382
+ #~ msgid "Help donating"
383
+ #~ msgstr "Ajuda donant"
384
+
lang/capsman-de_DE.mo ADDED
Binary file
lang/capsman-de_DE.po ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Capability Manager\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-01-29 15:03+0100\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Jordi Canals <devel@jcanals.cat>\n"
8
+ "Language-Team: Alkivia | http://alkivia.org <alkivia@jcanals.net>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
+ "X-Poedit-Language: German\n"
14
+ "X-Poedit-Country: GERMANY\n"
15
+ "X-Poedit-SourceCharset: utf-8\n"
16
+
17
+ #: ../capsman.php:53
18
+ msgid "Warning:"
19
+ msgstr "WARNUNG:"
20
+
21
+ #: ../capsman.php:54
22
+ #, php-format
23
+ msgid "The active plugin %s is not compatible with your PHP version."
24
+ msgstr "Das aktive Plugin %s ist mit der PHP Version nicht kompatibel."
25
+
26
+ #: ../capsman.php:56
27
+ #, php-format
28
+ msgid "%s is required for this plugin."
29
+ msgstr "%s wird für dieses Plugin benötigt."
30
+
31
+ #: ../includes/admin.php:36
32
+ msgid "Roles and Capabilities"
33
+ msgstr "Rollen und Berechtigungen"
34
+
35
+ #: ../includes/admin.php:45
36
+ #, php-format
37
+ msgid "Capabilities for %s"
38
+ msgstr "Berechtigungen für %s"
39
+
40
+ #: ../includes/admin.php:92
41
+ msgid "Level:"
42
+ msgstr "Berechtigungslevel:"
43
+
44
+ #: ../includes/admin.php:115
45
+ #: ../includes/manager.php:319
46
+ msgid "Save Changes"
47
+ msgstr "Einstellungen speichern"
48
+
49
+ #: ../includes/admin.php:117
50
+ msgid "Delete this role"
51
+ msgstr "Diese Rolle löschen"
52
+
53
+ #: ../includes/admin.php:117
54
+ #, php-format
55
+ msgid ""
56
+ "You are about to delete the %s role.\n"
57
+ " 'Cancel' to stop, 'OK' to delete."
58
+ msgstr ""
59
+ "Sicher dass die Rolle %s gelöscht werden soll?\n"
60
+ " 'Abbrechen' um zu stoppen, 'OK' zum löschen."
61
+
62
+ #: ../includes/admin.php:117
63
+ msgid "Delete Role"
64
+ msgstr "Rolle löschen"
65
+
66
+ #: ../includes/admin.php:128
67
+ msgid "Select New Role"
68
+ msgstr "Neue Rolle auswählen"
69
+
70
+ #: ../includes/admin.php:136
71
+ #: ../includes/manager.php:296
72
+ msgid "Change"
73
+ msgstr "ändern"
74
+
75
+ #: ../includes/admin.php:141
76
+ msgid "Create New Role"
77
+ msgstr "Neue Rolle anlegen "
78
+
79
+ #: ../includes/admin.php:144
80
+ #: ../includes/manager.php:300
81
+ msgid "Create"
82
+ msgstr "erstellen"
83
+
84
+ #: ../includes/admin.php:149
85
+ msgid "Copy this role to"
86
+ msgstr "Diese Rolle kopieren"
87
+
88
+ #: ../includes/admin.php:152
89
+ #: ../includes/manager.php:309
90
+ msgid "Copy"
91
+ msgstr "kopieren"
92
+
93
+ #: ../includes/admin.php:157
94
+ msgid "Add Capability"
95
+ msgstr "Berechtigung hinzufügen"
96
+
97
+ #: ../includes/admin.php:160
98
+ #: ../includes/manager.php:323
99
+ msgid "Add to role"
100
+ msgstr "zur Rolle hinzufügen"
101
+
102
+ #: ../includes/backup.php:33
103
+ msgid "Backup Tool for Capability Manager"
104
+ msgstr "Backup-Tool für den Berechtigungsmanager (Capability Manager)"
105
+
106
+ #: ../includes/backup.php:42
107
+ msgid "Backup and Restore"
108
+ msgstr "Sichern und Wiederherstellen"
109
+
110
+ #: ../includes/backup.php:46
111
+ msgid "Select action:"
112
+ msgstr "Aktion auswählen"
113
+
114
+ #: ../includes/backup.php:49
115
+ msgid "Backup roles and capabilities"
116
+ msgstr "Backup der Rollen und Berechtigungen"
117
+
118
+ #: ../includes/backup.php:50
119
+ msgid "Restore last saved backup"
120
+ msgstr "Zuletzt gespeichertes Sicherung wiederherstellen"
121
+
122
+ #: ../includes/backup.php:52
123
+ msgid "Do Action"
124
+ msgstr "ausführen"
125
+
126
+ #: ../includes/backup.php:60
127
+ msgid "Reset WordPress Defaults"
128
+ msgstr "Wordpress Standardeinstellungen wiederherstellen"
129
+
130
+ #: ../includes/backup.php:62
131
+ msgid "WARNING:"
132
+ msgstr "WARNUNG:"
133
+
134
+ #: ../includes/backup.php:62
135
+ msgid "Reseting default Roles and Capabilities will set them to the WordPress install defaults."
136
+ msgstr "das Wiederherstellen von Rollen und Berechtigungen erfolgt auf den Wordpress Standard!"
137
+
138
+ #: ../includes/backup.php:63
139
+ msgid "If you have installed any plugin that adds new roles or capabilities, these will be lost."
140
+ msgstr "Einstellungen zu Rollen und Berechtigungen die nicht mit dem Berechtigungs-Manager erstellt wurden, werden gelöscht!"
141
+
142
+ #: ../includes/backup.php:64
143
+ msgid "It is recommended to use this only as a last resource!"
144
+ msgstr "Es wird empfohlen, dies als letzte Möglichkeit anzuwenden!"
145
+
146
+ #: ../includes/backup.php:65
147
+ msgid "Reset Roles and Capabilities to WordPress defaults"
148
+ msgstr "Rollen und Berechtigungen auf den Wordpress Standard zurücksetzen"
149
+
150
+ #: ../includes/backup.php:65
151
+ msgid ""
152
+ "You are about to reset Roles and Capabilities to WordPress defaults.\n"
153
+ " 'Cancel' to stop, 'OK' to reset."
154
+ msgstr ""
155
+ "Du bist dabei die Rollen und Berechtigungen auf den Wordpress Standard zurückzusetzen!\n"
156
+ " 'Abbrechen' um dies nicht zu tun, 'OK' um auf Standardwerte zurückzusetzen."
157
+
158
+ #: ../includes/backup.php:65
159
+ msgid "Reset to WordPress defaults"
160
+ msgstr "Wordpress Standardwerte wiederherstellen."
161
+
162
+ #: ../includes/manager.php:139
163
+ #: ../includes/manager.php:140
164
+ msgid "Capability Manager"
165
+ msgstr "Berechtigungs Manager"
166
+
167
+ #: ../includes/manager.php:139
168
+ msgid "Capabilities"
169
+ msgstr "Berechtigungen"
170
+
171
+ #: ../includes/manager.php:220
172
+ #: ../includes/manager.php:256
173
+ msgid "What do you think you're doing?!?"
174
+ msgstr "Was glaubst du, was Du tust?"
175
+
176
+ #: ../includes/manager.php:283
177
+ msgid "Bad form Received"
178
+ msgstr "Fehlerhaftes Formular empfangen."
179
+
180
+ #: ../includes/manager.php:302
181
+ #: ../includes/manager.php:312
182
+ msgid "New role created."
183
+ msgstr "Neue Rolle wurde erstellt."
184
+
185
+ #: ../includes/manager.php:305
186
+ #: ../includes/manager.php:315
187
+ msgid "Error: Failed creating the new role."
188
+ msgstr "FEHLER: Rolle konnte nicht angelegt werden."
189
+
190
+ #: ../includes/manager.php:320
191
+ msgid "New capabilities saved."
192
+ msgstr "Neue Berechtigung gespeichert."
193
+
194
+ #: ../includes/manager.php:328
195
+ msgid "New capability added to role."
196
+ msgstr "Neue Berechtigung zur Rolle hinzugefügt."
197
+
198
+ #: ../includes/manager.php:330
199
+ msgid "Incorrect capability name."
200
+ msgstr "Berechtigungsname ist nicht zulässig."
201
+
202
+ #: ../includes/manager.php:334
203
+ msgid "Bad form received."
204
+ msgstr "Fehlerhaftes Formular empfangen."
205
+
206
+ #: ../includes/manager.php:354
207
+ msgid "New backup saved."
208
+ msgstr "Neues Backup wurde erfolgreich gespeichert."
209
+
210
+ #: ../includes/manager.php:360
211
+ msgid "Roles and Capabilities restored from last backup."
212
+ msgstr "Rollen und Berechtigungen der letzten Sicherung wiederhergestellt."
213
+
214
+ #: ../includes/manager.php:362
215
+ msgid "Restore failed. No backup found."
216
+ msgstr "Wiederherstellen fehlgeschlagen - kein Backup gefunden!"
217
+
218
+ #: ../includes/manager.php:384
219
+ #, php-format
220
+ msgid "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
221
+ msgstr "Standardrolle (default) konnte nicht gelöscht werden. Zuerst <a href=\"%s\">ändern</a>."
222
+
223
+ #: ../includes/manager.php:405
224
+ #, php-format
225
+ msgid "Role has been deleted. %1$d users moved to default role %2$s."
226
+ msgstr "Rolle wurde gelöscht. %1$d Benutzer auf Standardrolle (default) gesetzt %2$s."
227
+
228
+ #: ../includes/manager.php:419
229
+ msgid "Needed function to create default roles not found!"
230
+ msgstr "Benötigte Funktion zum Erstellen der Standardrolle (default) nicht gefunden!"
231
+
232
+ #: ../includes/manager.php:431
233
+ msgid "Roles and Capabilities reset to WordPress defaults"
234
+ msgstr "Rollen und Berechtigungen auf Wordpress Standard zurücksetzen"
235
+
236
+ #: ../includes/manager.php:606
237
+ msgid "You cannot remove Manage Capabilities from Administrators"
238
+ msgstr "Administratoren dürfen keine Berechtigungen entzogen werden!"
239
+
240
+ #~ msgid "The active plugin %s is not compatible with your WordPress version."
241
+ #~ msgstr ""
242
+ #~ "Das Plugin %s ist zu der aktuellen Wordpressversion nicht kompatibel!"
243
+ #~ msgid "WordPress %s is required to run this plugin."
244
+ #~ msgstr "WordPress %s wird für dieses Plugin benötigt."
245
+ #~ msgid "Standard sidebar functions are not present."
246
+ #~ msgstr "Standard Sidebarfunktionen stehen nicht zur Verfügung!"
247
+ #~ msgid "It is required to use the standard sidebar to run %s"
248
+ #~ msgstr "Standard Sidebaroptionen werden benötigt, to run %s"
249
+ #~ msgid "Settings saved."
250
+ #~ msgstr "Einstellungen gespeichert"
251
+ #~ msgid "Plugin Homepage"
252
+ #~ msgstr "Plugin Homepage"
253
+
254
+ #, fuzzy
255
+ #~ msgid "Theme Homepage"
256
+ #~ msgstr "Author Homepage"
257
+
258
+ #, fuzzy
259
+ #~ msgid "Documentation"
260
+ #~ msgstr "ausführen"
261
+ #~ msgid "Support Forum"
262
+ #~ msgstr "Support Forum"
263
+ #~ msgid "Author Homepage"
264
+ #~ msgstr "Author Homepage"
265
+
266
+ #, fuzzy
267
+ #~ msgid "Incorrect type of file."
268
+ #~ msgstr "Berechtigungsname ist nicht zulässig."
269
+
270
+ #, fuzzy
271
+ #~ msgid "Error in creating %s image from source."
272
+ #~ msgstr "FEHLER: Rolle konnte nicht angelegt werden."
273
+
274
+ #, fuzzy
275
+ #~ msgid "Error reading the file."
276
+ #~ msgstr "FEHLER: Rolle konnte nicht angelegt werden."
277
+ #~ msgid "Help donating"
278
+ #~ msgstr "Spenden"
279
+ #~ msgid "Managing %s"
280
+ #~ msgstr "Administrando %s"
281
+
lang/capsman-es_ES.mo ADDED
Binary file
lang/capsman-es_ES.po ADDED
@@ -0,0 +1,392 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Capability Manager\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-01-29 15:03+0100\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Jordi Canals <devel@jcanals.cat>\n"
8
+ "Language-Team: Jordi Canals | http://alkivia.org <devel@jcanals.cat>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
+ "X-Poedit-Language: Spanish\n"
14
+ "X-Poedit-Country: SPAIN\n"
15
+ "X-Poedit-SourceCharset: utf-8\n"
16
+
17
+ #: ../capsman.php:53
18
+ msgid "Warning:"
19
+ msgstr "Atención:"
20
+
21
+ #: ../capsman.php:54
22
+ #, php-format
23
+ msgid "The active plugin %s is not compatible with your PHP version."
24
+ msgstr "La extensión activa %s no es compatible con tu versión de PHP."
25
+
26
+ #: ../capsman.php:56
27
+ #, php-format
28
+ msgid "%s is required for this plugin."
29
+ msgstr "Se require %s para utilizar esta extensión."
30
+
31
+ #: ../includes/admin.php:36
32
+ msgid "Roles and Capabilities"
33
+ msgstr "Roles y Permisos"
34
+
35
+ #: ../includes/admin.php:45
36
+ #, php-format
37
+ msgid "Capabilities for %s"
38
+ msgstr "Permisos para %s"
39
+
40
+ #: ../includes/admin.php:92
41
+ msgid "Level:"
42
+ msgstr "Nivel:"
43
+
44
+ #: ../includes/admin.php:115
45
+ #: ../includes/manager.php:319
46
+ msgid "Save Changes"
47
+ msgstr "Guardar cambios"
48
+
49
+ #: ../includes/admin.php:117
50
+ msgid "Delete this role"
51
+ msgstr "Eliminar este rol"
52
+
53
+ #: ../includes/admin.php:117
54
+ #, php-format
55
+ msgid ""
56
+ "You are about to delete the %s role.\n"
57
+ " 'Cancel' to stop, 'OK' to delete."
58
+ msgstr ""
59
+ "Estás a intentando eliminar el rol %s.\n"
60
+ " 'Aceptar' para borrar, 'Cancelar' para salir."
61
+
62
+ #: ../includes/admin.php:117
63
+ msgid "Delete Role"
64
+ msgstr "Eliminar Rol"
65
+
66
+ #: ../includes/admin.php:128
67
+ msgid "Select New Role"
68
+ msgstr "Seleccionar nuevo Rol"
69
+
70
+ #: ../includes/admin.php:136
71
+ #: ../includes/manager.php:296
72
+ msgid "Change"
73
+ msgstr "Cambiar"
74
+
75
+ #: ../includes/admin.php:141
76
+ msgid "Create New Role"
77
+ msgstr "Crear nuevo Rol"
78
+
79
+ #: ../includes/admin.php:144
80
+ #: ../includes/manager.php:300
81
+ msgid "Create"
82
+ msgstr "Crear"
83
+
84
+ #: ../includes/admin.php:149
85
+ msgid "Copy this role to"
86
+ msgstr "Copiar este rol a"
87
+
88
+ #: ../includes/admin.php:152
89
+ #: ../includes/manager.php:309
90
+ msgid "Copy"
91
+ msgstr "Copiar"
92
+
93
+ #: ../includes/admin.php:157
94
+ msgid "Add Capability"
95
+ msgstr "Añadir Permiso"
96
+
97
+ #: ../includes/admin.php:160
98
+ #: ../includes/manager.php:323
99
+ msgid "Add to role"
100
+ msgstr "Añadir al rol"
101
+
102
+ #: ../includes/backup.php:33
103
+ msgid "Backup Tool for Capability Manager"
104
+ msgstr "Herramienta de copias de seguridad para Capability Manager"
105
+
106
+ #: ../includes/backup.php:42
107
+ msgid "Backup and Restore"
108
+ msgstr "Salvar y Recuperar"
109
+
110
+ #: ../includes/backup.php:46
111
+ msgid "Select action:"
112
+ msgstr "Selecciona una acción:"
113
+
114
+ #: ../includes/backup.php:49
115
+ msgid "Backup roles and capabilities"
116
+ msgstr "Crea una copia de seguridad de roles y permisos"
117
+
118
+ #: ../includes/backup.php:50
119
+ msgid "Restore last saved backup"
120
+ msgstr "Recupera la última copia de seguridad"
121
+
122
+ #: ../includes/backup.php:52
123
+ msgid "Do Action"
124
+ msgstr "Ejecutar Acción"
125
+
126
+ #: ../includes/backup.php:60
127
+ msgid "Reset WordPress Defaults"
128
+ msgstr "Restaurar valores por defecto de WordPress"
129
+
130
+ #: ../includes/backup.php:62
131
+ msgid "WARNING:"
132
+ msgstr "ATENCIÓN:"
133
+
134
+ #: ../includes/backup.php:62
135
+ msgid "Reseting default Roles and Capabilities will set them to the WordPress install defaults."
136
+ msgstr "Restaurando los Roles y Premisos por defecto, los devolverá al estado por defecto de la instalación de WordPress."
137
+
138
+ #: ../includes/backup.php:63
139
+ msgid "If you have installed any plugin that adds new roles or capabilities, these will be lost."
140
+ msgstr "Si has instalado algún plugin que añade roles o permisos, estos se perderán."
141
+
142
+ #: ../includes/backup.php:64
143
+ msgid "It is recommended to use this only as a last resource!"
144
+ msgstr "¡Se recomienda utilitzar esta opción solo como último recurso!"
145
+
146
+ #: ../includes/backup.php:65
147
+ msgid "Reset Roles and Capabilities to WordPress defaults"
148
+ msgstr "Restaura Roles y Permisos a los valores por defecto de WordPress"
149
+
150
+ #: ../includes/backup.php:65
151
+ msgid ""
152
+ "You are about to reset Roles and Capabilities to WordPress defaults.\n"
153
+ " 'Cancel' to stop, 'OK' to reset."
154
+ msgstr ""
155
+ "Estás a intentando restaurar los valores por defecto de WordPress para Roles y Permisos.\n"
156
+ " 'Aceptar' para restaurar, 'Cancelar' para abandonar."
157
+
158
+ #: ../includes/backup.php:65
159
+ msgid "Reset to WordPress defaults"
160
+ msgstr "Restaura los valores por defecto de WordPress"
161
+
162
+ #: ../includes/manager.php:139
163
+ #: ../includes/manager.php:140
164
+ msgid "Capability Manager"
165
+ msgstr "Administrador de Permisos"
166
+
167
+ #: ../includes/manager.php:139
168
+ msgid "Capabilities"
169
+ msgstr "Permisos"
170
+
171
+ #: ../includes/manager.php:220
172
+ #: ../includes/manager.php:256
173
+ msgid "What do you think you're doing?!?"
174
+ msgstr "¿Que piensas que estás haciendo?"
175
+
176
+ #: ../includes/manager.php:283
177
+ msgid "Bad form Received"
178
+ msgstr "Se ha recibido un formulario incorrecto."
179
+
180
+ #: ../includes/manager.php:302
181
+ #: ../includes/manager.php:312
182
+ msgid "New role created."
183
+ msgstr "Se ha creado el nuevo rol."
184
+
185
+ #: ../includes/manager.php:305
186
+ #: ../includes/manager.php:315
187
+ msgid "Error: Failed creating the new role."
188
+ msgstr "Error: No se ha podido crear el nuevo rol."
189
+
190
+ #: ../includes/manager.php:320
191
+ msgid "New capabilities saved."
192
+ msgstr "Se han actualizado los nuevos permisos."
193
+
194
+ #: ../includes/manager.php:328
195
+ msgid "New capability added to role."
196
+ msgstr "Nuevos permiso añadido al rol."
197
+
198
+ #: ../includes/manager.php:330
199
+ msgid "Incorrect capability name."
200
+ msgstr "Nombre incorrecto de permiso ."
201
+
202
+ #: ../includes/manager.php:334
203
+ msgid "Bad form received."
204
+ msgstr "Se ha recibido un formulario incorrecto."
205
+
206
+ #: ../includes/manager.php:354
207
+ msgid "New backup saved."
208
+ msgstr "Se ha creado una nueva copia de seguridad."
209
+
210
+ #: ../includes/manager.php:360
211
+ msgid "Roles and Capabilities restored from last backup."
212
+ msgstr "Roles y permisos restaurados de la última copia de seguridad."
213
+
214
+ #: ../includes/manager.php:362
215
+ msgid "Restore failed. No backup found."
216
+ msgstr "Ha fallado la recuperación. No se encontró ninguna copia de seguridad."
217
+
218
+ #: ../includes/manager.php:384
219
+ #, php-format
220
+ msgid "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
221
+ msgstr "No se puede eliminar el rol predeterminado. <a href=\"%s\">Debes cambiarlo antes</a>."
222
+
223
+ #: ../includes/manager.php:405
224
+ #, php-format
225
+ msgid "Role has been deleted. %1$d users moved to default role %2$s."
226
+ msgstr "El rol ha sido eliminado. Se ha asignado el rol predeterminado %2$s a %1$d usuarios."
227
+
228
+ #: ../includes/manager.php:419
229
+ msgid "Needed function to create default roles not found!"
230
+ msgstr "¡No se encontró la función necesaria para crear los roles por defecto!"
231
+
232
+ #: ../includes/manager.php:431
233
+ msgid "Roles and Capabilities reset to WordPress defaults"
234
+ msgstr "Roles y Permisos restaurados a los valores por defecto de WordPress"
235
+
236
+ #: ../includes/manager.php:606
237
+ msgid "You cannot remove Manage Capabilities from Administrators"
238
+ msgstr "No se puede eliminar 'Manage Capabilities' de los administradores."
239
+
240
+ #~ msgid "Option blocked by administrator."
241
+ #~ msgstr "Opción bloqueada por el administrador."
242
+ #~ msgid "The active plugin %s is not compatible with your WordPress version."
243
+ #~ msgstr ""
244
+ #~ "La extensión activa %s no es compatible con tu versión de WordPress."
245
+ #~ msgid "WordPress %s is required to run this plugin."
246
+ #~ msgstr "Se require WordPress %s para ejecutar esta extensión."
247
+ #~ msgid "Standard sidebar functions are not present."
248
+ #~ msgstr ""
249
+ #~ "No se han encontrado algunas funciones de la barra lateral estándar."
250
+ #~ msgid "It is required to use the standard sidebar to run %s"
251
+ #~ msgstr "Es preciso utilizar la barra lateral estándar para ejectutar %s"
252
+ #~ msgid "Settings saved."
253
+ #~ msgstr "Opciones guardadas."
254
+ #~ msgid "Just Now"
255
+ #~ msgstr "Ahora mismo"
256
+ #~ msgid "1 minute ago"
257
+ #~ msgstr "Hace 1 minuto"
258
+ #~ msgid "1 hour ago"
259
+ #~ msgstr "Hace una hora"
260
+ #~ msgid "Today at %s"
261
+ #~ msgstr "Hoy a las %s"
262
+ #~ msgid "Yesterday at %s"
263
+ #~ msgstr "Ayer a las %s"
264
+ #~ msgid "Plugin Homepage"
265
+ #~ msgstr "Página del plugin"
266
+ #~ msgid "Theme Homepage"
267
+ #~ msgstr "Página del tema"
268
+ #~ msgid "Documentation"
269
+ #~ msgstr "Documentación"
270
+ #~ msgid "Support Forum"
271
+ #~ msgstr "Foro de soporte"
272
+ #~ msgid "Author Homepage"
273
+ #~ msgstr "Página del autor"
274
+ #~ msgid "Donate to project"
275
+ #~ msgstr "Haz un donativo"
276
+ #~ msgid "File error. Please try again."
277
+ #~ msgstr "Error de archivo. Por favor, reintentalo de nuevo."
278
+ #~ msgid "Local file doesn't exist."
279
+ #~ msgstr "El archivo local no existe."
280
+ #~ msgid "Local file is not readable."
281
+ #~ msgstr "El archivo local no es legible."
282
+ #~ msgid ""
283
+ #~ "File upload error (the uploaded file exceeds the upload_max_filesize "
284
+ #~ "directive in php.ini)."
285
+ #~ msgstr ""
286
+ #~ "Error de carga de archivo (el archivo cargado excede la directiva "
287
+ #~ "UPLOAD_MAX_FILESIZE de PHP)."
288
+ #~ msgid ""
289
+ #~ "File upload error (the uploaded file exceeds the MAX_FILE_SIZE directive "
290
+ #~ "that was specified in the html form)."
291
+ #~ msgstr ""
292
+ #~ "Error de carga de archivo (el archivo enviado excede la directiva "
293
+ #~ "MAX_FILE_SIZE especificada en el formulario)."
294
+ #~ msgid "File upload error (the uploaded file was only partially uploaded)."
295
+ #~ msgstr ""
296
+ #~ "Error de carga de archivo (el archivo sólo se recibió parcialmente)."
297
+ #~ msgid "File upload error (no file was uploaded)."
298
+ #~ msgstr "Error de carga de archivo (no se recibió archivo)."
299
+ #~ msgid "File upload error (missing a temporary folder)."
300
+ #~ msgstr "Error de carga de archivo (falta la carpeta temporal)."
301
+ #~ msgid "File upload error (failed to write file to disk)."
302
+ #~ msgstr "Error de carga de archivo (no se pudo escribir en el disco)."
303
+ #~ msgid "File upload error (file upload stopped by extension)."
304
+ #~ msgstr ""
305
+ #~ "Error de carga de archivo (se ha bloquedao el archivo por extensión)."
306
+ #~ msgid "File upload error (unknown error code)."
307
+ #~ msgstr "Error de carga de archivo (código de error desconocido)."
308
+ #~ msgid "File upload error. Please try again."
309
+ #~ msgstr "Error de carga de archivo. Por favor, reinténtalo."
310
+ #~ msgid "File too big."
311
+ #~ msgstr "Archivo demasiado grande."
312
+ #~ msgid "MIME type can't be detected."
313
+ #~ msgstr "No se pudo detectar el tipo MIME."
314
+ #~ msgid "Incorrect type of file."
315
+ #~ msgstr "Tipo de archivo incorrecto."
316
+ #~ msgid "Image too wide."
317
+ #~ msgstr "Imagen demasiado ancha."
318
+ #~ msgid "Image too narrow."
319
+ #~ msgstr "Imagen demasiado estrecha."
320
+ #~ msgid "Image too high."
321
+ #~ msgstr "Imagen demasiado alta."
322
+ #~ msgid "Image too short."
323
+ #~ msgstr "Imagen demasiado baja."
324
+ #~ msgid "Image ratio too high (image too wide)."
325
+ #~ msgstr "Ratio de imagen demariado alto (imagen demasiado ancha)."
326
+ #~ msgid "Image ratio too low (image too high)."
327
+ #~ msgstr "Ratio de imagen demasiado bajo (imagen demasiado alta)."
328
+ #~ msgid "Image has too many pixels."
329
+ #~ msgstr "La imágen tiene demasiados píxeles."
330
+ #~ msgid "Image has not enough pixels."
331
+ #~ msgstr "La imagen no tiene suficientes píxeles."
332
+ #~ msgid "File not uploaded. Can't carry on a process."
333
+ #~ msgstr "No se ha cargado el archivo. No se puede ejecutar el proceso."
334
+ #~ msgid "%s already exists. Please change the file name."
335
+ #~ msgstr "El archivo %s ya existe. Por favor, cambia el nombre de archivo."
336
+ #~ msgid "No correct temp source file. Can't carry on a process."
337
+ #~ msgstr "El archivo temporal es incorrecto. No se puede ejecutar el proceso."
338
+ #~ msgid "No correct uploaded source file. Can't carry on a process."
339
+ #~ msgstr "Archivo original incorrecto. No se puede ejecutar el proceso."
340
+ #~ msgid "Destination directory can't be created. Can't carry on a process."
341
+ #~ msgstr ""
342
+ #~ "No se puede crear el directorio de destino. No se puede realizar el "
343
+ #~ "proceso."
344
+ #~ msgid "Destination directory doesn't exist. Can't carry on a process."
345
+ #~ msgstr ""
346
+ #~ "El directorio de destino no existe. No se puede realizar el proceso."
347
+ #~ msgid "Destination path is not a directory. Can't carry on a process."
348
+ #~ msgstr ""
349
+ #~ "La ruta de destino no es un directorio. No se puede realizar el proceso."
350
+ #~ msgid ""
351
+ #~ "Destination directory can't be made writeable. Can't carry on a process."
352
+ #~ msgstr ""
353
+ #~ "El directorio de destino no se puede cambiar a escribible. No se puede "
354
+ #~ "realizar el proceso."
355
+ #~ msgid "Destination path is not a writeable. Can't carry on a process."
356
+ #~ msgstr ""
357
+ #~ "No se puede escribir en la ruta de destino. No se puede realizar el "
358
+ #~ "proceso."
359
+ #~ msgid "Can't create the temporary file. Can't carry on a process."
360
+ #~ msgstr ""
361
+ #~ "No se puede crar un archivo temporal. No se puede ejecutar el proceso."
362
+ #~ msgid "Source file is not readable. Can't carry on a process."
363
+ #~ msgstr ""
364
+ #~ "No se puede leer el archivo original. No se puede ejecutar el proceso."
365
+ #~ msgid "No create from %s support."
366
+ #~ msgstr "No hay soporte para crear desde %s."
367
+ #~ msgid "Error in creating %s image from source."
368
+ #~ msgstr "Error creacdo la imagen %s desde el original."
369
+ #~ msgid "Can't read image source. Not an image?."
370
+ #~ msgstr "No se puede leer la imagen orginal. ¿Es una imagen?"
371
+ #~ msgid "GD doesn't seem to be present."
372
+ #~ msgstr "No se ha detectado la libreria GD."
373
+ #~ msgid "No create from %s support, can't read watermark."
374
+ #~ msgstr ""
375
+ #~ "No hay soporte para crear desde %s. No se puede leer la marca de agua."
376
+ #~ msgid "No %s read support, can't create watermark."
377
+ #~ msgstr "No hay soporte para leer %s. No se puede crear la marca de agua."
378
+ #~ msgid "Unknown image format, can't read watermark."
379
+ #~ msgstr "Formato de imagen desconocido. No se puede leer la marca al agua."
380
+ #~ msgid "No %s create support."
381
+ #~ msgstr "No hay soporte para crear %s."
382
+ #~ msgid "No conversion type defined."
383
+ #~ msgstr "No se ha definido el tipo de conversión."
384
+ #~ msgid "Error copying file on the server. copy() failed."
385
+ #~ msgstr "Error coipiando el archivo en el servidor. Ha fallado copy()."
386
+ #~ msgid "Error reading the file."
387
+ #~ msgstr "Error leyendo el archivo."
388
+ #~ msgid "Help donating"
389
+ #~ msgstr "Ayuda donando"
390
+ #~ msgid "Managing %s"
391
+ #~ msgstr "Administrando %s"
392
+
lang/capsman-it_IT.mo ADDED
Binary file
lang/capsman-it_IT.po ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Capability Manager in italiano\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-01-29 15:06+0100\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Jordi Canals <devel@jcanals.cat>\n"
8
+ "Language-Team: Gianni Diurno | http://gidibao.net/ <gidibao@gmail.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
+ "X-Poedit-SourceCharset: utf-8\n"
14
+ "X-Poedit-KeywordsList: __;_e;_n\n"
15
+ "X-Poedit-Basepath: .\n"
16
+ "X-Poedit-Language: Italian\n"
17
+ "X-Poedit-Country: ITALY\n"
18
+ "X-Poedit-SearchPath-0: ..\n"
19
+
20
+ #: ../capsman.php:53
21
+ msgid "Warning:"
22
+ msgstr "Attenzione:"
23
+
24
+ #: ../capsman.php:54
25
+ #, php-format
26
+ msgid "The active plugin %s is not compatible with your PHP version."
27
+ msgstr "Il plugin %s non é compatibile con la tua versione PHP."
28
+
29
+ #: ../capsman.php:56
30
+ #, php-format
31
+ msgid "%s is required for this plugin."
32
+ msgstr "E' necessario %s per l'utilizzo di questo plugin."
33
+
34
+ #: ../includes/admin.php:36
35
+ msgid "Roles and Capabilities"
36
+ msgstr "Ruoli e capacità"
37
+
38
+ #: ../includes/admin.php:45
39
+ #, php-format
40
+ msgid "Capabilities for %s"
41
+ msgstr "Capacità per %s"
42
+
43
+ #: ../includes/admin.php:92
44
+ msgid "Level:"
45
+ msgstr "Livello:"
46
+
47
+ #: ../includes/admin.php:115
48
+ #: ../includes/manager.php:319
49
+ msgid "Save Changes"
50
+ msgstr "Salva le modifiche"
51
+
52
+ #: ../includes/admin.php:117
53
+ msgid "Delete this role"
54
+ msgstr "Cancella questo ruolo"
55
+
56
+ #: ../includes/admin.php:117
57
+ #, php-format
58
+ msgid ""
59
+ "You are about to delete the %s role.\n"
60
+ " 'Cancel' to stop, 'OK' to delete."
61
+ msgstr ""
62
+ "Stai per cancellare il ruolo %s.\n"
63
+ " 'Annulla' per fermarti, 'OK' per procedere."
64
+
65
+ #: ../includes/admin.php:117
66
+ msgid "Delete Role"
67
+ msgstr "Cancella il ruolo"
68
+
69
+ #: ../includes/admin.php:128
70
+ msgid "Select New Role"
71
+ msgstr "Seleziona ruolo"
72
+
73
+ #: ../includes/admin.php:136
74
+ #: ../includes/manager.php:296
75
+ msgid "Change"
76
+ msgstr "Cambia"
77
+
78
+ #: ../includes/admin.php:141
79
+ msgid "Create New Role"
80
+ msgstr "Crea un nuovo ruolo"
81
+
82
+ #: ../includes/admin.php:144
83
+ #: ../includes/manager.php:300
84
+ msgid "Create"
85
+ msgstr "Crea"
86
+
87
+ #: ../includes/admin.php:149
88
+ msgid "Copy this role to"
89
+ msgstr "Copia questo ruolo per"
90
+
91
+ #: ../includes/admin.php:152
92
+ #: ../includes/manager.php:309
93
+ msgid "Copy"
94
+ msgstr "Copia"
95
+
96
+ #: ../includes/admin.php:157
97
+ msgid "Add Capability"
98
+ msgstr "Aggiungi capacità"
99
+
100
+ #: ../includes/admin.php:160
101
+ #: ../includes/manager.php:323
102
+ msgid "Add to role"
103
+ msgstr "Aggiungi al ruolo"
104
+
105
+ #: ../includes/backup.php:33
106
+ msgid "Backup Tool for Capability Manager"
107
+ msgstr "Strumento di backup per Capability Manager"
108
+
109
+ #: ../includes/backup.php:42
110
+ msgid "Backup and Restore"
111
+ msgstr "Backup e Ripristino"
112
+
113
+ #: ../includes/backup.php:46
114
+ msgid "Select action:"
115
+ msgstr "Seleziona una azione:"
116
+
117
+ #: ../includes/backup.php:49
118
+ msgid "Backup roles and capabilities"
119
+ msgstr "Backup ruoli e capacità"
120
+
121
+ #: ../includes/backup.php:50
122
+ msgid "Restore last saved backup"
123
+ msgstr "Ripristina all'ultimo backup in memoria"
124
+
125
+ #: ../includes/backup.php:52
126
+ msgid "Do Action"
127
+ msgstr "Procedi"
128
+
129
+ #: ../includes/backup.php:60
130
+ msgid "Reset WordPress Defaults"
131
+ msgstr "Ripristina ai valori predefiniti di WordPress"
132
+
133
+ #: ../includes/backup.php:62
134
+ msgid "WARNING:"
135
+ msgstr "ATTENZIONE:"
136
+
137
+ #: ../includes/backup.php:62
138
+ msgid "Reseting default Roles and Capabilities will set them to the WordPress install defaults."
139
+ msgstr "Il ripristino alle predefinite per i Ruoli e le Capacità coinciderà con i valori predefiniti di WordPress."
140
+
141
+ #: ../includes/backup.php:63
142
+ msgid "If you have installed any plugin that adds new roles or capabilities, these will be lost."
143
+ msgstr "I ruoli e le capacità propri di ogni plugin installato saranno persi."
144
+
145
+ #: ../includes/backup.php:64
146
+ msgid "It is recommended to use this only as a last resource!"
147
+ msgstr "Da utilizzarsi solamente come ultima risorsa!"
148
+
149
+ #: ../includes/backup.php:65
150
+ msgid "Reset Roles and Capabilities to WordPress defaults"
151
+ msgstr "Ripristina i Ruoli e le Capacità ai valori predefiniti di WordPress"
152
+
153
+ #: ../includes/backup.php:65
154
+ msgid ""
155
+ "You are about to reset Roles and Capabilities to WordPress defaults.\n"
156
+ " 'Cancel' to stop, 'OK' to reset."
157
+ msgstr ""
158
+ "Stai per ripristinare i Ruoli e le Capacità ai valori predefiniti di WordPress.\n"
159
+ " 'Annulla' per fermarti, 'OK' per procedere."
160
+
161
+ #: ../includes/backup.php:65
162
+ msgid "Reset to WordPress defaults"
163
+ msgstr "Ripristina ai predefiniti di WordPress"
164
+
165
+ #: ../includes/manager.php:139
166
+ #: ../includes/manager.php:140
167
+ msgid "Capability Manager"
168
+ msgstr "Gestione capacità"
169
+
170
+ #: ../includes/manager.php:139
171
+ msgid "Capabilities"
172
+ msgstr "Capacità"
173
+
174
+ #: ../includes/manager.php:220
175
+ #: ../includes/manager.php:256
176
+ msgid "What do you think you're doing?!?"
177
+ msgstr "Cosa stai facendo?!?"
178
+
179
+ #: ../includes/manager.php:283
180
+ msgid "Bad form Received"
181
+ msgstr "E' stata ricevuta una richiesta errata"
182
+
183
+ #: ../includes/manager.php:302
184
+ #: ../includes/manager.php:312
185
+ msgid "New role created."
186
+ msgstr "Il nuovo ruolo é stato creato."
187
+
188
+ #: ../includes/manager.php:305
189
+ #: ../includes/manager.php:315
190
+ msgid "Error: Failed creating the new role."
191
+ msgstr "Errore: non é stato possibile creare il nuovo ruolo."
192
+
193
+ #: ../includes/manager.php:320
194
+ msgid "New capabilities saved."
195
+ msgstr "Le nuove capacità sono state salvate."
196
+
197
+ #: ../includes/manager.php:328
198
+ msgid "New capability added to role."
199
+ msgstr "La nuova capacità é stata aggiunta al ruolo."
200
+
201
+ #: ../includes/manager.php:330
202
+ msgid "Incorrect capability name."
203
+ msgstr "Nome non valido per la capacità."
204
+
205
+ #: ../includes/manager.php:334
206
+ msgid "Bad form received."
207
+ msgstr "E' stata ricevuta una richiesta errata."
208
+
209
+ #: ../includes/manager.php:354
210
+ msgid "New backup saved."
211
+ msgstr "Il nuovo backup é stato salvato."
212
+
213
+ #: ../includes/manager.php:360
214
+ msgid "Roles and Capabilities restored from last backup."
215
+ msgstr "I ruoli e le capacità sono stati ripristinati all'ultimo backup in memoria."
216
+
217
+ #: ../includes/manager.php:362
218
+ msgid "Restore failed. No backup found."
219
+ msgstr "Non é stato possibile effettuare il ripristino. Non é stato trovato alcun file di backup."
220
+
221
+ #: ../includes/manager.php:384
222
+ #, php-format
223
+ msgid "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
224
+ msgstr "Non é possibile cancellare il ruolo predefinito. E' necessario che tu compia questa <a href=\"%s\">modifica</a> prima di procedere."
225
+
226
+ #: ../includes/manager.php:405
227
+ #, php-format
228
+ msgid "Role has been deleted. %1$d users moved to default role %2$s."
229
+ msgstr "Il ruolo é stato cancellato. Gli utenti %1$d sono stati spostati nel ruolo predefinito a nome %2$s."
230
+
231
+ #: ../includes/manager.php:419
232
+ msgid "Needed function to create default roles not found!"
233
+ msgstr "La funzione necessaria per la creazione dei ruoli predefiniti non é stata trovata!"
234
+
235
+ #: ../includes/manager.php:431
236
+ msgid "Roles and Capabilities reset to WordPress defaults"
237
+ msgstr "I ruoli e le capacità sono stati ripristinati ai valori predefiniti di WordPress"
238
+
239
+ #: ../includes/manager.php:606
240
+ msgid "You cannot remove Manage Capabilities from Administrators"
241
+ msgstr "Non puoi rimuovere la gestione delle capacità per gli amministratori"
242
+
243
+ #~ msgid "The active plugin %s is not compatible with your WordPress version."
244
+ #~ msgstr "Il plugin %s non é compatibile con la tua versione di WordPress."
245
+ #~ msgid "WordPress %s is required to run this plugin."
246
+ #~ msgstr "Per l'utilizzo del plugin é necessario WordPress %s."
247
+ #~ msgid "Standard sidebar functions are not present."
248
+ #~ msgstr "Le funzioni standard per la sidebar non sono presenti."
249
+ #~ msgid "It is required to use the standard sidebar to run %s"
250
+ #~ msgstr "Necessario per l'utilizzo della sidebar standard %s"
251
+ #~ msgid "Settings saved."
252
+ #~ msgstr "Le impostazioni sono state salvate."
253
+ #~ msgid "Plugin Homepage"
254
+ #~ msgstr "Homepage del plugin"
255
+
256
+ #, fuzzy
257
+ #~ msgid "Theme Homepage"
258
+ #~ msgstr "Homepage autore"
259
+
260
+ #, fuzzy
261
+ #~ msgid "Documentation"
262
+ #~ msgstr "Procedi"
263
+ #~ msgid "Support Forum"
264
+ #~ msgstr "Forum di supporto"
265
+ #~ msgid "Author Homepage"
266
+ #~ msgstr "Homepage autore"
267
+
268
+ #, fuzzy
269
+ #~ msgid "Incorrect type of file."
270
+ #~ msgstr "Nome non valido per la capacità."
271
+
272
+ #, fuzzy
273
+ #~ msgid "Error in creating %s image from source."
274
+ #~ msgstr "Errore: non é stato possibile creare il nuovo ruolo."
275
+
276
+ #, fuzzy
277
+ #~ msgid "Error reading the file."
278
+ #~ msgstr "Errore: non é stato possibile creare il nuovo ruolo."
279
+ #~ msgid "Help donating"
280
+ #~ msgstr "Donazioni"
281
+
lang/capsman-ru_RU.mo ADDED
Binary file
lang/capsman-ru_RU.po ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Capability Manager\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-01-29 15:03+0100\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Jordi Canals <devel@jcanals.cat>\n"
8
+ "Language-Team: Fat Cow <gpl@alkivia.org>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
+ "X-Poedit-Language: Russian\n"
14
+ "X-Poedit-Country: RUSSIAN FEDERATION\n"
15
+ "X-Poedit-SourceCharset: utf-8\n"
16
+
17
+ #: ../capsman.php:53
18
+ msgid "Warning:"
19
+ msgstr "Предупреждение:"
20
+
21
+ #: ../capsman.php:54
22
+ #, php-format
23
+ msgid "The active plugin %s is not compatible with your PHP version."
24
+ msgstr "Плагин %s не совместим с вашей версией PHP."
25
+
26
+ #: ../capsman.php:56
27
+ #, php-format
28
+ msgid "%s is required for this plugin."
29
+ msgstr "%s необходим лоя плагина."
30
+
31
+ #: ../includes/admin.php:36
32
+ msgid "Roles and Capabilities"
33
+ msgstr "Роли и возможности"
34
+
35
+ #: ../includes/admin.php:45
36
+ #, php-format
37
+ msgid "Capabilities for %s"
38
+ msgstr "Возможность для %s"
39
+
40
+ #: ../includes/admin.php:92
41
+ msgid "Level:"
42
+ msgstr "Уровень:"
43
+
44
+ #: ../includes/admin.php:115
45
+ #: ../includes/manager.php:319
46
+ msgid "Save Changes"
47
+ msgstr "Сохранить настройки"
48
+
49
+ #: ../includes/admin.php:117
50
+ msgid "Delete this role"
51
+ msgstr "Удалить эту роль"
52
+
53
+ #: ../includes/admin.php:117
54
+ #, php-format
55
+ msgid ""
56
+ "You are about to delete the %s role.\n"
57
+ " 'Cancel' to stop, 'OK' to delete."
58
+ msgstr ""
59
+ "Вы об удалении роли %s.\n"
60
+ " 'Отменить' для остановки, 'ОК' для удаления."
61
+
62
+ #: ../includes/admin.php:117
63
+ msgid "Delete Role"
64
+ msgstr "Удаление роли"
65
+
66
+ #: ../includes/admin.php:128
67
+ msgid "Select New Role"
68
+ msgstr "Выбрать новую роль"
69
+
70
+ #: ../includes/admin.php:136
71
+ #: ../includes/manager.php:296
72
+ msgid "Change"
73
+ msgstr "Изменить"
74
+
75
+ #: ../includes/admin.php:141
76
+ msgid "Create New Role"
77
+ msgstr "Создать новую роль"
78
+
79
+ #: ../includes/admin.php:144
80
+ #: ../includes/manager.php:300
81
+ msgid "Create"
82
+ msgstr "Создать"
83
+
84
+ #: ../includes/admin.php:149
85
+ msgid "Copy this role to"
86
+ msgstr "Копия этой роли"
87
+
88
+ #: ../includes/admin.php:152
89
+ #: ../includes/manager.php:309
90
+ msgid "Copy"
91
+ msgstr "Копия"
92
+
93
+ #: ../includes/admin.php:157
94
+ msgid "Add Capability"
95
+ msgstr "Добавить возможность"
96
+
97
+ #: ../includes/admin.php:160
98
+ #: ../includes/manager.php:323
99
+ msgid "Add to role"
100
+ msgstr "Добавить роль"
101
+
102
+ #: ../includes/backup.php:33
103
+ msgid "Backup Tool for Capability Manager"
104
+ msgstr "Инструмент для создания резервной копии для Capability Manager"
105
+
106
+ #: ../includes/backup.php:42
107
+ msgid "Backup and Restore"
108
+ msgstr "Резервная копия и восстановление"
109
+
110
+ #: ../includes/backup.php:46
111
+ msgid "Select action:"
112
+ msgstr "Выбрать действие:"
113
+
114
+ #: ../includes/backup.php:49
115
+ msgid "Backup roles and capabilities"
116
+ msgstr "Резерв. копия ролей и возможностей"
117
+
118
+ #: ../includes/backup.php:50
119
+ msgid "Restore last saved backup"
120
+ msgstr "Восстановить из последнего сохраненного бэкапа"
121
+
122
+ #: ../includes/backup.php:52
123
+ msgid "Do Action"
124
+ msgstr "Нет действий"
125
+
126
+ #: ../includes/backup.php:60
127
+ msgid "Reset WordPress Defaults"
128
+ msgstr "Сбростить настройки WordPress по умолчанию"
129
+
130
+ #: ../includes/backup.php:62
131
+ msgid "WARNING:"
132
+ msgstr "ВНИМАНИЕ:"
133
+
134
+ #: ../includes/backup.php:62
135
+ msgid "Reseting default Roles and Capabilities will set them to the WordPress install defaults."
136
+ msgstr "Сброс стандартных ролей и возможностей должен сбросить настройки по умолчанию при установвке в WordPress."
137
+
138
+ #: ../includes/backup.php:63
139
+ msgid "If you have installed any plugin that adds new roles or capabilities, these will be lost."
140
+ msgstr "Если вы установили другой плагин, который добавляет новые роли или возможности, это должно исчезнуть. "
141
+
142
+ #: ../includes/backup.php:64
143
+ msgid "It is recommended to use this only as a last resource!"
144
+ msgstr "Это рекомендуется дя использования только как последный ресурс!"
145
+
146
+ #: ../includes/backup.php:65
147
+ msgid "Reset Roles and Capabilities to WordPress defaults"
148
+ msgstr "Сбросить роли и воможности"
149
+
150
+ #: ../includes/backup.php:65
151
+ msgid ""
152
+ "You are about to reset Roles and Capabilities to WordPress defaults.\n"
153
+ " 'Cancel' to stop, 'OK' to reset."
154
+ msgstr ""
155
+ "Вы об сбросе ролей и возможностей %s.\n"
156
+ " 'Отменить' для остановки, 'ОК' для сброса."
157
+
158
+ #: ../includes/backup.php:65
159
+ msgid "Reset to WordPress defaults"
160
+ msgstr "Сбросить настройки WordPress"
161
+
162
+ #: ../includes/manager.php:139
163
+ #: ../includes/manager.php:140
164
+ msgid "Capability Manager"
165
+ msgstr "Capability Manager"
166
+
167
+ #: ../includes/manager.php:139
168
+ msgid "Capabilities"
169
+ msgstr "Возможности"
170
+
171
+ #: ../includes/manager.php:220
172
+ #: ../includes/manager.php:256
173
+ msgid "What do you think you're doing?!?"
174
+ msgstr "Вы знаете, что делаете?!?"
175
+
176
+ #: ../includes/manager.php:283
177
+ msgid "Bad form Received"
178
+ msgstr "Se ha recibido un formulario incorrecto."
179
+
180
+ #: ../includes/manager.php:302
181
+ #: ../includes/manager.php:312
182
+ msgid "New role created."
183
+ msgstr "Новая роль создана."
184
+
185
+ #: ../includes/manager.php:305
186
+ #: ../includes/manager.php:315
187
+ msgid "Error: Failed creating the new role."
188
+ msgstr "Ошибка: Новая роль не создана."
189
+
190
+ #: ../includes/manager.php:320
191
+ msgid "New capabilities saved."
192
+ msgstr "Новые возможности сохранены."
193
+
194
+ #: ../includes/manager.php:328
195
+ msgid "New capability added to role."
196
+ msgstr "Новая воможность добавлена к роли."
197
+
198
+ #: ../includes/manager.php:330
199
+ msgid "Incorrect capability name."
200
+ msgstr "Некорректное имя возможности."
201
+
202
+ #: ../includes/manager.php:334
203
+ msgid "Bad form received."
204
+ msgstr "Плохая форма отправки."
205
+
206
+ #: ../includes/manager.php:354
207
+ msgid "New backup saved."
208
+ msgstr "Новый бэкап сохранен."
209
+
210
+ #: ../includes/manager.php:360
211
+ msgid "Roles and Capabilities restored from last backup."
212
+ msgstr "Роли и возможности восстановлены с последнего бэкапа."
213
+
214
+ #: ../includes/manager.php:362
215
+ msgid "Restore failed. No backup found."
216
+ msgstr "Восстановление остановлено. Не найдено бэкапов. "
217
+
218
+ #: ../includes/manager.php:384
219
+ #, php-format
220
+ msgid "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
221
+ msgstr "Не удалена стандартная роль. Вы <a href=\"%s\">должны сначала изменить это</a>."
222
+
223
+ #: ../includes/manager.php:405
224
+ #, php-format
225
+ msgid "Role has been deleted. %1$d users moved to default role %2$s."
226
+ msgstr "Роль была удалена. %1$d пользователей перемещена в стандартную роль %2$s."
227
+
228
+ #: ../includes/manager.php:419
229
+ msgid "Needed function to create default roles not found!"
230
+ msgstr "Необходимая функция по созданию ролей не найдена!"
231
+
232
+ #: ../includes/manager.php:431
233
+ msgid "Roles and Capabilities reset to WordPress defaults"
234
+ msgstr "Роли и возможности сброшены к стандартным для WordPress "
235
+
236
+ #: ../includes/manager.php:606
237
+ msgid "You cannot remove Manage Capabilities from Administrators"
238
+ msgstr "Вы не можете удалить Manage Capabilities через администраторов ."
239
+
240
+ #~ msgid "The active plugin %s is not compatible with your WordPress version."
241
+ #~ msgstr "Активный плагин %s не совместим с текущей версией WordPress."
242
+ #~ msgid "WordPress %s is required to run this plugin."
243
+ #~ msgstr "WordPress %s необходим для запуска этого плагина."
244
+ #~ msgid "Standard sidebar functions are not present."
245
+ #~ msgstr "Стандартные функции боковой панели не представлены."
246
+ #~ msgid "It is required to use the standard sidebar to run %s"
247
+ #~ msgstr ""
248
+ #~ "Это необходимо для использования стандартной боковой панели для запуска %s"
249
+ #~ msgid "Settings saved."
250
+ #~ msgstr "Настройки сохранены."
251
+ #~ msgid "Plugin Homepage"
252
+ #~ msgstr "Домашняя страница плагина"
253
+
254
+ #, fuzzy
255
+ #~ msgid "Theme Homepage"
256
+ #~ msgstr "Домашняя страница автора"
257
+
258
+ #, fuzzy
259
+ #~ msgid "Documentation"
260
+ #~ msgstr "Нет действий"
261
+ #~ msgid "Support Forum"
262
+ #~ msgstr "Форум поддержки"
263
+ #~ msgid "Author Homepage"
264
+ #~ msgstr "Домашняя страница автора"
265
+
266
+ #, fuzzy
267
+ #~ msgid "Incorrect type of file."
268
+ #~ msgstr "Некорректное имя возможности."
269
+
270
+ #, fuzzy
271
+ #~ msgid "Error in creating %s image from source."
272
+ #~ msgstr "Ошибка: Новая роль не создана."
273
+
274
+ #, fuzzy
275
+ #~ msgid "Error reading the file."
276
+ #~ msgstr "Ошибка: Новая роль не создана."
277
+ #~ msgid "Help donating"
278
+ #~ msgstr "Помощь через пожертвования"
279
+ #~ msgid "Managing %s"
280
+ #~ msgstr "Administrando %s"
281
+
lang/capsman-sv_SE.mo ADDED
Binary file
lang/capsman-sv_SE.po ADDED
@@ -0,0 +1,240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Capability Manager\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2010-01-29 15:03+0100\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Jens Wedin <me@jenswedin.com>\n"
8
+ "Language-Team: Jordi Canals | http://alkivia.org <devel@jcanals.cat>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
+ "X-Poedit-SourceCharset: utf-8\n"
14
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_c;_x:2c,1\n"
15
+ "X-Poedit-Basepath: .\n"
16
+ "X-Poedit-SearchPath-0: ..\n"
17
+
18
+ #: ../capsman.php:53
19
+ msgid "Warning:"
20
+ msgstr "Varning:"
21
+
22
+ #: ../capsman.php:54
23
+ #, php-format
24
+ msgid "The active plugin %s is not compatible with your PHP version."
25
+ msgstr "Det aktuella pluginet % är inte kompatibelt med din version av PHP."
26
+
27
+ #: ../capsman.php:56
28
+ #, php-format
29
+ msgid "%s is required for this plugin."
30
+ msgstr "%s krävs för detta plugin."
31
+
32
+ #: ../includes/admin.php:36
33
+ msgid "Roles and Capabilities"
34
+ msgstr "Roller och behörigheter"
35
+
36
+ #: ../includes/admin.php:45
37
+ #, php-format
38
+ msgid "Capabilities for %s"
39
+ msgstr "Behörighet för %s"
40
+
41
+ #: ../includes/admin.php:92
42
+ msgid "Level:"
43
+ msgstr "Nivå:"
44
+
45
+ #: ../includes/admin.php:115
46
+ #: ../includes/manager.php:319
47
+ msgid "Save Changes"
48
+ msgstr "Spara ändringar"
49
+
50
+ #: ../includes/admin.php:117
51
+ msgid "Delete this role"
52
+ msgstr "Ta bort roll"
53
+
54
+ #: ../includes/admin.php:117
55
+ #, php-format
56
+ msgid ""
57
+ "You are about to delete the %s role.\n"
58
+ " 'Cancel' to stop, 'OK' to delete."
59
+ msgstr ""
60
+ "Du håller på att ta bort %s rollen.\n"
61
+ "'Avbryt' för att stoppa, 'OK' för att ta bort."
62
+
63
+ #: ../includes/admin.php:117
64
+ msgid "Delete Role"
65
+ msgstr "Ta bort roll"
66
+
67
+ #: ../includes/admin.php:128
68
+ msgid "Select New Role"
69
+ msgstr "Välj ny roll"
70
+
71
+ #: ../includes/admin.php:136
72
+ #: ../includes/manager.php:296
73
+ msgid "Change"
74
+ msgstr "Ändra"
75
+
76
+ #: ../includes/admin.php:141
77
+ msgid "Create New Role"
78
+ msgstr "Skapa ny roll"
79
+
80
+ #: ../includes/admin.php:144
81
+ #: ../includes/manager.php:300
82
+ msgid "Create"
83
+ msgstr "Skapa"
84
+
85
+ #: ../includes/admin.php:149
86
+ msgid "Copy this role to"
87
+ msgstr "Kopiera rollen till"
88
+
89
+ #: ../includes/admin.php:152
90
+ #: ../includes/manager.php:309
91
+ msgid "Copy"
92
+ msgstr "Kopiera"
93
+
94
+ #: ../includes/admin.php:157
95
+ msgid "Add Capability"
96
+ msgstr "Lägg till behörigheter"
97
+
98
+ #: ../includes/admin.php:160
99
+ #: ../includes/manager.php:323
100
+ msgid "Add to role"
101
+ msgstr "Lägg till, till roll"
102
+
103
+ #: ../includes/backup.php:33
104
+ msgid "Backup Tool for Capability Manager"
105
+ msgstr "Säkerhetetskopiering för Capability Manager"
106
+
107
+ #: ../includes/backup.php:42
108
+ msgid "Backup and Restore"
109
+ msgstr "Säkerhetskopiera och Återställ"
110
+
111
+ #: ../includes/backup.php:46
112
+ msgid "Select action:"
113
+ msgstr "Välj alternativ:"
114
+
115
+ #: ../includes/backup.php:49
116
+ msgid "Backup roles and capabilities"
117
+ msgstr "Återställ roller och behörigheter"
118
+
119
+ #: ../includes/backup.php:50
120
+ msgid "Restore last saved backup"
121
+ msgstr "Återställ senaste versionen säkerhetskopian"
122
+
123
+ #: ../includes/backup.php:52
124
+ msgid "Do Action"
125
+ msgstr "Gör"
126
+
127
+ #: ../includes/backup.php:60
128
+ msgid "Reset WordPress Defaults"
129
+ msgstr "Återställ WordPress standardvärden"
130
+
131
+ #: ../includes/backup.php:62
132
+ msgid "WARNING:"
133
+ msgstr "VARNING:"
134
+
135
+ #: ../includes/backup.php:62
136
+ msgid "Reseting default Roles and Capabilities will set them to the WordPress install defaults."
137
+ msgstr "Att återställa standardvärderna för roller och och behörigheter kommer att återställa dem till WordPress standardvärden."
138
+
139
+ #: ../includes/backup.php:63
140
+ msgid "If you have installed any plugin that adds new roles or capabilities, these will be lost."
141
+ msgstr "Om du har installerat något plugin som lägger till nya roller och behörigheter kommer dessa att försvinna."
142
+
143
+ #: ../includes/backup.php:64
144
+ msgid "It is recommended to use this only as a last resource!"
145
+ msgstr "Det är rekommenderat att använda detta som en sista utväg! "
146
+
147
+ #: ../includes/backup.php:65
148
+ msgid "Reset Roles and Capabilities to WordPress defaults"
149
+ msgstr "Återställ roller och behörigheter till Wordpress standardvärden"
150
+
151
+ #: ../includes/backup.php:65
152
+ msgid ""
153
+ "You are about to reset Roles and Capabilities to WordPress defaults.\n"
154
+ " 'Cancel' to stop, 'OK' to reset."
155
+ msgstr ""
156
+ "Du håller på att återställa roller och behörigheter till WordPress standardvärden.\n"
157
+ "'Avbryt' för att stoppa, 'OK' för att återställa."
158
+
159
+ #: ../includes/backup.php:65
160
+ msgid "Reset to WordPress defaults"
161
+ msgstr "Återställ till WordPress standardvärden"
162
+
163
+ #: ../includes/manager.php:139
164
+ #: ../includes/manager.php:140
165
+ msgid "Capability Manager"
166
+ msgstr "Ändra behörighet"
167
+
168
+ #: ../includes/manager.php:139
169
+ msgid "Capabilities"
170
+ msgstr "Behörigheter"
171
+
172
+ #: ../includes/manager.php:220
173
+ #: ../includes/manager.php:256
174
+ msgid "What do you think you're doing?!?"
175
+ msgstr "Vad tror du håller på med?!?"
176
+
177
+ #: ../includes/manager.php:283
178
+ msgid "Bad form Received"
179
+ msgstr "Ett felande formulär har skickats"
180
+
181
+ #: ../includes/manager.php:302
182
+ #: ../includes/manager.php:312
183
+ msgid "New role created."
184
+ msgstr "Ny roll har skapats"
185
+
186
+ #: ../includes/manager.php:305
187
+ #: ../includes/manager.php:315
188
+ msgid "Error: Failed creating the new role."
189
+ msgstr "Fel: Det gick inte att skapa en ny roll."
190
+
191
+ #: ../includes/manager.php:320
192
+ msgid "New capabilities saved."
193
+ msgstr "Nya behörigheter har skapats."
194
+
195
+ #: ../includes/manager.php:328
196
+ msgid "New capability added to role."
197
+ msgstr "Nu behörighet har skapats."
198
+
199
+ #: ../includes/manager.php:330
200
+ msgid "Incorrect capability name."
201
+ msgstr "Fel på namnet för behörigheten"
202
+
203
+ #: ../includes/manager.php:334
204
+ msgid "Bad form received."
205
+ msgstr "Felande formulär har skickats."
206
+
207
+ #: ../includes/manager.php:354
208
+ msgid "New backup saved."
209
+ msgstr "Ny säkerhetskopiering har sparats."
210
+
211
+ #: ../includes/manager.php:360
212
+ msgid "Roles and Capabilities restored from last backup."
213
+ msgstr "Roller och behörigheter har återskapats från senaste säkerhetskopian."
214
+
215
+ #: ../includes/manager.php:362
216
+ msgid "Restore failed. No backup found."
217
+ msgstr "Återställningen misslyckades. Ingen säkerhetskopia hittades."
218
+
219
+ #: ../includes/manager.php:384
220
+ #, php-format
221
+ msgid "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
222
+ msgstr "Kan inte ta bort standard rollen. Du <a href=\"%s\">måste ändra den först</a>."
223
+
224
+ #: ../includes/manager.php:405
225
+ #, php-format
226
+ msgid "Role has been deleted. %1$d users moved to default role %2$s."
227
+ msgstr "Rollen har tagits bort. %1$d användare har flyttats till standardrollen %2$s."
228
+
229
+ #: ../includes/manager.php:419
230
+ msgid "Needed function to create default roles not found!"
231
+ msgstr "En viss funktion saknas för att skapa en standardroll."
232
+
233
+ #: ../includes/manager.php:431
234
+ msgid "Roles and Capabilities reset to WordPress defaults"
235
+ msgstr "Roller och behörigheter har återställts till WordPress standardvärden"
236
+
237
+ #: ../includes/manager.php:606
238
+ msgid "You cannot remove Manage Capabilities from Administrators"
239
+ msgstr "Du kan inte ta bort 'Ändra rättigheter' för Administratörer"
240
+
lang/capsman.mo ADDED
Binary file
lang/capsman.po ADDED
@@ -0,0 +1,854 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Capability Manager Enhanced\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-07-30 02:21-0500\n"
6
+ "PO-Revision-Date: 2012-07-30 02:21-0500\n"
7
+ "Last-Translator: Kevin Behrens <kevin@agapetry.net>\n"
8
+ "Language-Team: Agapetry Creations LLC <kevin@agapetry.net>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: __;_e;_c;__ngettext;_n;pp_po_trigger;_x\n"
13
+ "X-Poedit-Basepath: E:\\www\\wp34\\wp-content\\plugins\\capsman-enhanced\n"
14
+ "X-Poedit-Language: English\n"
15
+ "X-Poedit-Country: UNITED STATES\n"
16
+ "X-Poedit-SourceCharset: utf-8\n"
17
+ "X-Poedit-SearchPath-0: E:\\www\\wp34\\wp-content\\plugins\\capsman-enhanced\n"
18
+ "X-Poedit-SearchPath-1: E:\\www\\wp34\\wp-content\\plugins\\capsman-enhanced\\includes\n"
19
+
20
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/capsman-enhanced.php:43
21
+ msgid "<strong>Error:</strong> Capability Manager Extended cannot function because another copy of Capability Manager is active."
22
+ msgstr ""
23
+
24
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/capsman-enhanced.php:60
25
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/classes/abstract/plugin.php:344
26
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/classes/abstract/plugin.php:363
27
+ msgid "Warning:"
28
+ msgstr ""
29
+
30
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/capsman-enhanced.php:61
31
+ #, php-format
32
+ msgid "The active plugin %s is not compatible with your PHP version."
33
+ msgstr ""
34
+
35
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/capsman-enhanced.php:63
36
+ #, php-format
37
+ msgid "%s is required for this plugin."
38
+ msgstr ""
39
+
40
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/capsman-enhanced.php:91
41
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/capsman-enhanced.php:93
42
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/capsman-enhanced.php:97
43
+ msgid "Capability Manager"
44
+ msgstr ""
45
+
46
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/capsman-enhanced.php:91
47
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/capsman-enhanced.php:97
48
+ msgid "Role Capabilities"
49
+ msgstr ""
50
+
51
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/classes/template.php:90
52
+ msgid "Template class: Received template paths are not valid directories."
53
+ msgstr ""
54
+
55
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/classes/template.php:98
56
+ msgid "Template class: Received config paths are not valid directories."
57
+ msgstr ""
58
+
59
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/classes/template.php:174
60
+ #, php-format
61
+ msgid "Template class: %s is a reserved template variable."
62
+ msgstr ""
63
+
64
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/classes/template.php:338
65
+ #, php-format
66
+ msgid "Template file %1$s not found. Default template %2$s not found."
67
+ msgstr ""
68
+
69
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/classes/abstract/module.php:614
70
+ msgid "Option blocked by administrator."
71
+ msgstr ""
72
+
73
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/classes/abstract/plugin.php:345
74
+ #, php-format
75
+ msgid "The active plugin %s is not compatible with your WordPress version."
76
+ msgstr ""
77
+
78
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/classes/abstract/plugin.php:347
79
+ #, php-format
80
+ msgid "WordPress %s is required to run this plugin."
81
+ msgstr ""
82
+
83
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/classes/abstract/plugin.php:364
84
+ msgid "Standard sidebar functions are not present."
85
+ msgstr ""
86
+
87
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/classes/abstract/plugin.php:365
88
+ #, php-format
89
+ msgid "It is required to use the standard sidebar to run %s"
90
+ msgstr ""
91
+
92
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/classes/abstract/plugin.php:418
93
+ msgid "Activate Components"
94
+ msgstr ""
95
+
96
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/classes/abstract/plugin.php:427
97
+ msgid "Yes"
98
+ msgstr ""
99
+
100
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/classes/abstract/plugin.php:428
101
+ msgid "No"
102
+ msgstr ""
103
+
104
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/lib/formating.php:52
105
+ msgid "Settings saved."
106
+ msgstr ""
107
+
108
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/lib/formating.php:160
109
+ msgid "Just Now"
110
+ msgstr ""
111
+
112
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/lib/formating.php:163
113
+ msgid "1 minute ago"
114
+ msgstr ""
115
+
116
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/lib/formating.php:166
117
+ msgid "1 hour ago"
118
+ msgstr ""
119
+
120
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/lib/formating.php:170
121
+ #, php-format
122
+ msgid "Today at %s"
123
+ msgstr ""
124
+
125
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/lib/formating.php:170
126
+ #, php-format
127
+ msgid "Yesterday at %s"
128
+ msgstr ""
129
+
130
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/lib/themes.php:162
131
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/lib/themes.php:170
132
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/author-widget.php:33
133
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/author-widget.php:33
134
+ msgid "Plugin Homepage"
135
+ msgstr ""
136
+
137
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/lib/themes.php:163
138
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/lib/themes.php:178
139
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/author-widget.php:34
140
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/author-widget.php:34
141
+ msgid "Documentation"
142
+ msgstr ""
143
+
144
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/lib/themes.php:164
145
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/lib/themes.php:182
146
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/author-widget.php:35
147
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/author-widget.php:35
148
+ msgid "Support Forum"
149
+ msgstr ""
150
+
151
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/lib/themes.php:165
152
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/lib/themes.php:186
153
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/author-widget.php:36
154
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/author-widget.php:36
155
+ msgid "Author Homepage"
156
+ msgstr ""
157
+
158
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/lib/themes.php:166
159
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/author-widget.php:37
160
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/author-widget.php:37
161
+ msgid "Help donating"
162
+ msgstr ""
163
+
164
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/lib/themes.php:174
165
+ msgid "Theme Homepage"
166
+ msgstr ""
167
+
168
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/lib/themes.php:190
169
+ msgid "Donate to project"
170
+ msgstr ""
171
+
172
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2195
173
+ msgid "File error. Please try again."
174
+ msgstr ""
175
+
176
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2196
177
+ msgid "Local file doesn't exist."
178
+ msgstr ""
179
+
180
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2197
181
+ msgid "Local file is not readable."
182
+ msgstr ""
183
+
184
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2198
185
+ msgid "File upload error (the uploaded file exceeds the upload_max_filesize directive in php.ini)."
186
+ msgstr ""
187
+
188
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2199
189
+ msgid "File upload error (the uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form)."
190
+ msgstr ""
191
+
192
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2200
193
+ msgid "File upload error (the uploaded file was only partially uploaded)."
194
+ msgstr ""
195
+
196
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2201
197
+ msgid "File upload error (no file was uploaded)."
198
+ msgstr ""
199
+
200
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2202
201
+ msgid "File upload error (missing a temporary folder)."
202
+ msgstr ""
203
+
204
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2203
205
+ msgid "File upload error (failed to write file to disk)."
206
+ msgstr ""
207
+
208
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2204
209
+ msgid "File upload error (file upload stopped by extension)."
210
+ msgstr ""
211
+
212
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2205
213
+ msgid "File upload error (unknown error code)."
214
+ msgstr ""
215
+
216
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2206
217
+ msgid "File upload error. Please try again."
218
+ msgstr ""
219
+
220
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2207
221
+ msgid "File too big."
222
+ msgstr ""
223
+
224
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2208
225
+ msgid "MIME type can't be detected."
226
+ msgstr ""
227
+
228
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2209
229
+ msgid "Incorrect type of file."
230
+ msgstr ""
231
+
232
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2210
233
+ msgid "Image too wide."
234
+ msgstr ""
235
+
236
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2211
237
+ msgid "Image too narrow."
238
+ msgstr ""
239
+
240
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2212
241
+ msgid "Image too high."
242
+ msgstr ""
243
+
244
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2213
245
+ msgid "Image too short."
246
+ msgstr ""
247
+
248
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2214
249
+ msgid "Image ratio too high (image too wide)."
250
+ msgstr ""
251
+
252
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2215
253
+ msgid "Image ratio too low (image too high)."
254
+ msgstr ""
255
+
256
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2216
257
+ msgid "Image has too many pixels."
258
+ msgstr ""
259
+
260
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2217
261
+ msgid "Image has not enough pixels."
262
+ msgstr ""
263
+
264
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2218
265
+ msgid "File not uploaded. Can't carry on a process."
266
+ msgstr ""
267
+
268
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2219
269
+ #, php-format
270
+ msgid "%s already exists. Please change the file name."
271
+ msgstr ""
272
+
273
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2220
274
+ msgid "No correct temp source file. Can't carry on a process."
275
+ msgstr ""
276
+
277
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2221
278
+ msgid "No correct uploaded source file. Can't carry on a process."
279
+ msgstr ""
280
+
281
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2222
282
+ msgid "Destination directory can't be created. Can't carry on a process."
283
+ msgstr ""
284
+
285
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2223
286
+ msgid "Destination directory doesn't exist. Can't carry on a process."
287
+ msgstr ""
288
+
289
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2224
290
+ msgid "Destination path is not a directory. Can't carry on a process."
291
+ msgstr ""
292
+
293
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2225
294
+ msgid "Destination directory can't be made writeable. Can't carry on a process."
295
+ msgstr ""
296
+
297
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2226
298
+ msgid "Destination path is not a writeable. Can't carry on a process."
299
+ msgstr ""
300
+
301
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2227
302
+ msgid "Can't create the temporary file. Can't carry on a process."
303
+ msgstr ""
304
+
305
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2228
306
+ msgid "Source file is not readable. Can't carry on a process."
307
+ msgstr ""
308
+
309
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2229
310
+ #, php-format
311
+ msgid "No create from %s support."
312
+ msgstr ""
313
+
314
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2230
315
+ #, php-format
316
+ msgid "Error in creating %s image from source."
317
+ msgstr ""
318
+
319
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2231
320
+ msgid "Can't read image source. Not an image?."
321
+ msgstr ""
322
+
323
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2232
324
+ msgid "GD doesn't seem to be present."
325
+ msgstr ""
326
+
327
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2233
328
+ #, php-format
329
+ msgid "No create from %s support, can't read watermark."
330
+ msgstr ""
331
+
332
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2234
333
+ #, php-format
334
+ msgid "No %s read support, can't create watermark."
335
+ msgstr ""
336
+
337
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2235
338
+ msgid "Unknown image format, can't read watermark."
339
+ msgstr ""
340
+
341
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2236
342
+ #, php-format
343
+ msgid "No %s create support."
344
+ msgstr ""
345
+
346
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2237
347
+ msgid "No conversion type defined."
348
+ msgstr ""
349
+
350
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2238
351
+ msgid "Error copying file on the server. copy() failed."
352
+ msgstr ""
353
+
354
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/framework/vendor/upload/class.upload.php:2239
355
+ msgid "Error reading the file."
356
+ msgstr ""
357
+
358
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:67
359
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:67
360
+ msgid "Roles and Capabilities"
361
+ msgstr ""
362
+
363
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:76
364
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:76
365
+ #, php-format
366
+ msgid "Capabilities for %s"
367
+ msgstr ""
368
+
369
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:82
370
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:82
371
+ msgid "Use this form to view and modify the capabilities WordPress natively associates with each role. Note:"
372
+ msgstr ""
373
+
374
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:87
375
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:87
376
+ #, php-format
377
+ msgid "see %1$sRole Usage%2$s: \"Pattern Roles\""
378
+ msgstr ""
379
+
380
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:89
381
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:89
382
+ #, php-format
383
+ msgid "activate %1$sAdvanced settings%2$s, see Role Usage"
384
+ msgstr ""
385
+
386
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:91
387
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:91
388
+ #, php-format
389
+ msgid "\"Posts\" capabilities selected here also define type-specific role assignment for Permit Groups (%s)."
390
+ msgstr ""
391
+
392
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:93
393
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:93
394
+ msgid "Capabilities for custom statuses can be manually added to a role here (see Conditions > Capability Mapping for applicable names). However, it is usually more convenient to use Permit Groups to assign a supplemental status-specific role."
395
+ msgstr ""
396
+
397
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:98
398
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:98
399
+ msgid "Interested in further customizing editing or viewing access? Consider stepping up to <a href='#pp-more'>Press Permit</a>."
400
+ msgstr ""
401
+
402
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:118
403
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:118
404
+ msgid "Automatically define type-specific capabilities for your custom post types and taxonomies"
405
+ msgstr ""
406
+
407
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:121
408
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:121
409
+ msgid "Supplemental per-type, per-category or per-page role assignments"
410
+ msgstr ""
411
+
412
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:124
413
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:124
414
+ msgid "Custom Visibility statuses (require read_member_posts, read_premium_posts, etc.)"
415
+ msgstr ""
416
+
417
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:127
418
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:127
419
+ msgid "Custom Editability \"statuses\" - set alongside Visibility in Post and Category edit forms"
420
+ msgstr ""
421
+
422
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:130
423
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:130
424
+ msgid "Custom Moderation statuses, enabling access-limited three tier moderation (Pending / Approved / Published)"
425
+ msgstr ""
426
+
427
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:133
428
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:133
429
+ msgid "Grant Participant or Moderator access to specific bbPress forums or topics"
430
+ msgstr ""
431
+
432
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:136
433
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:136
434
+ msgid "Grant supplemental page or category access to all members of a BuddyPress group"
435
+ msgstr ""
436
+
437
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:139
438
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:139
439
+ msgid "WPML integration to mirror permissions to translations"
440
+ msgstr ""
441
+
442
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:142
443
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:142
444
+ msgid "Professional support available"
445
+ msgstr ""
446
+
447
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:188
448
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:188
449
+ msgid "&nbsp;"
450
+ msgstr ""
451
+
452
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:189
453
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:189
454
+ msgid "Reading"
455
+ msgstr ""
456
+
457
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:190
458
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:190
459
+ msgid "Editing Capabilities"
460
+ msgstr ""
461
+
462
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:191
463
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:191
464
+ msgid "Deletion Capabilities"
465
+ msgstr ""
466
+
467
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:199
468
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:199
469
+ msgid "can read posts which are currently published with private visibility"
470
+ msgstr ""
471
+
472
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:200
473
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:200
474
+ msgid "has basic editing capability (but may need other capabilities based on post status and ownership)"
475
+ msgstr ""
476
+
477
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:201
478
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:201
479
+ msgid "can edit posts which were created by other users"
480
+ msgstr ""
481
+
482
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:202
483
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:202
484
+ msgid "can edit posts which are currently published"
485
+ msgstr ""
486
+
487
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:203
488
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:203
489
+ msgid "can edit posts which are currently published with private visibility"
490
+ msgstr ""
491
+
492
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:204
493
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:204
494
+ msgid "can make a post publicly visible"
495
+ msgstr ""
496
+
497
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:205
498
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:205
499
+ msgid "has basic deletion capability (but may need other capabilities based on post status and ownership)"
500
+ msgstr ""
501
+
502
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:206
503
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:206
504
+ msgid "can delete posts which were created by other users"
505
+ msgstr ""
506
+
507
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:207
508
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:207
509
+ msgid "can delete posts which are currently published"
510
+ msgstr ""
511
+
512
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:208
513
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:208
514
+ msgid "can delete posts which are currently published with private visibility"
515
+ msgstr ""
516
+
517
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:277
518
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:350
519
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:399
520
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:277
521
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:350
522
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:399
523
+ #, php-format
524
+ msgid "%s: assigned by Permit Group"
525
+ msgstr ""
526
+
527
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:333
528
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:333
529
+ msgid "Other WordPress Core Capabilities"
530
+ msgstr ""
531
+
532
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:369
533
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:369
534
+ msgid "Additional Capabilities"
535
+ msgstr ""
536
+
537
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:436
538
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:436
539
+ msgid "Level:"
540
+ msgstr ""
541
+
542
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:457
543
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:457
544
+ msgid "Note: Underscores replace spaces in stored capability name (\"edit users\" => \"edit_users\")."
545
+ msgstr ""
546
+
547
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:468
548
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:375
549
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:468
550
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:375
551
+ msgid "Save Changes"
552
+ msgstr ""
553
+
554
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:470
555
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:470
556
+ msgid "Delete this role"
557
+ msgstr ""
558
+
559
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:470
560
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:470
561
+ #, php-format
562
+ msgid ""
563
+ "You are about to delete the %s role.\n"
564
+ " 'Cancel' to stop, 'OK' to delete."
565
+ msgstr ""
566
+
567
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:470
568
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:470
569
+ msgid "Delete Role"
570
+ msgstr ""
571
+
572
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:482
573
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:482
574
+ msgid "Select New Role"
575
+ msgstr ""
576
+
577
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:482
578
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:482
579
+ msgid "Select Role to View / Edit"
580
+ msgstr ""
581
+
582
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:490
583
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:490
584
+ msgid "Change"
585
+ msgstr ""
586
+
587
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:490
588
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:346
589
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:490
590
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:346
591
+ msgid "Load"
592
+ msgstr ""
593
+
594
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:495
595
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:495
596
+ msgid "Create New Role"
597
+ msgstr ""
598
+
599
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:497
600
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:497
601
+ msgid "Name of new role"
602
+ msgstr ""
603
+
604
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:498
605
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:350
606
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:498
607
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:350
608
+ msgid "Create"
609
+ msgstr ""
610
+
611
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:503
612
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:503
613
+ msgid "Copy this role to"
614
+ msgstr ""
615
+
616
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:503
617
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:503
618
+ #, php-format
619
+ msgid "Copy %s Role"
620
+ msgstr ""
621
+
622
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:505
623
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:505
624
+ msgid "Name of copied role"
625
+ msgstr ""
626
+
627
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:506
628
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:362
629
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:506
630
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:362
631
+ msgid "Copy"
632
+ msgstr ""
633
+
634
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:511
635
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:511
636
+ msgid "Add Capability"
637
+ msgstr ""
638
+
639
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:513
640
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:513
641
+ msgid "capability name"
642
+ msgstr ""
643
+
644
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:514
645
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:379
646
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:514
647
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:379
648
+ msgid "Add to role"
649
+ msgstr ""
650
+
651
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:520
652
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:520
653
+ msgid "Force Type-Specific Capabilities"
654
+ msgstr ""
655
+
656
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:523
657
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:523
658
+ msgid "Force unique capability names for:"
659
+ msgstr ""
660
+
661
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:564
662
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:564
663
+ msgid "(PP Filtered Post Types, Taxonomies)"
664
+ msgstr ""
665
+
666
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/admin.php:569
667
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:389
668
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/admin.php:569
669
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:389
670
+ msgid "Update"
671
+ msgstr ""
672
+
673
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/backup.php:33
674
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/backup.php:33
675
+ msgid "Backup Tool for Capability Manager"
676
+ msgstr ""
677
+
678
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/backup.php:42
679
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/backup.php:42
680
+ msgid "Backup and Restore"
681
+ msgstr ""
682
+
683
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/backup.php:46
684
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/backup.php:46
685
+ msgid "Select action:"
686
+ msgstr ""
687
+
688
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/backup.php:49
689
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/backup.php:49
690
+ msgid "Backup roles and capabilities"
691
+ msgstr ""
692
+
693
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/backup.php:50
694
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/backup.php:50
695
+ msgid "Restore last saved backup"
696
+ msgstr ""
697
+
698
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/backup.php:52
699
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/backup.php:52
700
+ msgid "Do Action"
701
+ msgstr ""
702
+
703
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/backup.php:60
704
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/backup.php:60
705
+ msgid "Reset WordPress Defaults"
706
+ msgstr ""
707
+
708
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/backup.php:62
709
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/backup.php:62
710
+ msgid "WARNING:"
711
+ msgstr ""
712
+
713
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/backup.php:62
714
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/backup.php:62
715
+ msgid "Reseting default Roles and Capabilities will set them to the WordPress install defaults."
716
+ msgstr ""
717
+
718
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/backup.php:63
719
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/backup.php:63
720
+ msgid "If you have installed any plugin that adds new roles or capabilities, these will be lost."
721
+ msgstr ""
722
+
723
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/backup.php:64
724
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/backup.php:64
725
+ msgid "It is recommended to use this only as a last resource!"
726
+ msgstr ""
727
+
728
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/backup.php:65
729
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/backup.php:65
730
+ msgid "Reset Roles and Capabilities to WordPress defaults"
731
+ msgstr ""
732
+
733
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/backup.php:65
734
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/backup.php:65
735
+ msgid ""
736
+ "You are about to reset Roles and Capabilities to WordPress defaults.\n"
737
+ " 'Cancel' to stop, 'OK' to reset."
738
+ msgstr ""
739
+
740
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/backup.php:65
741
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/backup.php:65
742
+ msgid "Reset to WordPress defaults"
743
+ msgstr ""
744
+
745
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:183
746
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:183
747
+ msgid "Capabilities"
748
+ msgstr ""
749
+
750
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:270
751
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:306
752
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:270
753
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:306
754
+ msgid "What do you think you're doing?!?"
755
+ msgstr ""
756
+
757
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:333
758
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:333
759
+ msgid "Bad form Received"
760
+ msgstr ""
761
+
762
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:352
763
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:365
764
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:352
765
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:365
766
+ msgid "New role created."
767
+ msgstr ""
768
+
769
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:356
770
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:369
771
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:356
772
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:369
773
+ msgid "Error: No role name specified."
774
+ msgstr ""
775
+
776
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:358
777
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:371
778
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:358
779
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:371
780
+ msgid "Error: Failed creating the new role."
781
+ msgstr ""
782
+
783
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:376
784
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:376
785
+ msgid "New capabilities saved."
786
+ msgstr ""
787
+
788
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:384
789
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:384
790
+ msgid "New capability added to role."
791
+ msgstr ""
792
+
793
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:386
794
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:386
795
+ msgid "Incorrect capability name."
796
+ msgstr ""
797
+
798
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:391
799
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:391
800
+ msgid "Capability settings saved."
801
+ msgstr ""
802
+
803
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:393
804
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:393
805
+ msgid "Error saving capability settings."
806
+ msgstr ""
807
+
808
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:397
809
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:397
810
+ msgid "Bad form received."
811
+ msgstr ""
812
+
813
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:417
814
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:417
815
+ msgid "New backup saved."
816
+ msgstr ""
817
+
818
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:423
819
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:423
820
+ msgid "Roles and Capabilities restored from last backup."
821
+ msgstr ""
822
+
823
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:425
824
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:425
825
+ msgid "Restore failed. No backup found."
826
+ msgstr ""
827
+
828
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:447
829
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:447
830
+ #, php-format
831
+ msgid "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
832
+ msgstr ""
833
+
834
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:468
835
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:468
836
+ #, php-format
837
+ msgid "Role has been deleted. %1$d users moved to default role %2$s."
838
+ msgstr ""
839
+
840
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:482
841
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:482
842
+ msgid "Needed function to create default roles not found!"
843
+ msgstr ""
844
+
845
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:494
846
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:494
847
+ msgid "Roles and Capabilities reset to WordPress defaults"
848
+ msgstr ""
849
+
850
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced/includes/manager.php:685
851
+ #: E:\www\wp34\wp-content\plugins\capsman-enhanced\includes/manager.php:685
852
+ msgid "You cannot remove Manage Capabilities from Administrators"
853
+ msgstr ""
854
+
lang/capsman.pot ADDED
@@ -0,0 +1,738 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2012
2
+ # This file is distributed under the same license as the package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: \n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/capability-manager-enhanced\n"
7
+ "POT-Creation-Date: 2012-07-30 21:29:36+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2012-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+
15
+ #: capsman-enhanced.php:40
16
+ msgid ""
17
+ "<strong>Error:</strong> Capability Manager Extended cannot function because "
18
+ "another copy of Capability Manager is active."
19
+ msgstr ""
20
+
21
+ #: capsman-enhanced.php:57 framework/classes/abstract/plugin.php:344
22
+ #: framework/classes/abstract/plugin.php:363
23
+ msgid "Warning:"
24
+ msgstr ""
25
+
26
+ #: capsman-enhanced.php:58
27
+ msgid "The active plugin %s is not compatible with your PHP version."
28
+ msgstr ""
29
+
30
+ #: capsman-enhanced.php:60
31
+ msgid "%s is required for this plugin."
32
+ msgstr ""
33
+
34
+ #: capsman-enhanced.php:88 capsman-enhanced.php:90 capsman-enhanced.php:94
35
+ #: includes/manager.php:183 includes/manager.php:186 includes/manager.php:190
36
+ msgid "Capability Manager"
37
+ msgstr ""
38
+
39
+ #: capsman-enhanced.php:88 capsman-enhanced.php:94 includes/manager.php:190
40
+ msgid "Role Capabilities"
41
+ msgstr ""
42
+
43
+ #: framework/classes/abstract/module.php:614
44
+ msgid "Option blocked by administrator."
45
+ msgstr ""
46
+
47
+ #: framework/classes/abstract/plugin.php:345
48
+ msgid "The active plugin %s is not compatible with your WordPress version."
49
+ msgstr ""
50
+
51
+ #: framework/classes/abstract/plugin.php:347
52
+ msgid "WordPress %s is required to run this plugin."
53
+ msgstr ""
54
+
55
+ #: framework/classes/abstract/plugin.php:364
56
+ msgid "Standard sidebar functions are not present."
57
+ msgstr ""
58
+
59
+ #: framework/classes/abstract/plugin.php:365
60
+ msgid "It is required to use the standard sidebar to run %s"
61
+ msgstr ""
62
+
63
+ #: framework/classes/abstract/plugin.php:418
64
+ msgid "Activate Components"
65
+ msgstr ""
66
+
67
+ #: framework/classes/abstract/plugin.php:427
68
+ msgid "Yes"
69
+ msgstr ""
70
+
71
+ #: framework/classes/abstract/plugin.php:428
72
+ msgid "No"
73
+ msgstr ""
74
+
75
+ #: framework/classes/template.php:90
76
+ msgid "Template class: Received template paths are not valid directories."
77
+ msgstr ""
78
+
79
+ #: framework/classes/template.php:98
80
+ msgid "Template class: Received config paths are not valid directories."
81
+ msgstr ""
82
+
83
+ #: framework/classes/template.php:174
84
+ msgid "Template class: %s is a reserved template variable."
85
+ msgstr ""
86
+
87
+ #: framework/classes/template.php:338
88
+ msgid "Template file %1$s not found. Default template %2$s not found."
89
+ msgstr ""
90
+
91
+ #: framework/lib/formating.php:52
92
+ msgid "Settings saved."
93
+ msgstr ""
94
+
95
+ #: framework/lib/formating.php:160
96
+ msgid "Just Now"
97
+ msgstr ""
98
+
99
+ #: framework/lib/formating.php:163
100
+ msgid "1 minute ago"
101
+ msgid_plural "%d minutes ago"
102
+ msgstr[0] ""
103
+ msgstr[1] ""
104
+
105
+ #: framework/lib/formating.php:166
106
+ msgid "1 hour ago"
107
+ msgid_plural "%d hours ago"
108
+ msgstr[0] ""
109
+ msgstr[1] ""
110
+
111
+ #: framework/lib/formating.php:170
112
+ msgid "Today at %s"
113
+ msgstr ""
114
+
115
+ #: framework/lib/formating.php:170
116
+ msgid "Yesterday at %s"
117
+ msgstr ""
118
+
119
+ #: framework/lib/themes.php:162 framework/lib/themes.php:170
120
+ #: includes/author-widget.php:33
121
+ msgid "Plugin Homepage"
122
+ msgstr ""
123
+
124
+ #: framework/lib/themes.php:163 framework/lib/themes.php:178
125
+ #: includes/author-widget.php:34
126
+ msgid "Documentation"
127
+ msgstr ""
128
+
129
+ #: framework/lib/themes.php:164 framework/lib/themes.php:182
130
+ #: includes/author-widget.php:35
131
+ msgid "Support Forum"
132
+ msgstr ""
133
+
134
+ #: framework/lib/themes.php:165 framework/lib/themes.php:186
135
+ #: includes/author-widget.php:36
136
+ msgid "Author Homepage"
137
+ msgstr ""
138
+
139
+ #: framework/lib/themes.php:166 includes/author-widget.php:37
140
+ msgid "Help donating"
141
+ msgstr ""
142
+
143
+ #: framework/lib/themes.php:174
144
+ msgid "Theme Homepage"
145
+ msgstr ""
146
+
147
+ #: framework/lib/themes.php:190
148
+ msgid "Donate to project"
149
+ msgstr ""
150
+
151
+ #: framework/vendor/upload/class.upload.php:2195
152
+ msgid "File error. Please try again."
153
+ msgstr ""
154
+
155
+ #: framework/vendor/upload/class.upload.php:2196
156
+ msgid "Local file doesn't exist."
157
+ msgstr ""
158
+
159
+ #: framework/vendor/upload/class.upload.php:2197
160
+ msgid "Local file is not readable."
161
+ msgstr ""
162
+
163
+ #: framework/vendor/upload/class.upload.php:2198
164
+ msgid ""
165
+ "File upload error (the uploaded file exceeds the upload_max_filesize "
166
+ "directive in php.ini)."
167
+ msgstr ""
168
+
169
+ #: framework/vendor/upload/class.upload.php:2199
170
+ msgid ""
171
+ "File upload error (the uploaded file exceeds the MAX_FILE_SIZE directive "
172
+ "that was specified in the html form)."
173
+ msgstr ""
174
+
175
+ #: framework/vendor/upload/class.upload.php:2200
176
+ msgid "File upload error (the uploaded file was only partially uploaded)."
177
+ msgstr ""
178
+
179
+ #: framework/vendor/upload/class.upload.php:2201
180
+ msgid "File upload error (no file was uploaded)."
181
+ msgstr ""
182
+
183
+ #: framework/vendor/upload/class.upload.php:2202
184
+ msgid "File upload error (missing a temporary folder)."
185
+ msgstr ""
186
+
187
+ #: framework/vendor/upload/class.upload.php:2203
188
+ msgid "File upload error (failed to write file to disk)."
189
+ msgstr ""
190
+
191
+ #: framework/vendor/upload/class.upload.php:2204
192
+ msgid "File upload error (file upload stopped by extension)."
193
+ msgstr ""
194
+
195
+ #: framework/vendor/upload/class.upload.php:2205
196
+ msgid "File upload error (unknown error code)."
197
+ msgstr ""
198
+
199
+ #: framework/vendor/upload/class.upload.php:2206
200
+ msgid "File upload error. Please try again."
201
+ msgstr ""
202
+
203
+ #: framework/vendor/upload/class.upload.php:2207
204
+ msgid "File too big."
205
+ msgstr ""
206
+
207
+ #: framework/vendor/upload/class.upload.php:2208
208
+ msgid "MIME type can't be detected."
209
+ msgstr ""
210
+
211
+ #: framework/vendor/upload/class.upload.php:2209
212
+ msgid "Incorrect type of file."
213
+ msgstr ""
214
+
215
+ #: framework/vendor/upload/class.upload.php:2210
216
+ msgid "Image too wide."
217
+ msgstr ""
218
+
219
+ #: framework/vendor/upload/class.upload.php:2211
220
+ msgid "Image too narrow."
221
+ msgstr ""
222
+
223
+ #: framework/vendor/upload/class.upload.php:2212
224
+ msgid "Image too high."
225
+ msgstr ""
226
+
227
+ #: framework/vendor/upload/class.upload.php:2213
228
+ msgid "Image too short."
229
+ msgstr ""
230
+
231
+ #: framework/vendor/upload/class.upload.php:2214
232
+ msgid "Image ratio too high (image too wide)."
233
+ msgstr ""
234
+
235
+ #: framework/vendor/upload/class.upload.php:2215
236
+ msgid "Image ratio too low (image too high)."
237
+ msgstr ""
238
+
239
+ #: framework/vendor/upload/class.upload.php:2216
240
+ msgid "Image has too many pixels."
241
+ msgstr ""
242
+
243
+ #: framework/vendor/upload/class.upload.php:2217
244
+ msgid "Image has not enough pixels."
245
+ msgstr ""
246
+
247
+ #: framework/vendor/upload/class.upload.php:2218
248
+ msgid "File not uploaded. Can't carry on a process."
249
+ msgstr ""
250
+
251
+ #: framework/vendor/upload/class.upload.php:2219
252
+ msgid "%s already exists. Please change the file name."
253
+ msgstr ""
254
+
255
+ #: framework/vendor/upload/class.upload.php:2220
256
+ msgid "No correct temp source file. Can't carry on a process."
257
+ msgstr ""
258
+
259
+ #: framework/vendor/upload/class.upload.php:2221
260
+ msgid "No correct uploaded source file. Can't carry on a process."
261
+ msgstr ""
262
+
263
+ #: framework/vendor/upload/class.upload.php:2222
264
+ msgid "Destination directory can't be created. Can't carry on a process."
265
+ msgstr ""
266
+
267
+ #: framework/vendor/upload/class.upload.php:2223
268
+ msgid "Destination directory doesn't exist. Can't carry on a process."
269
+ msgstr ""
270
+
271
+ #: framework/vendor/upload/class.upload.php:2224
272
+ msgid "Destination path is not a directory. Can't carry on a process."
273
+ msgstr ""
274
+
275
+ #: framework/vendor/upload/class.upload.php:2225
276
+ msgid ""
277
+ "Destination directory can't be made writeable. Can't carry on a process."
278
+ msgstr ""
279
+
280
+ #: framework/vendor/upload/class.upload.php:2226
281
+ msgid "Destination path is not a writeable. Can't carry on a process."
282
+ msgstr ""
283
+
284
+ #: framework/vendor/upload/class.upload.php:2227
285
+ msgid "Can't create the temporary file. Can't carry on a process."
286
+ msgstr ""
287
+
288
+ #: framework/vendor/upload/class.upload.php:2228
289
+ msgid "Source file is not readable. Can't carry on a process."
290
+ msgstr ""
291
+
292
+ #: framework/vendor/upload/class.upload.php:2229
293
+ msgid "No create from %s support."
294
+ msgstr ""
295
+
296
+ #: framework/vendor/upload/class.upload.php:2230
297
+ msgid "Error in creating %s image from source."
298
+ msgstr ""
299
+
300
+ #: framework/vendor/upload/class.upload.php:2231
301
+ msgid "Can't read image source. Not an image?."
302
+ msgstr ""
303
+
304
+ #: framework/vendor/upload/class.upload.php:2232
305
+ msgid "GD doesn't seem to be present."
306
+ msgstr ""
307
+
308
+ #: framework/vendor/upload/class.upload.php:2233
309
+ msgid "No create from %s support, can't read watermark."
310
+ msgstr ""
311
+
312
+ #: framework/vendor/upload/class.upload.php:2234
313
+ msgid "No %s read support, can't create watermark."
314
+ msgstr ""
315
+
316
+ #: framework/vendor/upload/class.upload.php:2235
317
+ msgid "Unknown image format, can't read watermark."
318
+ msgstr ""
319
+
320
+ #: framework/vendor/upload/class.upload.php:2236
321
+ msgid "No %s create support."
322
+ msgstr ""
323
+
324
+ #: framework/vendor/upload/class.upload.php:2237
325
+ msgid "No conversion type defined."
326
+ msgstr ""
327
+
328
+ #: framework/vendor/upload/class.upload.php:2238
329
+ msgid "Error copying file on the server. copy() failed."
330
+ msgstr ""
331
+
332
+ #: framework/vendor/upload/class.upload.php:2239
333
+ msgid "Error reading the file."
334
+ msgstr ""
335
+
336
+ #: includes/admin.php:67
337
+ msgid "Roles and Capabilities"
338
+ msgstr ""
339
+
340
+ #: includes/admin.php:76
341
+ msgid "Capabilities for %s"
342
+ msgstr ""
343
+
344
+ #: includes/admin.php:82
345
+ msgid ""
346
+ "Use this form to view and modify the capabilities WordPress natively "
347
+ "associates with each role. Note:"
348
+ msgstr ""
349
+
350
+ #: includes/admin.php:87
351
+ msgid "see %1$sRole Usage%2$s: \"Pattern Roles\""
352
+ msgstr ""
353
+
354
+ #: includes/admin.php:89
355
+ msgid "activate %1$sAdvanced settings%2$s, see Role Usage"
356
+ msgstr ""
357
+
358
+ #: includes/admin.php:91
359
+ msgid ""
360
+ "\"Posts\" capabilities selected here also define type-specific role "
361
+ "assignment for Permit Groups (%s)."
362
+ msgstr ""
363
+
364
+ #: includes/admin.php:93
365
+ msgid ""
366
+ "Capabilities for custom statuses can be manually added to a role here (see "
367
+ "Conditions > Capability Mapping for applicable names). However, it is "
368
+ "usually more convenient to use Permit Groups to assign a supplemental status-"
369
+ "specific role."
370
+ msgstr ""
371
+
372
+ #: includes/admin.php:98
373
+ msgid ""
374
+ "Interested in further customizing editing or viewing access? Consider "
375
+ "stepping up to <a href='#pp-more'>Press Permit</a>."
376
+ msgstr ""
377
+
378
+ #: includes/admin.php:118
379
+ msgid ""
380
+ "Automatically define type-specific capabilities for your custom post types "
381
+ "and taxonomies"
382
+ msgstr ""
383
+
384
+ #: includes/admin.php:121
385
+ msgid "Supplemental per-type, per-category or per-page role assignments"
386
+ msgstr ""
387
+
388
+ #: includes/admin.php:124
389
+ msgid ""
390
+ "Custom Visibility statuses (require read_member_posts, read_premium_posts, "
391
+ "etc.)"
392
+ msgstr ""
393
+
394
+ #: includes/admin.php:127
395
+ msgid ""
396
+ "Custom Editability \"statuses\" - set alongside Visibility in Post and "
397
+ "Category edit forms"
398
+ msgstr ""
399
+
400
+ #: includes/admin.php:130
401
+ msgid ""
402
+ "Custom Moderation statuses, enabling access-limited three tier moderation "
403
+ "(Pending / Approved / Published)"
404
+ msgstr ""
405
+
406
+ #: includes/admin.php:133
407
+ msgid ""
408
+ "Grant Participant or Moderator access to specific bbPress forums or topics"
409
+ msgstr ""
410
+
411
+ #: includes/admin.php:136
412
+ msgid ""
413
+ "Grant supplemental page or category access to all members of a BuddyPress "
414
+ "group"
415
+ msgstr ""
416
+
417
+ #: includes/admin.php:139
418
+ msgid "WPML integration to mirror permissions to translations"
419
+ msgstr ""
420
+
421
+ #: includes/admin.php:142
422
+ msgid "Professional support available"
423
+ msgstr ""
424
+
425
+ #: includes/admin.php:188
426
+ msgid "&nbsp;"
427
+ msgstr ""
428
+
429
+ #: includes/admin.php:189
430
+ msgid "Reading"
431
+ msgstr ""
432
+
433
+ #: includes/admin.php:190
434
+ msgid "Editing Capabilities"
435
+ msgstr ""
436
+
437
+ #: includes/admin.php:191
438
+ msgid "Deletion Capabilities"
439
+ msgstr ""
440
+
441
+ #: includes/admin.php:199
442
+ msgid "can read posts which are currently published with private visibility"
443
+ msgstr ""
444
+
445
+ #: includes/admin.php:200
446
+ msgid ""
447
+ "has basic editing capability (but may need other capabilities based on post "
448
+ "status and ownership)"
449
+ msgstr ""
450
+
451
+ #: includes/admin.php:201
452
+ msgid "can edit posts which were created by other users"
453
+ msgstr ""
454
+
455
+ #: includes/admin.php:202
456
+ msgid "can edit posts which are currently published"
457
+ msgstr ""
458
+
459
+ #: includes/admin.php:203
460
+ msgid "can edit posts which are currently published with private visibility"
461
+ msgstr ""
462
+
463
+ #: includes/admin.php:204
464
+ msgid "can make a post publicly visible"
465
+ msgstr ""
466
+
467
+ #: includes/admin.php:205
468
+ msgid ""
469
+ "has basic deletion capability (but may need other capabilities based on post "
470
+ "status and ownership)"
471
+ msgstr ""
472
+
473
+ #: includes/admin.php:206
474
+ msgid "can delete posts which were created by other users"
475
+ msgstr ""
476
+
477
+ #: includes/admin.php:207
478
+ msgid "can delete posts which are currently published"
479
+ msgstr ""
480
+
481
+ #: includes/admin.php:208
482
+ msgid "can delete posts which are currently published with private visibility"
483
+ msgstr ""
484
+
485
+ #: includes/admin.php:277 includes/admin.php:350 includes/admin.php:399
486
+ msgid "%s: assigned by Permit Group"
487
+ msgstr ""
488
+
489
+ #: includes/admin.php:333
490
+ msgid "Other WordPress Core Capabilities"
491
+ msgstr ""
492
+
493
+ #: includes/admin.php:369
494
+ msgid "Additional Capabilities"
495
+ msgstr ""
496
+
497
+ #: includes/admin.php:436
498
+ msgid "Level:"
499
+ msgstr ""
500
+
501
+ #: includes/admin.php:457
502
+ msgid ""
503
+ "Note: Underscores replace spaces in stored capability name (\"edit users\" "
504
+ "=> \"edit_users\")."
505
+ msgstr ""
506
+
507
+ #: includes/admin.php:468 includes/manager.php:375
508
+ msgid "Save Changes"
509
+ msgstr ""
510
+
511
+ #: includes/admin.php:470
512
+ msgid "Delete this role"
513
+ msgstr ""
514
+
515
+ #: includes/admin.php:470
516
+ msgid ""
517
+ "You are about to delete the %s role.\n"
518
+ " 'Cancel' to stop, 'OK' to delete."
519
+ msgstr ""
520
+
521
+ #: includes/admin.php:470
522
+ msgid "Delete Role"
523
+ msgstr ""
524
+
525
+ #: includes/admin.php:482
526
+ msgid "Select New Role"
527
+ msgstr ""
528
+
529
+ #: includes/admin.php:482
530
+ msgid "Select Role to View / Edit"
531
+ msgstr ""
532
+
533
+ #: includes/admin.php:490
534
+ msgid "Change"
535
+ msgstr ""
536
+
537
+ #: includes/admin.php:490 includes/manager.php:346
538
+ msgid "Load"
539
+ msgstr ""
540
+
541
+ #: includes/admin.php:495
542
+ msgid "Create New Role"
543
+ msgstr ""
544
+
545
+ #: includes/admin.php:497
546
+ msgid "Name of new role"
547
+ msgstr ""
548
+
549
+ #: includes/admin.php:498 includes/manager.php:350
550
+ msgid "Create"
551
+ msgstr ""
552
+
553
+ #: includes/admin.php:503
554
+ msgid "Copy this role to"
555
+ msgstr ""
556
+
557
+ #: includes/admin.php:503
558
+ msgid "Copy %s Role"
559
+ msgstr ""
560
+
561
+ #: includes/admin.php:505
562
+ msgid "Name of copied role"
563
+ msgstr ""
564
+
565
+ #: includes/admin.php:506 includes/manager.php:362
566
+ msgid "Copy"
567
+ msgstr ""
568
+
569
+ #: includes/admin.php:511
570
+ msgid "Add Capability"
571
+ msgstr ""
572
+
573
+ #: includes/admin.php:513
574
+ msgid "capability name"
575
+ msgstr ""
576
+
577
+ #: includes/admin.php:514 includes/manager.php:379
578
+ msgid "Add to role"
579
+ msgstr ""
580
+
581
+ #: includes/admin.php:520
582
+ msgid "Force Type-Specific Capabilities"
583
+ msgstr ""
584
+
585
+ #: includes/admin.php:523
586
+ msgid "Force unique capability names for:"
587
+ msgstr ""
588
+
589
+ #: includes/admin.php:564
590
+ msgid "(PP Filtered Post Types, Taxonomies)"
591
+ msgstr ""
592
+
593
+ #: includes/admin.php:569 includes/manager.php:389
594
+ msgid "Update"
595
+ msgstr ""
596
+
597
+ #: includes/backup.php:33
598
+ msgid "Backup Tool for Capability Manager"
599
+ msgstr ""
600
+
601
+ #: includes/backup.php:42
602
+ msgid "Backup and Restore"
603
+ msgstr ""
604
+
605
+ #: includes/backup.php:46
606
+ msgid "Select action:"
607
+ msgstr ""
608
+
609
+ #: includes/backup.php:49
610
+ msgid "Backup roles and capabilities"
611
+ msgstr ""
612
+
613
+ #: includes/backup.php:50
614
+ msgid "Restore last saved backup"
615
+ msgstr ""
616
+
617
+ #: includes/backup.php:52
618
+ msgid "Do Action"
619
+ msgstr ""
620
+
621
+ #: includes/backup.php:60
622
+ msgid "Reset WordPress Defaults"
623
+ msgstr ""
624
+
625
+ #: includes/backup.php:62
626
+ msgid "WARNING:"
627
+ msgstr ""
628
+
629
+ #: includes/backup.php:62
630
+ msgid ""
631
+ "Reseting default Roles and Capabilities will set them to the WordPress "
632
+ "install defaults."
633
+ msgstr ""
634
+
635
+ #: includes/backup.php:63
636
+ msgid ""
637
+ "If you have installed any plugin that adds new roles or capabilities, these "
638
+ "will be lost."
639
+ msgstr ""
640
+
641
+ #: includes/backup.php:64
642
+ msgid "It is recommended to use this only as a last resource!"
643
+ msgstr ""
644
+
645
+ #: includes/backup.php:65
646
+ msgid "Reset Roles and Capabilities to WordPress defaults"
647
+ msgstr ""
648
+
649
+ #: includes/backup.php:65
650
+ msgid ""
651
+ "You are about to reset Roles and Capabilities to WordPress defaults.\n"
652
+ " 'Cancel' to stop, 'OK' to reset."
653
+ msgstr ""
654
+
655
+ #: includes/backup.php:65
656
+ msgid "Reset to WordPress defaults"
657
+ msgstr ""
658
+
659
+ #: includes/manager.php:183
660
+ msgid "Capabilities"
661
+ msgstr ""
662
+
663
+ #: includes/manager.php:270 includes/manager.php:306
664
+ msgid "What do you think you're doing?!?"
665
+ msgstr ""
666
+
667
+ #: includes/manager.php:333
668
+ msgid "Bad form Received"
669
+ msgstr ""
670
+
671
+ #: includes/manager.php:352 includes/manager.php:365
672
+ msgid "New role created."
673
+ msgstr ""
674
+
675
+ #: includes/manager.php:356 includes/manager.php:369
676
+ msgid "Error: No role name specified."
677
+ msgstr ""
678
+
679
+ #: includes/manager.php:358 includes/manager.php:371
680
+ msgid "Error: Failed creating the new role."
681
+ msgstr ""
682
+
683
+ #: includes/manager.php:376
684
+ msgid "New capabilities saved."
685
+ msgstr ""
686
+
687
+ #: includes/manager.php:384
688
+ msgid "New capability added to role."
689
+ msgstr ""
690
+
691
+ #: includes/manager.php:386
692
+ msgid "Incorrect capability name."
693
+ msgstr ""
694
+
695
+ #: includes/manager.php:391
696
+ msgid "Capability settings saved."
697
+ msgstr ""
698
+
699
+ #: includes/manager.php:393
700
+ msgid "Error saving capability settings."
701
+ msgstr ""
702
+
703
+ #: includes/manager.php:397
704
+ msgid "Bad form received."
705
+ msgstr ""
706
+
707
+ #: includes/manager.php:417
708
+ msgid "New backup saved."
709
+ msgstr ""
710
+
711
+ #: includes/manager.php:423
712
+ msgid "Roles and Capabilities restored from last backup."
713
+ msgstr ""
714
+
715
+ #: includes/manager.php:425
716
+ msgid "Restore failed. No backup found."
717
+ msgstr ""
718
+
719
+ #: includes/manager.php:447
720
+ msgid ""
721
+ "Cannot delete default role. You <a href=\"%s\">have to change it first</a>."
722
+ msgstr ""
723
+
724
+ #: includes/manager.php:468
725
+ msgid "Role has been deleted. %1$d users moved to default role %2$s."
726
+ msgstr ""
727
+
728
+ #: includes/manager.php:482
729
+ msgid "Needed function to create default roles not found!"
730
+ msgstr ""
731
+
732
+ #: includes/manager.php:494
733
+ msgid "Roles and Capabilities reset to WordPress defaults"
734
+ msgstr ""
735
+
736
+ #: includes/manager.php:685
737
+ msgid "You cannot remove Manage Capabilities from Administrators"
738
+ msgstr ""
readme.txt ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Capability Manager Enhanced===
2
+ Contributors: txanny, kevinB
3
+ Help link: http://wordpress.org/tags/capsman-enhanced
4
+ Tags: roles, capabilities, manager, rights, role, capability, types, taxonomies
5
+ Requires at least: 2.9
6
+ Tested up to: 3.4.1
7
+ Stable tag: trunk
8
+
9
+ A simple way to manage WordPress roles and capabilities. With this plugin you will be able to easily create and manage roles and capabilities.
10
+
11
+ == Description ==
12
+
13
+ Capability Manager plugin 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.
14
+ You can also delegate capabilities management to other users. In this case, some restrictions apply to this users, as they can only set/unset the capabilities they have.
15
+ With the Backup/Restore tool, you can save your Roles and Capabilities before making changes and revert them if something goes wrong. You'll find it on the Tools menu.
16
+
17
+ * Capability manager has been tested to support only one WordPress role per user.
18
+ * Only users with 'manage_capabilities' can manage them. This capability is created at install time and assigned only to administrators.
19
+ * Administrator role cannot be deleted.
20
+ * Non-administrators can only manage roles or users with same or lower capabilities.
21
+
22
+ 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.
23
+
24
+ The main change from the original plugin is an improved UI which organizes capabilities:
25
+
26
+ * by post type
27
+ * by operation (read/edit/delete)
28
+ * by origin (WP core or plugin)
29
+
30
+ Capability Manager Enhanced also adds <a href="http://presspermit.com">Press Permit plugin</a> integration:
31
+
32
+ * easily specify which post types require type-specific capability definitions
33
+ * show capabilities which Press Permit adds to the role by supplemental type-specific role assignment
34
+
35
+ = Features: =
36
+
37
+ * Manage role capabilities.
38
+ * Create new roles or delete existing ones.
39
+ * Add new capabilities to any existing role.
40
+ * Backup and restore Roles and Capabilities to revert your last changes.
41
+ * Revert Roles and Capabilities to WordPress defaults.
42
+
43
+ = Languages included: =
44
+
45
+ * English
46
+ * Catalan
47
+ * Spanish
48
+ * Belorussian *by <a href="http://antsar.info/" rel="nofollow">Ilyuha</a>*
49
+ * German *by <a href="http://great-solution.de/" rel="nofollow">Carsten Tauber</a>*
50
+ * Italian *by <a href="http://gidibao.net" rel="nofollow">Gianni Diurno</a>*
51
+ * Russian *by <a href="http://www.fatcow.com" rel="nofollow">Marcis Gasuns</a>*
52
+ * Swedish *by <a href="http://jenswedin.com/" rel="nofollow">Jens Wedin</a>
53
+ * POT file for easy translation to other languages included.
54
+
55
+ == Installation ==
56
+
57
+ = System Requirements =
58
+
59
+ * **Requires PHP 5.2**. Older versions of PHP are obsolete and expose your site to security risks.
60
+ * Verify the plugin is compatible with your WordPress Version. If not, plugin will not load.
61
+
62
+ = Installing the plugin =
63
+
64
+ 1. Unzip the plugin archive.
65
+ 1. Upload the plugin's folder to the WordPress plugins directory.
66
+ 1. Activate the plugin through the 'Plugins' menu in WordPress.
67
+ 1. Manage the capabilities on the 'Capabilities' page on Users menu.
68
+ 1. Enjoy your plugin!
69
+
70
+ == Screenshots ==
71
+
72
+ 1. Users Menu.
73
+ 2. View or Modify capabilities for a role.
74
+ 3. Actions on roles.
75
+ 4. Permissions Menu (Press Permit integration).
76
+ 5. View or Modify capabilities for a role (Press Permit integration).
77
+ 6. Actions on roles (Press Permit integration).
78
+ 7. Backup/Restore tool.
79
+
80
+ == Frequently Asked Questions ==
81
+
82
+ = Where can I find more information about this plugin, usage and support ? =
83
+
84
+ * If you need help, <a href="http://wordpress.org/tags/capsman-enhanced">ask in the Support forum</a>.
85
+
86
+ == License ==
87
+
88
+ Copyright 2009, 2010 Jordi Canals
89
+ Copyright 2012, Kevin Behrens
90
+
91
+ 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.
92
+
93
+ 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.
94
+
95
+ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
96
+
97
+ == Changelog ==
98
+
99
+ = 1.4.1 =
100
+ * https compatibility: use content_url(), plugins_url()
101
+ * Press Permit integration: if role definitions are reset to WP defaults, also repopulate PP capabilities (pp_manage_settings, etc.)
102
+
103
+ = 1.4 =
104
+ * Organized capabilities UI by post type and operation
105
+ * Editing UI separates WP core capabilities and 3rd party capabilities
106
+ * Clarified sidebar captions
107
+ * Don't allow a non-Administrator to add or remove a capability they don't have
108
+ * Fixed PHP Warnings for unchecked capabilities
109
+ * Press Permit integration: externally (dis)enable Post Types, Taxonomies for PP filtering (which forces type-specific capability definitions)
110
+ * Show capabilities which Press Permit adds to the role by supplemental type-specific role assignment
111
+ * Reduce memory usage by loading framework and plugin code only when needed
112
+
113
+ = 1.3.2 =
114
+ * Added Swedish translation.
115
+
116
+ = 1.3.1 =
117
+ * Fixed a bug where administrators could not create or manage other administrators.
118
+
119
+ = 1.3 =
120
+ * Cannot edit users with more capabilities than current user.
121
+ * Cannot assign to users a role with more capabilities than current user.
122
+ * Solved an incompatibility with Chameleon theme.
123
+ * Migrated to the new Alkivia Framework.
124
+ * Changed license to GPL version 2.
125
+
126
+ = 1.2.5 =
127
+ * Tested up to WP 2.9.1.
128
+
129
+ = 1.2.4 =
130
+ * Added Italian translation.
131
+
132
+ = 1.2.3 =
133
+ * Added German and Belorussian translations.
134
+
135
+ = 1.2.2 =
136
+ * Added Russian translation.
137
+
138
+ = 1.2.1 =
139
+ * Coding Standards.
140
+ * Corrected internal links.
141
+ * Updated Framework.
142
+
143
+ = 1.2 =
144
+ * Added backup/restore tool.
145
+
146
+ = 1.1 =
147
+ * Role deletion added.
148
+
149
+ = 1.0.1 =
150
+ * Some code improvements.
151
+ * Updated Alkivia Framework.
152
+
153
+ = 1.0 =
154
+ * First public version.
155
+
156
+ == Upgrade Notice ==
157
+
158
+ = 1.3.2 =
159
+ Only Swedish translation.
160
+
161
+ = 1.3.1 =
162
+ Bug fixes.
163
+
164
+ = 1.3 =
165
+ Improved security esiting users. You can now create real user managers.
samples/alkivia.ini ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ; $Id: alkivia.ini 203758 2010-02-10 19:01:07Z Txanny $
2
+
3
+ ; If you set this file on your wp-content directory, it will override the plugin
4
+ ; options, force to use this ones and disable them from the admin page.
5
+
6
+ ; All alkivia plugins and themes share the same file. If you already have an
7
+ ; alkivia.ini file in your wp-content directory, you can copy and paste this
8
+ ; settings on it.
9
+
10
+ ; The ini file is mostly used on WordPress MU, when we want to force all blogs to
11
+ ; this settings and don't want to allow the blog administrators to change them.
12
+
13
+ ; More information at http://wiki.alkivia.org/capsman/config
14
+ ; SEE ALSO THE alkivia.ini FILE ON THE framework/samples folder.
15
+
16
+
17
+ [capsman]
18
+ ; form-rows = 5
screenshot-1.jpg ADDED
Binary file
screenshot-2.jpg ADDED
Binary file
screenshot-3.jpg ADDED
Binary file
screenshot-4.jpg ADDED
Binary file
screenshot-5.jpg ADDED
Binary file
screenshot-6.jpg ADDED
Binary file
screenshot-7.png ADDED
Binary file