Changeset 3070758
- Timestamp:
- 04/15/2024 12:36:01 PM (23 months ago)
- Location:
- onlyoffice/trunk
- Files:
-
- 43 added
- 5 deleted
- 57 edited
-
CHANGELOG.md (modified) (1 diff)
-
admin/class-onlyoffice-plugin-admin.php (modified) (3 diffs)
-
admin/css/onlyoffice-wordpress-admin.css (modified) (1 diff)
-
admin/css/settings.css (added)
-
admin/js/onlyoffice-admin-media.js (deleted)
-
admin/js/settings.js (added)
-
assets-onlyoffice (added)
-
assets-onlyoffice/js (added)
-
assets-onlyoffice/js/formatsUtils.js (added)
-
composer.json (deleted)
-
controllers/class-onlyoffice-plugin-frontend-controller.php (modified) (6 diffs)
-
controllers/css (added)
-
controllers/css/frontend-controller.css (added)
-
controllers/images (added)
-
controllers/images/error.svg (added)
-
controllers/images/onlyoffice.svg (added)
-
controllers/js (added)
-
controllers/js/frontend-controller.js (added)
-
editor.php (added)
-
includes/class-onlyoffice-plugin-activator.php (modified) (2 diffs)
-
includes/class-onlyoffice-plugin-deactivator.php (modified) (1 diff)
-
includes/class-onlyoffice-plugin-i18n.php (modified) (1 diff)
-
includes/class-onlyoffice-plugin-loader.php (modified) (1 diff)
-
includes/class-onlyoffice-plugin.php (modified) (6 diffs)
-
includes/files/class-onlyoffice-plugin-files-list-table.php (modified) (10 diffs)
-
includes/files/class-onlyoffice-plugin-files.php (modified) (3 diffs)
-
includes/files/js (added)
-
includes/files/js/onlyoffice-files-list-table.js (added)
-
includes/managers/class-onlyoffice-plugin-callback-manager.php (modified) (1 diff)
-
includes/managers/class-onlyoffice-plugin-config-manager.php (modified) (4 diffs)
-
includes/managers/class-onlyoffice-plugin-document-manager.php (modified) (9 diffs)
-
includes/managers/class-onlyoffice-plugin-jwt-manager.php (modified) (2 diffs)
-
includes/managers/class-onlyoffice-plugin-url-manager.php (modified) (5 diffs)
-
includes/settings/class-onlyoffice-plugin-settings.php (modified) (10 diffs)
-
languages/onlyoffice-plugin-de_DE-18579bef1e63739970bd79e6dcc6ee92.json (added)
-
languages/onlyoffice-plugin-de_DE-4d9e7e5bfeb560d3581c5fa0f4136bc5.json (added)
-
languages/onlyoffice-plugin-de_DE-c6d39b7cfad17364ba238197448a913b.json (added)
-
languages/onlyoffice-plugin-de_DE.mo (modified) (previous)
-
languages/onlyoffice-plugin-de_DE.po (modified) (4 diffs)
-
languages/onlyoffice-plugin-en-18579bef1e63739970bd79e6dcc6ee92.json (added)
-
languages/onlyoffice-plugin-en-4d9e7e5bfeb560d3581c5fa0f4136bc5.json (added)
-
languages/onlyoffice-plugin-en-c6d39b7cfad17364ba238197448a913b.json (added)
-
languages/onlyoffice-plugin-en.mo (modified) (previous)
-
languages/onlyoffice-plugin-en.po (modified) (4 diffs)
-
languages/onlyoffice-plugin-es_ES-18579bef1e63739970bd79e6dcc6ee92.json (added)
-
languages/onlyoffice-plugin-es_ES-4d9e7e5bfeb560d3581c5fa0f4136bc5.json (added)
-
languages/onlyoffice-plugin-es_ES-c6d39b7cfad17364ba238197448a913b.json (added)
-
languages/onlyoffice-plugin-es_ES.mo (modified) (previous)
-
languages/onlyoffice-plugin-es_ES.po (modified) (4 diffs)
-
languages/onlyoffice-plugin-fr_FR-18579bef1e63739970bd79e6dcc6ee92.json (added)
-
languages/onlyoffice-plugin-fr_FR-4d9e7e5bfeb560d3581c5fa0f4136bc5.json (added)
-
languages/onlyoffice-plugin-fr_FR-c6d39b7cfad17364ba238197448a913b.json (added)
-
languages/onlyoffice-plugin-fr_FR.mo (modified) (previous)
-
languages/onlyoffice-plugin-fr_FR.po (modified) (4 diffs)
-
languages/onlyoffice-plugin-it_IT-18579bef1e63739970bd79e6dcc6ee92.json (added)
-
languages/onlyoffice-plugin-it_IT-4d9e7e5bfeb560d3581c5fa0f4136bc5.json (added)
-
languages/onlyoffice-plugin-it_IT-c6d39b7cfad17364ba238197448a913b.json (added)
-
languages/onlyoffice-plugin-it_IT.mo (modified) (previous)
-
languages/onlyoffice-plugin-it_IT.po (modified) (4 diffs)
-
languages/onlyoffice-plugin-ja-18579bef1e63739970bd79e6dcc6ee92.json (added)
-
languages/onlyoffice-plugin-ja-4d9e7e5bfeb560d3581c5fa0f4136bc5.json (added)
-
languages/onlyoffice-plugin-ja-c6d39b7cfad17364ba238197448a913b.json (added)
-
languages/onlyoffice-plugin-ja.mo (modified) (previous)
-
languages/onlyoffice-plugin-ja.po (modified) (4 diffs)
-
languages/onlyoffice-plugin-ru_RU-18579bef1e63739970bd79e6dcc6ee92.json (added)
-
languages/onlyoffice-plugin-ru_RU-4d9e7e5bfeb560d3581c5fa0f4136bc5.json (added)
-
languages/onlyoffice-plugin-ru_RU-c6d39b7cfad17364ba238197448a913b.json (added)
-
languages/onlyoffice-plugin-ru_RU.mo (modified) (previous)
-
languages/onlyoffice-plugin-ru_RU.po (modified) (4 diffs)
-
languages/onlyoffice-plugin-zh_CN-18579bef1e63739970bd79e6dcc6ee92.json (added)
-
languages/onlyoffice-plugin-zh_CN-4d9e7e5bfeb560d3581c5fa0f4136bc5.json (added)
-
languages/onlyoffice-plugin-zh_CN-c6d39b7cfad17364ba238197448a913b.json (added)
-
languages/onlyoffice-plugin-zh_CN.mo (modified) (previous)
-
languages/onlyoffice-plugin-zh_CN.po (modified) (4 diffs)
-
languages/onlyoffice-plugin.pot (modified) (4 diffs)
-
licenses/3rd-Party.license (modified) (1 diff)
-
onlyoffice-tinymce/onlyoffice-tinymce.js (modified) (1 diff)
-
onlyoffice-tinymce/onlyoffice-tinymce.php (modified) (1 diff)
-
onlyoffice-wordpress-block/block.json (modified) (2 diffs)
-
onlyoffice-wordpress-block/build/index.asset.php (modified) (1 diff)
-
onlyoffice-wordpress-block/build/index.css (added)
-
onlyoffice-wordpress-block/build/index.js (modified) (1 diff)
-
onlyoffice-wordpress-block/package-lock.json (deleted)
-
onlyoffice-wordpress-block/package.json (deleted)
-
onlyoffice-wordpress-block/src/edit.js (modified) (7 diffs)
-
onlyoffice-wordpress-block/src/index.js (modified) (3 diffs)
-
onlyoffice-wordpress-block/src/logos.js (added)
-
onlyoffice-wordpress-block/src/save.js (modified) (2 diffs)
-
onlyoffice-wordpress-block/src/styles.css (added)
-
onlyoffice-wordpress.php (modified) (7 diffs)
-
public/assets/document-formats/CHANGELOG.md (modified) (1 diff)
-
public/assets/document-formats/onlyoffice-docs-formats.json (modified) (5 diffs)
-
public/class-onlyoffice-plugin-public.php (modified) (3 diffs)
-
public/images/blank.svg (added)
-
public/views/class-onlyoffice-plugin-callback.php (modified) (3 diffs)
-
public/views/class-onlyoffice-plugin-download.php (modified) (3 diffs)
-
public/views/class-onlyoffice-plugin-editor.php (deleted)
-
readme.txt (modified) (4 diffs)
-
vendor/autoload.php (modified) (1 diff)
-
vendor/composer/autoload_real.php (modified) (2 diffs)
-
vendor/composer/autoload_static.php (modified) (2 diffs)
-
vendor/composer/installed.json (modified) (3 diffs)
-
vendor/composer/installed.php (modified) (3 diffs)
-
vendor/firebase/php-jwt/CHANGELOG.md (modified) (1 diff)
-
vendor/firebase/php-jwt/src/JWT.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
onlyoffice/trunk/CHANGELOG.md
r2976437 r3070758 1 1 # Change Log 2 3 ## 2.0.0 4 ## Added 5 - multisite support 6 - stub for onlyoffice-wordpress-block that displays error information if the document server is not accessible or the file is not found 7 - settings for onlyoffice block (width, height, align, show open in onlyoffice button) 8 - button copy link to editor, in the table with files 9 - ability to insert a link to the editor on the page 10 - access for an anonymous user, open the document for viewing in the editor if the document is attached to a public post 11 - filling pdf 12 13 ## Changed 14 - editor url 15 - displaying the onlyoffice-wordpress-block component in the Gutenberg editor 16 - remove filling for oform 17 - supported formats updated 2 18 3 19 ## 1.1.0 -
onlyoffice/trunk/admin/class-onlyoffice-plugin-admin.php
r2976437 r3070758 12 12 /** 13 13 * 14 * (c) Copyright Ascensio System SIA 202 314 * (c) Copyright Ascensio System SIA 2024 15 15 * 16 16 * This program is free software; you can redistribute it and/or … … 42 42 43 43 /** 44 * The ID of this plugin.45 *46 * @since 1.0.047 * @access private48 * @var string $plugin_name The ID of this plugin.49 */50 private $plugin_name;51 52 /**53 * The version of this plugin.54 *55 * @since 1.0.056 * @access private57 * @var string $version The current version of this plugin.58 */59 private $version;60 61 /**62 * Initialize the class and set its properties.63 *64 * @since 1.0.065 * @param string $plugin_name The name of this plugin.66 * @param string $version The version of this plugin.67 */68 public function __construct( $plugin_name, $version ) {69 $this->plugin_name = $plugin_name;70 $this->version = $version;71 }72 73 /**74 44 * Register the stylesheets for the admin area. 75 45 * … … 86 56 public function enqueue_scripts() { 87 57 wp_enqueue_script( 88 $this->plugin_name . '-media-script',89 plugin_dir_url( __FILE__ ) . 'js/onlyoffice-admin-media.js',90 array( 'jquery'),91 $this->version,58 ONLYOFFICE_PLUGIN_NAME . '-formats-utils', 59 ONLYOFFICE_PLUGIN_URL . 'assets-onlyoffice/js/formatsUtils.js', 60 array(), 61 ONLYOFFICE_PLUGIN_VERSION, 92 62 true 93 63 ); 94 64 95 65 wp_localize_script( 96 $this->plugin_name . '-media-script',97 ' oo_media',66 ONLYOFFICE_PLUGIN_NAME . '-formats-utils', 67 'ONLYOFFICE', 98 68 array( 99 'formats' => Onlyoffice_Plugin_Document_Manager::get_ viewable_extensions(),69 'formats' => Onlyoffice_Plugin_Document_Manager::get_onlyoffice_formats(), 100 70 'mimeTypes' => get_allowed_mime_types(), 101 71 ) -
onlyoffice/trunk/admin/css/onlyoffice-wordpress-admin.css
r2976437 r3070758 4 4 5 5 .wp-list-table .column-format { 6 width: 1 5%;6 width: 18%; 7 7 } 8 8 9 9 .wp-list-table .column-date { 10 width: 1 5%;10 width: 18%; 11 11 } 12 12 13 13 .wp-list-table .column-size { 14 width: 1 5%;14 width: 12%; 15 15 } 16 17 .wp-list-table .column-link { 18 width: 12%; 19 } 20 21 .onlyoffice-editor-link.button-link.has-icon:hover { 22 svg { 23 fill: #0096dd; 24 } 25 } 26 27 .onlyoffice_files .copy-to-clipboard-container .success { 28 position: absolute; 29 transform: translate(-36%, -115%); 30 background: #000; 31 color: #fff; 32 border-radius: 5px; 33 margin: 0; 34 padding: 2px 5px; 35 } -
onlyoffice/trunk/controllers/class-onlyoffice-plugin-frontend-controller.php
r2976437 r3070758 12 12 /** 13 13 * 14 * (c) Copyright Ascensio System SIA 202 314 * (c) Copyright Ascensio System SIA 2024 15 15 * 16 16 * This program is free software; you can redistribute it and/or … … 52 52 __DIR__ . '/../onlyoffice-wordpress-block', 53 53 array( 54 'description' => __( 'Add ONLYOFFICE editor on page', 'onlyoffice-plugin' ),54 'description' => __( 'Add ONLYOFFICE Docs editor on page', 'onlyoffice-plugin' ), 55 55 'render_callback' => array( $this, 'onlyoffice_block_render_callback' ), 56 56 ), … … 58 58 59 59 if ( function_exists( 'wp_set_script_translations' ) ) { 60 wp_set_script_translations( 'onlyoffice-plugin', 'onlyoffice-plugin' ); 60 wp_set_script_translations( 61 'onlyoffice-wordpress-onlyoffice-editor-script', 62 'onlyoffice-plugin', 63 plugin_dir_path( ONLYOFFICE_PLUGIN_FILE ) . 'languages/' 64 ); 61 65 } 62 66 } … … 87 91 88 92 $defaults_atts = array( 89 'id' => '', 90 'fileName' => '', 93 'id' => '', 94 'fileName' => '', 95 'documentView' => 'embedded', 96 'inNewTab' => true, 97 'align' => '', 98 'width' => '100%', 99 'height' => '500px', 100 'showOpenButton' => 'true', 101 'openButtonText' => __( 'Open in ONLYOFFICE', 'onlyoffice-plugin' ), 91 102 ); 92 103 93 104 $atts = shortcode_atts( $defaults_atts, $attr, 'onlyoffice' ); 94 105 106 if ( empty( $atts['width'] ) ) { 107 $atts['width'] = $defaults_atts['width']; 108 } 109 110 if ( empty( $atts['height'] ) ) { 111 $atts['height'] = $defaults_atts['height']; 112 } 113 114 wp_enqueue_style( 115 'wp-block-onlyoffice-wordpress-styles', 116 ONLYOFFICE_PLUGIN_URL . 'onlyoffice-wordpress-block/src/styles.css', 117 array(), 118 ONLYOFFICE_PLUGIN_VERSION 119 ); 120 121 if ( 'link' === $atts['documentView'] ) { 122 return $this->render_link( $atts, $instance ); 123 } 124 125 return $this->render_embedded( $atts, $instance ); 126 } 127 128 /** 129 * ONLYOFFICE Embedded Template. 130 * 131 * @param array $atts List of attributes that where included in the Shortcode. 132 * @param int $instance Element number on page. 133 * @return string Link Template. 134 */ 135 private function render_embedded( $atts, $instance ) { 95 136 add_action( 96 137 'wp_enqueue_scripts', … … 98 139 $api_js_url = Onlyoffice_Plugin_Url_Manager::get_api_js_url(); 99 140 wp_enqueue_script( 'onlyoffice_editor_api', $api_js_url, array(), ONLYOFFICE_PLUGIN_VERSION, false ); 141 wp_enqueue_script( 142 'wp-block-onlyoffice-wordpress-js', 143 ONLYOFFICE_PLUGIN_URL . 'controllers/js/frontend-controller.js', 144 array( 'wp-util', 'wp-i18n' ), 145 ONLYOFFICE_PLUGIN_VERSION, 146 false 147 ); 148 wp_enqueue_style( 149 'wp-block-onlyoffice-wordpress-css', 150 ONLYOFFICE_PLUGIN_URL . 'controllers/css/frontend-controller.css', 151 array(), 152 ONLYOFFICE_PLUGIN_VERSION 153 ); 154 155 if ( function_exists( 'wp_set_script_translations' ) ) { 156 wp_set_script_translations( 157 'wp-block-onlyoffice-wordpress-js', 158 'onlyoffice-plugin', 159 plugin_dir_path( ONLYOFFICE_PLUGIN_FILE ) . 'languages/' 160 ); 161 } 100 162 } 101 163 ); … … 118 180 $config = Onlyoffice_Plugin_Config_Manager::get_config( $attachment_id, $type, $mode, $perm_edit, $callback, null, true ); 119 181 120 $output = '<div style="height: 650px; maxWidth: inherit, padding: 20px">'; 121 $output .= '<div id="editorOnlyoffice-' . $instance . '"></div>'; 122 $output .= '<script type="text/javascript">new DocsAPI.DocEditor("editorOnlyoffice-' . $instance . '", ' . wp_json_encode( $config ) . '); </script>'; 182 $align = ! empty( $atts['align'] ) ? 'align' . $atts['align'] : ''; 183 $size = ! empty( $atts['width'] ) && ! ( 'full' === $atts['align'] ) ? 'width: ' . $atts['width'] . ';' : ''; 184 $size .= ! empty( $atts['height'] ) ? 'height: ' . $atts['height'] . ';' : ''; 185 186 $output = '<div class="wp-block-onlyoffice-wordpress-onlyoffice ' . $align . ' size-full" style="' . $size . '">'; 187 $output .= '<div id="editorOnlyoffice-' . $instance . '" data-config="' . htmlspecialchars( wp_json_encode( $config ), ENT_QUOTES, 'UTF-8' ) . '" data-instance="' . $instance . '" class="wp-block-onlyoffice-wordpress-onlyoffice__target" ></div>'; 123 188 $output .= '</div>'; 124 189 125 190 return apply_filters( 'wp_onlyoffice_shortcode', $output, $atts ); 126 191 } 192 193 /** 194 * ONLYOFFICE Link Template. 195 * 196 * @param array $atts List of attributes that where included in the Shortcode. 197 * @param int $instance Element number on page. 198 * @return string Link Template. 199 */ 200 private function render_link( $atts, $instance ) { 201 $target = true === $atts['inNewTab'] ? 'target="_blank"' : ''; 202 $align = ! empty( $atts['align'] ) ? 'align' . $atts['align'] : ''; 203 204 $output = '<div class="wp-block-onlyoffice-wordpress-onlyoffice ' . $align . '">'; 205 $output .= '<a id="linkToOnlyofficeEditor-' . $instance . '" href="' . Onlyoffice_Plugin_Url_Manager::get_editor_url( $atts['id'] ) . '" ' . $target . '>' . $atts['fileName'] . '</a>'; 206 207 if ( $atts['showOpenButton'] ) { 208 $output .= '<a href="' . Onlyoffice_Plugin_Url_Manager::get_editor_url( $atts['id'] ) . '" ' . $target . ' class="wp-block-onlyoffice-wordpress__button wp-element-button">' . $atts['openButtonText'] . '</a>'; 209 } 210 211 $output .= '</div>'; 212 213 return apply_filters( 'wp_onlyoffice_shortcode', $output, $atts ); 214 } 215 216 /** 217 * ONLYOFFICE error template. 218 * 219 * @return void 220 */ 221 public function onlyoffice_error_template() { 222 ?> 223 <script type="text/html" id="tmpl-onlyoffice-error"> 224 <div class="onlyoffice-error" > 225 <div class="onlyoffice-error-body"> 226 <div class="onlyoffice-error-table js"> 227 <div> 228 <img src="<?php echo esc_url( ONLYOFFICE_PLUGIN_URL . 'controllers/images/onlyoffice.svg' ); ?>" style="width: 50%" /> 229 </div> 230 <div style="padding: 16px;"> 231 <img src="<?php echo esc_url( ONLYOFFICE_PLUGIN_URL . 'controllers/images/error.svg' ); ?>" style="width: 100%"/> 232 </div> 233 <div>{{{data.email}}}</div> 234 </div> 235 </div> 236 </div> 237 </script> 238 <?php 239 } 127 240 } -
onlyoffice/trunk/includes/class-onlyoffice-plugin-activator.php
r2976437 r3070758 12 12 /** 13 13 * 14 * (c) Copyright Ascensio System SIA 202 314 * (c) Copyright Ascensio System SIA 2024 15 15 * 16 16 * This program is free software; you can redistribute it and/or … … 46 46 */ 47 47 public static function activate() { 48 if ( empty( get_ option( 'onlyoffice-plugin-uuid' ) ) ) {49 add_option( 'onlyoffice-plugin-uuid', wp_generate_uuid4() );48 if ( empty( get_site_option( 'onlyoffice-plugin-uuid' ) ) ) { 49 update_site_option( 'onlyoffice-plugin-uuid', wp_generate_uuid4() ); 50 50 } 51 if ( empty( get_ option( 'onlyoffice-plugin-bytes' ) ) ) {51 if ( empty( get_site_option( 'onlyoffice-plugin-bytes' ) ) ) { 52 52 $ivlen = openssl_cipher_iv_length( 'aes-256-ctr' ); 53 53 $iv = openssl_random_pseudo_bytes( $ivlen ); 54 add_option( 'onlyoffice-plugin-bytes', bin2hex( $iv ) );54 update_site_option( 'onlyoffice-plugin-bytes', bin2hex( $iv ) ); 55 55 } 56 56 57 if ( empty( get_option( 'onlyoffice-formats' ) ) ) { 58 $formats = array(); 59 60 $path_to_formats_json = plugin_dir_path( __DIR__ ) . '/public/assets/document-formats/onlyoffice-docs-formats.json'; 61 62 if ( file_exists( $path_to_formats_json ) === true ) { 63 $formats = json_decode( file_get_contents( $path_to_formats_json ), true ); 64 add_option( 'onlyoffice-formats', $formats ); 65 } 66 } 57 Onlyoffice_Plugin_Document_Manager::init(); 67 58 } 68 59 } -
onlyoffice/trunk/includes/class-onlyoffice-plugin-deactivator.php
r2976437 r3070758 12 12 /** 13 13 * 14 * (c) Copyright Ascensio System SIA 202 314 * (c) Copyright Ascensio System SIA 2024 15 15 * 16 16 * This program is free software; you can redistribute it and/or -
onlyoffice/trunk/includes/class-onlyoffice-plugin-i18n.php
r2976437 r3070758 12 12 /** 13 13 * 14 * (c) Copyright Ascensio System SIA 202 314 * (c) Copyright Ascensio System SIA 2024 15 15 * 16 16 * This program is free software; you can redistribute it and/or -
onlyoffice/trunk/includes/class-onlyoffice-plugin-loader.php
r2976437 r3070758 12 12 /** 13 13 * 14 * (c) Copyright Ascensio System SIA 202 314 * (c) Copyright Ascensio System SIA 2024 15 15 * 16 16 * This program is free software; you can redistribute it and/or -
onlyoffice/trunk/includes/class-onlyoffice-plugin.php
r2976437 r3070758 15 15 /** 16 16 * 17 * (c) Copyright Ascensio System SIA 202 317 * (c) Copyright Ascensio System SIA 2024 18 18 * 19 19 * This program is free software; you can redistribute it and/or … … 86 86 public function __construct() { 87 87 $this->version = ONLYOFFICE_PLUGIN_VERSION; 88 $this->plugin_name = 'onlyoffice-plugin';88 $this->plugin_name = ONLYOFFICE_PLUGIN_NAME; 89 89 90 90 $this->load_dependencies(); … … 151 151 */ 152 152 private function define_admin_hooks() { 153 $plugin_admin = new Onlyoffice_Plugin_Admin( $this->get_plugin_name(), $this->get_version());153 $plugin_admin = new Onlyoffice_Plugin_Admin(); 154 154 155 155 $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); … … 165 165 */ 166 166 private function define_public_hooks() { 167 $plugin_public = new Onlyoffice_Plugin_Public( $this->get_plugin_name(), $this->get_version());167 $plugin_public = new Onlyoffice_Plugin_Public(); 168 168 169 169 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); … … 185 185 $plugin_settings = new Onlyoffice_Plugin_Settings(); 186 186 $this->loader->add_action( 'admin_menu', $plugin_settings, 'init_menu' ); 187 $this->loader->add_action( 'network_admin_menu', $plugin_settings, 'init_menu' ); 187 188 $this->loader->add_action( 'admin_init', $plugin_settings, 'init' ); 188 189 … … 190 191 $this->loader->add_action( 'init', $plugin_frontend_controller, 'init_shortcodes' ); 191 192 $this->loader->add_action( 'init', $plugin_frontend_controller, 'onlyoffice_custom_block' ); 193 $this->loader->add_action( 'wp_footer', $plugin_frontend_controller, 'onlyoffice_error_template', 30 ); 192 194 } 193 195 -
onlyoffice/trunk/includes/files/class-onlyoffice-plugin-files-list-table.php
r2976437 r3070758 12 12 /** 13 13 * 14 * (c) Copyright Ascensio System SIA 202 314 * (c) Copyright Ascensio System SIA 2024 15 15 * 16 16 * This program is free software; you can redistribute it and/or … … 62 62 add_action( 63 63 'admin_enqueue_scripts', 64 function ( $hook ) { 64 function () { 65 wp_enqueue_script( 66 ONLYOFFICE_PLUGIN_NAME . '-media-script', 67 plugin_dir_url( __FILE__ ) . 'js/onlyoffice-files-list-table.js', 68 array( 'jquery', 'clipboard', 'wp-a11y' ), 69 ONLYOFFICE_PLUGIN_FILE, 70 true 71 ); 72 65 73 wp_enqueue_style( 'onlyoffice_files_table', ONLYOFFICE_PLUGIN_URL . 'admin/css/onlyoffice-wordpress-admin.css', array(), ONLYOFFICE_PLUGIN_VERSION ); 66 74 } … … 81 89 */ 82 90 public function no_items() { 83 esc_html_e( 'No files found for editing or viewing in ONLYOFFICE .', 'onlyoffice-plugin' );91 esc_html_e( 'No files found for editing or viewing in ONLYOFFICE Docs editor.', 'onlyoffice-plugin' ); 84 92 } 85 93 /** … … 97 105 case 'date': 98 106 case 'size': 107 case 'link': 99 108 return $item[ $column_name ]; 100 109 default: … … 116 125 'date' => array( 'date', false ), 117 126 'size' => array( 'size', false ), 127 'link' => array( 'link', false ), 118 128 ); 119 129 } … … 132 142 'date' => __( 'Date' ), 133 143 'size' => __( 'Size' ), 144 'link' => __( 'Link' ), 134 145 ); 135 146 return $columns; … … 190 201 continue; 191 202 } 192 if ( Onlyoffice_Plugin_Document_Manager::is_editable( $filename ) || Onlyoffice_Plugin_Document_Manager::is_viewable( $filename ) ) { 203 if ( ( Onlyoffice_Plugin_Document_Manager::is_editable( $filename ) 204 || Onlyoffice_Plugin_Document_Manager::is_viewable( $filename ) ) 205 && Onlyoffice_Plugin_Document_Manager::can_user_view_attachment( $attachment->ID ) ) { 193 206 array_push( 194 207 $attachments, … … 197 210 'title' => pathinfo( $attached_file, PATHINFO_FILENAME ), 198 211 'format' => strtoupper( pathinfo( $attached_file, PATHINFO_EXTENSION ) ), 212 'date' => $attachment->post_modified, 199 213 'size' => size_format( filesize( $attached_file ) ), 214 'link' => Onlyoffice_Plugin_Url_Manager::get_editor_url( $attachment->ID ), 200 215 ) 201 216 ); … … 244 259 $title = wp_basename( $attached ); 245 260 246 $wp_nonce = wp_create_nonce( 'wp_rest' ); 247 $editor_url = add_query_arg( '_wpnonce', $wp_nonce, Onlyoffice_Plugin_Url_Manager::get_editor_url( $item['id'] ) ); 261 $editor_url = Onlyoffice_Plugin_Url_Manager::get_editor_url( $item['id'] ); 248 262 249 263 ?> … … 280 294 281 295 /** 296 * Handles the post link column output. 297 * 298 * @since 1.0.0 299 * @param array $item The item. 300 */ 301 public function column_link( $item ) { 302 $file = get_post( $item['id'] ); 303 ?> 304 <span class="copy-to-clipboard-container"> 305 <button type="button" data-clipboard-text="<?php echo esc_url( Onlyoffice_Plugin_Url_Manager::get_editor_url( $item['id'] ) ); ?>" class="onlyoffice-editor-link button-link has-icon" title="<?php esc_attr_e( 'Copy URL' ); ?>" aria-label="<?php esc_attr_e( 'Link' ); ?>"> 306 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><path d="M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"></path></svg> 307 </button> 308 <span class="success hidden" aria-hidden="true"><?php esc_html_e( 'Copied!' ); ?> 309 </span> 310 <?php 311 } 312 313 /** 282 314 * Displays the search box. 283 315 * -
onlyoffice/trunk/includes/files/class-onlyoffice-plugin-files.php
r2976437 r3070758 12 12 /** 13 13 * 14 * (c) Copyright Ascensio System SIA 202 314 * (c) Copyright Ascensio System SIA 2024 15 15 * 16 16 * This program is free software; you can redistribute it and/or … … 51 51 if ( $can_upload_files ) { 52 52 add_menu_page( 53 __( 'ONLYOFFICE ', 'onlyoffice-plugin' ),54 'ONLYOFFICE ',53 __( 'ONLYOFFICE Docs', 'onlyoffice-plugin' ), 54 'ONLYOFFICE Docs', 55 55 'upload_files', 56 56 'onlyoffice-files', 57 57 array( $this, 'files_page' ), 58 'data:image/svg+xml;base64,' . base64_encode( $logo_svg ) 58 'data:image/svg+xml;base64,' . base64_encode( $logo_svg ) // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode 59 59 ); 60 60 61 61 $hook = add_submenu_page( 62 62 'onlyoffice-files', 63 'ONLYOFFICE ',63 'ONLYOFFICE Docs', 64 64 __( 'Files', 'onlyoffice-plugin' ), 65 65 'upload_files', … … 103 103 <div class="wrap"> 104 104 <h1><?php echo esc_html( get_admin_page_title() ); ?></h1> 105 <p><?php esc_html_e( 'Files that can be edited and opened in ONLYOFFICE will be displayed here', 'onlyoffice-plugin' ); ?></p>105 <p><?php esc_html_e( 'Files that can be edited and opened in ONLYOFFICE Docs editor are displayed here.', 'onlyoffice-plugin' ); ?></p> 106 106 <form method="get"> 107 107 <?php $onlyoffice_plugin_files_list_table->search_box( __( 'Search' ), 'onlyoffice_file' ); ?> -
onlyoffice/trunk/includes/managers/class-onlyoffice-plugin-callback-manager.php
r2976437 r3070758 12 12 /** 13 13 * 14 * (c) Copyright Ascensio System SIA 202 314 * (c) Copyright Ascensio System SIA 2024 15 15 * 16 16 * This program is free software; you can redistribute it and/or -
onlyoffice/trunk/includes/managers/class-onlyoffice-plugin-config-manager.php
r2976437 r3070758 12 12 /** 13 13 * 14 * (c) Copyright Ascensio System SIA 202 314 * (c) Copyright Ascensio System SIA 2024 15 15 * 16 16 * This program is free software; you can redistribute it and/or … … 51 51 */ 52 52 public static function get_config( $attachment_id, $type, $mode, $perm_edit, $callback_url, $go_back_url, $unic_key ) { 53 $post = get_post( $attachment_id ); 54 $user = wp_get_current_user(); 55 $author = get_user_by( 'id', $post->post_author )->display_name; 56 $filepath = get_attached_file( $attachment_id ); 57 $filename = wp_basename( $filepath ); 58 $filetype = strtolower( pathinfo( $filepath, PATHINFO_EXTENSION ) ); 59 $file_url = Onlyoffice_Plugin_Url_Manager::get_download_url( $attachment_id ); 60 $lang = get_user_locale( $user->ID ); 53 $post = get_post( $attachment_id ); 54 55 if ( ! $post ) { 56 return null; 57 } 58 59 $user = wp_get_current_user(); 60 $author = get_user_by( 'id', $post->post_author )->display_name; 61 $filepath = get_attached_file( $attachment_id ); 62 $filename = wp_basename( $filepath ); 63 $filetype = strtolower( pathinfo( $filepath, PATHINFO_EXTENSION ) ); 64 $file_url = Onlyoffice_Plugin_Url_Manager::get_download_url( $attachment_id ); 65 $lang = get_user_locale( $user->ID ); 66 $perm_fill = false; 67 68 if ( Onlyoffice_Plugin_Document_Manager::is_fillable( $filename ) ) { 69 $perm_fill = true; 70 $perm_edit = false; 71 } 61 72 62 73 $config = array( … … 67 78 'url' => $file_url, 68 79 'fileType' => $filetype, 69 'key' => base64_encode( $post->post_modified ) . $attachment_id, 80 'key' => base64_encode( $post->post_modified ) . $attachment_id, // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode 70 81 'info' => array( 71 82 'owner' => $author, … … 73 84 ), 74 85 'permissions' => array( 75 'download' => true, 76 'edit' => $perm_edit, 86 'download' => true, 87 'edit' => $perm_edit, 88 'fillForms' => $perm_fill, 77 89 ), 78 90 ), -
onlyoffice/trunk/includes/managers/class-onlyoffice-plugin-document-manager.php
r2976437 r3070758 12 12 /** 13 13 * 14 * (c) Copyright Ascensio System SIA 202 314 * (c) Copyright Ascensio System SIA 2024 15 15 * 16 16 * This program is free software; you can redistribute it and/or … … 51 51 52 52 /** 53 * Init Onlyoffice_Plugin_Document_Manager. 54 */ 55 public static function init() { 56 $path_to_formats_json = plugin_dir_path( ONLYOFFICE_PLUGIN_FILE ) . '/public/assets/document-formats/onlyoffice-docs-formats.json'; 57 58 if ( file_exists( $path_to_formats_json ) === true ) { 59 $formats = wp_json_file_decode( $path_to_formats_json ); 60 update_site_option( 'onlyoffice-formats', $formats ); 61 update_site_option( 'onlyoffice-formats-version', ONLYOFFICE_PLUGIN_VERSION ); 62 } 63 } 64 65 /** 53 66 * Returns the type of the document (word, cell, slide). 54 67 * … … 62 75 63 76 foreach ( $formats as $format ) { 64 if ( $format ['name']=== $ext ) {65 return $format ['type'];77 if ( $format->name === $ext ) { 78 return $format->type; 66 79 } 67 80 } … … 82 95 83 96 foreach ( $formats as $format ) { 84 if ( $format ['name']=== $ext ) {85 return in_array( 'edit', $format ['actions'], true );97 if ( $format->name === $ext ) { 98 return in_array( 'edit', $format->actions, true ); 86 99 } 87 100 } … … 102 115 103 116 foreach ( $formats as $format ) { 104 if ( $format ['name']=== $ext ) {105 return in_array( 'fill', $format ['actions'], true );117 if ( $format->name === $ext ) { 118 return in_array( 'fill', $format->actions, true ); 106 119 } 107 120 } … … 122 135 123 136 foreach ( $formats as $format ) { 124 if ( $format ['name']=== $ext ) {125 return in_array( 'view', $format ['actions'], true );137 if ( $format->name === $ext ) { 138 return in_array( 'view', $format->actions, true ); 126 139 } 127 140 } … … 138 151 139 152 foreach ( $formats as $format ) { 140 if ( in_array( 'view', $format ['actions'], true ) ) {141 array_push( $extensions, $format ['name']);153 if ( in_array( 'view', $format->actions, true ) ) { 154 array_push( $extensions, $format->name ); 142 155 } 143 156 } … … 147 160 148 161 /** 162 * Returns true if user can view attachment. 163 * 164 * @param string $attachment_id The attachment id. 165 * @return bool 166 */ 167 public static function can_user_view_attachment( $attachment_id ) { 168 $attachment = get_post( $attachment_id ); 169 170 if ( ! $attachment || 'attachment' !== $attachment->post_type ) { 171 return false; 172 } 173 174 return current_user_can( 'read_post', $attachment_id ); 175 } 176 177 /** 178 * Returns true if anonymous user can view attachment. 179 * 180 * @param string $attachment_id The attachment id. 181 * @return bool 182 */ 183 public static function can_anonymous_user_view_attachment( $attachment_id ) { 184 $attachment = get_post( $attachment_id ); 185 186 if ( ! $attachment || 'attachment' !== $attachment->post_type ) { 187 return false; 188 } 189 190 $is_public = get_post_meta( $attachment_id, '_wp_attachment_metadata', true ); 191 192 if ( ! $is_public ) { 193 return false; 194 } 195 196 $parent_post_id = $attachment->post_parent; 197 $parent_post = get_post( $parent_post_id ); 198 199 if ( ! $parent_post ) { 200 return false; 201 } 202 203 if ( 'publish' !== $parent_post->post_status ) { 204 return false; 205 } 206 207 return true; 208 } 209 210 /** 149 211 * Returns true if user can edit attachment. 150 212 * 151 * @param string $attachment_id The request. 152 * @return bool 153 */ 154 public static function has_edit_capability( $attachment_id ) { 155 $has_edit_cap = false; 156 foreach ( self::EDIT_CAPS as $capability ) { 157 $has_edit_cap = $has_edit_cap || current_user_can( $capability, $attachment_id ); 158 } 159 return $has_edit_cap; 213 * @param string $attachment_id The attachment id. 214 * @return bool 215 */ 216 public static function can_user_edit_attachment( $attachment_id ) { 217 $attachment = get_post( $attachment_id ); 218 219 if ( ! $attachment ) { 220 return false; 221 } 222 223 return current_user_can( 'edit_post', $attachment_id ); 160 224 } 161 225 … … 177 241 178 242 /** 179 * Return option onlyoffice-formats.243 * Return supported ONLYOFFICE formats. 180 244 */ 181 245 public static function get_onlyoffice_formats() { 182 $formats = get_option( 'onlyoffice-formats' ); 246 $onlyoffice_formats_version = get_site_option( 'onlyoffice-formats-version' ); 247 if ( empty( $onlyoffice_formats_version ) || ONLYOFFICE_PLUGIN_VERSION !== $onlyoffice_formats_version ) { 248 self::init(); 249 } 250 251 $formats = get_site_option( 'onlyoffice-formats' ); 183 252 if ( ! empty( $formats ) ) { 184 253 return $formats; -
onlyoffice/trunk/includes/managers/class-onlyoffice-plugin-jwt-manager.php
r2976437 r3070758 12 12 /** 13 13 * 14 * (c) Copyright Ascensio System SIA 202 314 * (c) Copyright Ascensio System SIA 2024 15 15 * 16 16 * This program is free software; you can redistribute it and/or … … 80 80 */ 81 81 public static function jwt_decode( $token, $secret ) { 82 return JWT::decode( $token, new Key( $secret, 'HS256' ) ); 82 $jwt_reflection_class = new ReflectionClass( '\Firebase\JWT\JWT' ); 83 $methods = $jwt_reflection_class->getMethods(); 84 85 $filtered_methods = array_filter( 86 $methods, 87 function ( $method ) { 88 return strpos( $method->getName(), 'getKey' ) === 0; 89 } 90 ); 91 92 if ( empty( $filtered_methods ) ) { 93 $allowed_algs = array( 'HS256' ); 94 return JWT::decode( $token, $secret, $allowed_algs ); 95 } else { 96 return JWT::decode( $token, new Key( $secret, 'HS256' ) ); 97 } 83 98 } 84 99 } -
onlyoffice/trunk/includes/managers/class-onlyoffice-plugin-url-manager.php
r2976437 r3070758 12 12 /** 13 13 * 14 * (c) Copyright Ascensio System SIA 202 314 * (c) Copyright Ascensio System SIA 2024 15 15 * 16 16 * This program is free software; you can redistribute it and/or … … 40 40 private const PATH_CALLBACK_PUBLIC_FORMS = '/onlyoffice/oo.callback-public-forms/'; 41 41 private const PATH_DOWNLOAD = '/onlyoffice/oo.getfile/'; 42 private const PATH_EDITOR = '/onlyoffice/oo.editor/';43 42 private const PATH_API_JS = 'web-apps/apps/api/documents/api.js'; 44 43 … … 108 107 */ 109 108 public static function get_editor_url( $attachment_id ) { 110 $hidden_id = self::encode_openssl_data( $attachment_id ); 111 112 return get_rest_url( null, self::PATH_EDITOR . $hidden_id ); 109 return ONLYOFFICE_PLUGIN_URL . 'editor.php?attachment_id=' . $attachment_id; 113 110 } 114 111 … … 121 118 */ 122 119 private static function encode_openssl_data( $data ) { 123 $passphrase = get_ option( 'onlyoffice-plugin-uuid' );124 $iv = hex2bin( get_ option( 'onlyoffice-plugin-bytes' ) );120 $passphrase = get_site_option( 'onlyoffice-plugin-uuid' ); 121 $iv = hex2bin( get_site_option( 'onlyoffice-plugin-bytes' ) ); 125 122 126 123 $encrypt = openssl_encrypt( $data, 'aes-256-ctr', $passphrase, $options = 0, $iv ); … … 136 133 */ 137 134 public static function decode_openssl_data( $data ) { 138 $passphrase = get_ option( 'onlyoffice-plugin-uuid' );139 $iv = hex2bin( get_ option( 'onlyoffice-plugin-bytes' ) );135 $passphrase = get_site_option( 'onlyoffice-plugin-uuid' ); 136 $iv = hex2bin( get_site_option( 'onlyoffice-plugin-bytes' ) ); 140 137 141 138 $data = urldecode( str_replace( ',', '%', $data ) ); -
onlyoffice/trunk/includes/settings/class-onlyoffice-plugin-settings.php
r2976437 r3070758 15 15 /** 16 16 * 17 * (c) Copyright Ascensio System SIA 202 317 * (c) Copyright Ascensio System SIA 2024 18 18 * 19 19 * This program is free software; you can redistribute it and/or … … 56 56 57 57 /** 58 * ID setting allowed_owerwrite_network_settings. 59 */ 60 const ALLOWED_OWERWRITE_NETWORK_SETTINGS = 'onlyoffice_settings_allowed_owerwrite_network_settings'; 61 62 /** 63 * ID setting inherit_network_settings. 64 */ 65 const INHERIT_NETWORK_SETTINGS = 'onlyoffice_settings_inherit_network_settings'; 66 67 /** 58 68 * Init menu. 59 69 * … … 64 74 $can_manage_settings = current_user_can( 'manage_options' ); 65 75 $can_upload_files = current_user_can( 'upload_files' ); 66 67 if ( $can_manage_settings && ! $can_upload_files ) { 68 add_menu_page( 69 __( 'ONLYOFFICE', 'onlyoffice-plugin' ), 70 'ONLYOFFICE', 71 'manage_options', 76 $can_manage_network = current_user_can( 'manage_network' ); 77 78 if ( $can_manage_settings ) { 79 if ( $can_upload_files ) { 80 $hook = add_submenu_page( 81 'onlyoffice-files', 82 __( 'ONLYOFFICE Docs Settings', 'onlyoffice-plugin' ), 83 __( 'Settings', 'onlyoffice-plugin' ), 84 'manage_options', 85 'onlyoffice-settings', 86 array( $this, 'options_page' ) 87 ); 88 } else { 89 $hook = add_menu_page( 90 __( 'ONLYOFFICE Docs Settings', 'onlyoffice-plugin' ), 91 'ONLYOFFICE Docs', 92 'manage_options', 93 'onlyoffice-settings', 94 array( $this, 'options_page' ), 95 'data:image/svg+xml;base64,' . base64_encode( $logo_svg ) // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode 96 ); 97 } 98 } 99 100 if ( $can_manage_network && is_network_admin() ) { 101 $hook = add_menu_page( 102 __( 'ONLYOFFICE Docs Settings', 'onlyoffice-plugin' ), 103 'ONLYOFFICE Docs', 104 'manage_network', 72 105 'onlyoffice-settings', 73 106 array( $this, 'options_page' ), 74 'data:image/svg+xml;base64,' . base64_encode( $logo_svg ) 107 'data:image/svg+xml;base64,' . base64_encode( $logo_svg ) // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode 75 108 ); 76 109 } 77 if ( $can_manage_settings && $can_upload_files ) { 78 add_submenu_page( 79 'onlyoffice-files', 80 'ONLYOFFICE', 81 __( 'Settings', 'onlyoffice-plugin' ), 82 'manage_options', 83 'onlyoffice-settings', 84 array( $this, 'options_page' ) 85 ); 110 111 if ( isset( $hook ) ) { 112 add_action( "load-$hook", array( $this, 'update_plugin_settings' ) ); 86 113 } 87 114 } … … 102 129 ); 103 130 131 if ( is_multisite() ) { 132 if ( ! is_network_admin() ) { 133 add_settings_field( 134 self::INHERIT_NETWORK_SETTINGS, 135 __( 'Connection Settings', 'onlyoffice-plugin' ), 136 array( $this, 'input_checkbox' ), 137 'onlyoffice_settings_group', 138 'onlyoffice_settings_general_section', 139 array( 140 'id' => self::INHERIT_NETWORK_SETTINGS, 141 'checked' => self::inherit_network_settings(), 142 'disabled' => ! $this->allowed_owerwrite_network_settings(), 143 'description' => __( 'Inherit Network Settings', 'onlyoffice-plugin' ), 144 ), 145 ); 146 } 147 } 148 104 149 add_settings_field( 105 'onlyoffice_settings_docserver_url',150 self::DOCSERVER_URL, 106 151 __( 'Document Editing Service address', 'onlyoffice-plugin' ), 107 array( $this, 'input_ cb' ),152 array( $this, 'input_text' ), 108 153 'onlyoffice_settings_group', 109 154 'onlyoffice_settings_general_section', 110 155 array( 111 'label_for' => self::DOCSERVER_URL, 112 'desc' => '', 156 'id' => self::DOCSERVER_URL, 157 'value' => $this->get_onlyoffice_current_value_setting( self::DOCSERVER_URL ), 158 'disabled' => is_multisite() && ! is_network_admin() && ( ! $this->allowed_owerwrite_network_settings() || self::inherit_network_settings() ), 159 'description' => '', 113 160 ) 114 161 ); 115 162 116 163 add_settings_field( 117 'onlyoffice_settings_docserver_jwt',164 self::DOCSERVER_JWT, 118 165 __( 'Document server JWT secret key', 'onlyoffice-plugin' ), 119 array( $this, 'input_ cb' ),166 array( $this, 'input_text' ), 120 167 'onlyoffice_settings_group', 121 168 'onlyoffice_settings_general_section', 122 169 array( 123 'label_for' => self::DOCSERVER_JWT, 124 'desc' => __( 'Secret key (leave blank to disable)', 'onlyoffice-plugin' ), 170 'id' => self::DOCSERVER_JWT, 171 'value' => $this->get_onlyoffice_current_value_setting( self::DOCSERVER_JWT ), 172 'disabled' => is_multisite() && ! is_network_admin() && ( ! $this->allowed_owerwrite_network_settings() || self::inherit_network_settings() ), 173 'description' => __( 'Secret key (leave blank to disable)', 'onlyoffice-plugin' ), 125 174 ) 126 175 ); 127 176 128 177 add_settings_field( 129 'onlyoffice_settings_jwt_header',178 self::JWT_HEADER, 130 179 __( 'Authorization header', 'onlyoffice-plugin' ), 131 array( $this, 'input_ cb' ),180 array( $this, 'input_text' ), 132 181 'onlyoffice_settings_group', 133 182 'onlyoffice_settings_general_section', 134 183 array( 135 'label_for' => self::JWT_HEADER, 136 'desc' => __( 'Leave blank to use default header', 'onlyoffice-plugin' ), 184 'id' => self::JWT_HEADER, 185 'value' => $this->get_onlyoffice_current_value_setting( self::JWT_HEADER ), 186 'disabled' => is_multisite() && ! is_network_admin() && ( ! $this->allowed_owerwrite_network_settings() || self::inherit_network_settings() ), 187 'description' => __( 'Leave blank to use default header', 'onlyoffice-plugin' ), 137 188 ) 138 189 ); 139 } 140 141 /** 142 * Input cb 190 191 if ( is_multisite() ) { 192 if ( is_network_admin() ) { 193 add_settings_field( 194 self::ALLOWED_OWERWRITE_NETWORK_SETTINGS, 195 '', 196 array( $this, 'input_checkbox' ), 197 'onlyoffice_settings_group', 198 'onlyoffice_settings_general_section', 199 array( 200 'id' => self::ALLOWED_OWERWRITE_NETWORK_SETTINGS, 201 'checked' => self::allowed_owerwrite_network_settings(), 202 'disabled' => '', 203 'description' => __( 'Allow site administrators to configure plugin for their sites', 'onlyoffice-plugin' ), 204 ) 205 ); 206 } 207 } 208 } 209 210 /** 211 * Input text 143 212 * 144 213 * @param array $args Args. … … 146 215 * @return void 147 216 */ 148 public function input_ cb( array $args ) {217 public function input_text( array $args ) { 149 218 ?> 150 <input id="<?php echo esc_attr( $args['label_for'] ); ?>" type="text" class="regular-text" name="onlyoffice_settings[<?php echo esc_attr( $args['label_for'] ); ?>]" value="<?php echo esc_attr( $this->get_onlyoffice_setting( $args['label_for'] ) ); ?>"> 151 <p class="description"> 152 <?php echo esc_attr( $args['desc'] ); ?> 219 <input id="<?php echo esc_attr( $args['id'] ); ?>" name="<?php echo esc_attr( $args['id'] ); ?>" value="<?php echo esc_attr( $args['value'] ); ?>" <?php disabled( $args['disabled'] ); ?> type="text" class="regular-text"> 220 <p class="description"><?php echo esc_attr( $args['description'] ); ?></p> 221 <?php 222 } 223 224 /** 225 * Input checkbox 226 * 227 * @param array $args Args. 228 * 229 * @return void 230 */ 231 public function input_checkbox( array $args ) { 232 ?> 233 <input id="<?php echo esc_attr( $args['id'] ); ?>" name="<?php echo esc_attr( $args['id'] ); ?>" <?php checked( $args['checked'] ); ?> <?php disabled( $args['disabled'] ); ?> type="checkbox" value="1"> 234 <label for="<?php echo esc_attr( $args['id'] ); ?>"><?php echo esc_attr( $args['description'] ); ?></label> 235 <?php 236 } 237 238 /** 239 * General section callback. 240 * 241 * @param array $args Args. 242 * 243 * @return void 244 */ 245 public function general_section_callback( $args ) { 246 settings_errors(); 247 ?> 248 <p id="<?php echo esc_attr( $args['id'] ); ?>"> 249 <?php 250 if ( is_multisite() ) { 251 if ( is_network_admin() ) { 252 esc_html_e( 'Configure ONLYOFFICE Docs plugin settings for the whole network.', 'onlyoffice-plugin' ); 253 } else { 254 printf( 255 wp_kses( 256 /* translators: %s: Title WP Site. */ 257 __( 'Configure ONLYOFFICE Docs plugin settings for %s site.', 'onlyoffice-plugin' ), 258 array( 259 'strong' => array( 260 'class' => array(), 261 ), 262 ), 263 ), 264 '<a href="' . esc_attr( get_bloginfo( 'url' ) ) . '">' . esc_attr( get_bloginfo() ) . '</a>' 265 ); 266 267 if ( ! $this->allowed_owerwrite_network_settings() ) { 268 ?> 269 <div class="onlyoffice-settings-notice"> 270 <p> 271 <?php esc_html_e( 'Blocked from changing settings by the Network administrator', 'onlyoffice-plugin' ); ?> 272 </p> 273 </div> 274 <?php 275 } 276 } 277 } else { 278 ?> 279 <p id="<?php echo esc_attr( $args['id'] ); ?>"><?php esc_html_e( 'Configure ONLYOFFICE Docs plugin settings.', 'onlyoffice-plugin' ); ?></p> 280 <?php 281 } 282 ?> 153 283 </p> 154 <?php155 }156 157 /**158 * General section callback.159 *160 * @param array $args Args.161 *162 * @return void163 */164 public function general_section_callback( $args ) {165 ?>166 <p id="<?php echo esc_attr( $args['id'] ); ?>"><?php esc_html_e( 'Configure ONLYOFFICE connector settings', 'onlyoffice-plugin' ); ?></p>167 284 <?php 168 285 } … … 177 294 178 295 wp_enqueue_style( 179 'onlyoffice-settings', 296 ONLYOFFICE_PLUGIN_NAME . '-settings', 297 ONLYOFFICE_PLUGIN_URL . 'admin/css/settings.css', 298 array(), 299 ONLYOFFICE_PLUGIN_VERSION 300 ); 301 302 wp_enqueue_style( 303 ONLYOFFICE_PLUGIN_NAME . '-cloud-banner', 180 304 ONLYOFFICE_PLUGIN_URL . 'admin/css/banner/onlyoffice-cloud-banner.css', 181 305 array(), … … 183 307 ); 184 308 185 if ( ! empty( $_GET['settings-updated'] ) && sanitize_key( $_GET['settings-updated'] ) === 'true' ) { 186 add_settings_error( 'onlyoffice_settings_messages', 'onlyoffice_message', __( 'Settings Saved', 'onlyoffice-plugin' ), 'updated' ); // ToDo: can also check if settings are valid e.g. make connection to docServer. 187 } 188 189 settings_errors( 'onlyoffice_settings_messages' ); 309 wp_enqueue_script( 310 ONLYOFFICE_PLUGIN_NAME . '-settings', 311 ONLYOFFICE_PLUGIN_URL . 'admin/js/settings.js', 312 array( 'jquery' ), 313 ONLYOFFICE_PLUGIN_VERSION, 314 true 315 ); 316 317 if ( function_exists( 'wp_set_script_translations' ) ) { 318 wp_set_script_translations( 319 ONLYOFFICE_PLUGIN_NAME . '-settings', 320 'onlyoffice-plugin', 321 plugin_dir_path( ONLYOFFICE_PLUGIN_FILE ) . 'languages/' 322 ); 323 } 324 190 325 ?> 191 326 <div class="wrap"> 192 327 <h1><?php echo esc_html( get_admin_page_title() ); ?></h1> 193 <form action="options.php" method="post">328 <form id="onlyoffice-settings-form" action="admin.php?page=onlyoffice-settings" method="post"> 194 329 <?php 195 330 settings_fields( 'onlyoffice_settings_group' ); 196 331 do_settings_sections( 'onlyoffice_settings_group' ); 197 submit_button( __( 'Save Settings', 'onlyoffice-plugin' ) ); 332 333 $submit_button_args = array( 334 'id' => 'onlyoffice-settings-submit-button', 335 ); 336 if ( is_multisite() && ! is_network_admin() && ! $this->allowed_owerwrite_network_settings() ) { 337 $submit_button_args = array( 338 'disabled' => '', 339 ); 340 } 341 342 submit_button( 343 __( 'Save Settings', 'onlyoffice-plugin' ), 344 'primary', 345 '', 346 true, 347 $submit_button_args 348 ); 198 349 ?> 199 350 </form> … … 212 363 </div> 213 364 <?php 214 } 215 216 /** 217 * Return ONLYOFFICE Setting 365 $this->wp_print_onlyoffice_setting_confirm_dialog(); 366 } 367 368 /** 369 * Update settings. 370 */ 371 public function update_plugin_settings() { 372 switch ( $this->current_action() ) { 373 case 'update': 374 check_admin_referer( 'onlyoffice_settings_group-options' ); 375 376 if ( is_multisite() && ! is_network_admin() && ! $this->allowed_owerwrite_network_settings() ) { 377 wp_die( 'Blocked from changing settings by the Network administrator!', '', array( 'response' => 403 ) ); 378 } 379 380 $value = array(); 381 382 if ( isset( $_POST[ self::DOCSERVER_URL ] ) ) { 383 $value[ self::DOCSERVER_URL ] = sanitize_text_field( wp_unslash( $_POST[ self::DOCSERVER_URL ] ) ); 384 } 385 386 if ( isset( $_POST[ self::DOCSERVER_JWT ] ) ) { 387 $value[ self::DOCSERVER_JWT ] = sanitize_text_field( wp_unslash( $_POST[ self::DOCSERVER_JWT ] ) ); 388 } 389 390 if ( isset( $_POST[ self::JWT_HEADER ] ) ) { 391 $value[ self::JWT_HEADER ] = sanitize_text_field( wp_unslash( $_POST[ self::JWT_HEADER ] ) ); 392 } 393 394 if ( is_multisite() ) { 395 if ( is_network_admin() ) { 396 if ( isset( $_POST[ self::ALLOWED_OWERWRITE_NETWORK_SETTINGS ] ) ) { 397 $value[ self::ALLOWED_OWERWRITE_NETWORK_SETTINGS ] = sanitize_text_field( wp_unslash( $_POST[ self::ALLOWED_OWERWRITE_NETWORK_SETTINGS ] ) ); 398 } else { 399 $value[ self::ALLOWED_OWERWRITE_NETWORK_SETTINGS ] = 0; 400 } 401 402 $current_options = get_site_option( 'onlyoffice_settings', array() ); 403 $new_options = array_merge( $current_options, $value ); 404 405 update_site_option( 'onlyoffice_settings', $new_options ); 406 } else { 407 if ( isset( $_POST[ self::INHERIT_NETWORK_SETTINGS ] ) ) { 408 $value[ self::INHERIT_NETWORK_SETTINGS ] = sanitize_text_field( wp_unslash( $_POST[ self::INHERIT_NETWORK_SETTINGS ] ) ); 409 410 if ( $value[ self::INHERIT_NETWORK_SETTINGS ] ) { 411 $value = array( 412 self::INHERIT_NETWORK_SETTINGS => $value[ self::INHERIT_NETWORK_SETTINGS ], 413 ); 414 } 415 } else { 416 $value[ self::INHERIT_NETWORK_SETTINGS ] = 0; 417 } 418 419 $current_options = get_option( 'onlyoffice_settings', array() ); 420 $new_options = array_merge( $current_options, $value ); 421 422 update_option( 'onlyoffice_settings', $new_options ); 423 } 424 } else { 425 $current_options = get_site_option( 'onlyoffice_settings', array() ); 426 $new_options = array_merge( $current_options, $value ); 427 428 update_option( 'onlyoffice_settings', $new_options ); 429 } 430 431 add_settings_error( 'general', 'settings_updated', __( 'Settings saved.' ), 'success' ); 432 set_transient( 'settings_errors', get_settings_errors(), 30 ); 433 434 if ( is_network_admin() ) { 435 wp_safe_redirect( network_admin_url( 'admin.php?page=onlyoffice-settings&settings-updated=true' ) ); 436 } else { 437 wp_safe_redirect( admin_url( 'admin.php?page=onlyoffice-settings&settings-updated=true' ) ); 438 } 439 440 exit; 441 } 442 } 443 444 /** 445 * Return ONLYOFFICE Docs plugin Settings 218 446 * 219 447 * @param string $key Setting key. … … 221 449 */ 222 450 public static function get_onlyoffice_setting( $key, $def = '' ) { 223 $options = get_option( 'onlyoffice_settings' ); 451 if ( is_multisite() ) { 452 if ( ! self::allowed_owerwrite_network_settings() || self::inherit_network_settings() ) { 453 $options = get_site_option( 'onlyoffice_settings' ); 454 } else { 455 $options = get_option( 'onlyoffice_settings' ); 456 } 457 } else { 458 $options = get_option( 'onlyoffice_settings' ); 459 } 460 224 461 if ( ! empty( $options ) && array_key_exists( $key, $options ) ) { 225 462 return $options[ $key ]; … … 228 465 return $def; 229 466 } 467 468 /** 469 * Return ONLYOFFICE Docs plugin settings value 470 * 471 * @param string $key Setting key. 472 * @param string $def Default value. 473 */ 474 private function get_onlyoffice_current_value_setting( $key, $def = '' ) { 475 if ( is_multisite() ) { 476 if ( is_network_admin() ) { 477 $options = get_site_option( 'onlyoffice_settings' ); 478 } else { 479 $options = get_option( 'onlyoffice_settings' ); 480 } 481 } else { 482 $options = get_option( 'onlyoffice_settings' ); 483 } 484 485 if ( ! empty( $options ) && array_key_exists( $key, $options ) ) { 486 return $options[ $key ]; 487 } 488 489 return $def; 490 } 491 492 /** 493 * Return current actrion. 494 */ 495 private function current_action() { 496 global $filter_action, $action; 497 wp_reset_vars( array( 'filter_action', 'action' ) ); 498 499 if ( ! empty( $filter_action ) ) { 500 return false; 501 } 502 503 if ( ! empty( $action ) && -1 !== $action ) { 504 return $action; 505 } 506 507 return false; 508 } 509 510 /** 511 * Return setting allowed_owerwrite_network_settings. 512 */ 513 private static function allowed_owerwrite_network_settings() { 514 $options = get_site_option( 'onlyoffice_settings' ); 515 if ( ! empty( $options ) && array_key_exists( self::ALLOWED_OWERWRITE_NETWORK_SETTINGS, $options ) ) { 516 return $options[ self::ALLOWED_OWERWRITE_NETWORK_SETTINGS ]; 517 } 518 519 return false; 520 } 521 522 /** 523 * Return setting inherit_network_settings. 524 */ 525 private static function inherit_network_settings() { 526 $options = get_option( 'onlyoffice_settings' ); 527 if ( ! empty( $options ) && array_key_exists( self::INHERIT_NETWORK_SETTINGS, $options ) ) { 528 return $options[ self::INHERIT_NETWORK_SETTINGS ]; 529 } 530 531 return true; 532 } 533 534 /** 535 * Return confirm update settings dialog. 536 */ 537 private function wp_print_onlyoffice_setting_confirm_dialog() { 538 ?> 539 <div id="onlyoffice-setting-confirm-dialog" class="notification-dialog-wrap hidden"> 540 <div class="notification-dialog-background"></div> 541 <div class="notification-dialog" role="dialog" tabindex="0"> 542 <div class="onlyoffice-setting-confirm-dialog-content"> 543 <h1><?php esc_html_e( 'Settings update', 'onlyoffice-plugin' ); ?></h1> 544 <div class="onlyoffice-setting-confirm-message"></div> 545 <p> 546 <a class="button onlyoffice-setting-confirm-dialog-cancel"><?php esc_html_e( 'Cancel' ); ?></a> 547 <button type="button" class="onlyoffice-setting-confirm-dialog-ok button button-primary"><?php esc_html_e( 'OK' ); ?></button> 548 </p> 549 </div> 550 </div> 551 </div> 552 <?php 553 } 230 554 } -
onlyoffice/trunk/languages/onlyoffice-plugin-de_DE.po
r2976437 r3070758 11 11 "Content-Transfer-Encoding: 8bit\n" 12 12 "Plural-Forms: nplurals=2; plural=(n != 1);\n" 13 "X-Generator: Poedit 3.0.1\n" 14 15 msgid "General Settings" 16 msgstr "Allgemeine Einstellungen" 13 "X-Generator: Poedit 3.4.1\n" 17 14 18 15 msgid "Document Editing Service address" … … 31 28 msgstr "Leer lassen, um die standardmäßige Kopfzeile zu verwenden" 32 29 33 msgid "Settings Saved"34 msgstr "Die Einstellungen werden gespeichert"35 36 30 msgid "Open in ONLYOFFICE" 37 31 msgstr "In ONLYOFFICE öffnen" … … 49 43 msgstr "Einstellungen" 50 44 51 msgid "General settings section"52 msgstr "Allgemeine Einstellungen"53 54 45 msgid "Files" 55 46 msgstr "Dateien" 56 47 57 msgid " Configure ONLYOFFICE connector settings"58 msgstr "ONLYOFFICE -Konnektor konfigurieren"48 msgid "ONLYOFFICE Docs Settings" 49 msgstr "ONLYOFFICE Docs Einstellungen " 59 50 60 msgid " ONLYOFFICE cannot be reached. Please contact admin"61 msgstr " ONLYOFFICE ist nicht zugänglich. Bitte wende Dich an Deinen Administrator"51 msgid "Configure ONLYOFFICE Docs plugin settings." 52 msgstr "Einstellungen von ONLYOFFICE Docs konfigurieren" 62 53 63 msgid " Files that can be edited and opened in ONLYOFFICE will be displayed here"64 msgstr " Hier werden die Dateien zugänglich, die Sie in ONLYOFFICE öffnen und bearbeiten können"54 msgid "Configure ONLYOFFICE Docs plugin settings for the whole network." 55 msgstr "Konfigurieren Sie die Einstellungen des Plugins ONLYOFFICE Docs für das gesamte Netzwerk." 65 56 66 msgid " No files found for editing or viewing in ONLYOFFICE."67 msgstr "K eine Dateien zum Öffnen oder Bearbeiten in ONLYOFFICE gefunden."57 msgid "Configure ONLYOFFICE Docs plugin settings for %s site." 58 msgstr "Konfigurieren Sie die Einstellungen des Plugins ONLYOFFICE Docs für die Website %s." 68 59 69 msgid "Add ONLYOFFICE editor on page" 70 msgstr "ONLYOFFICE-Editor zur Seite hinzufügen" 60 msgid "Blocked from changing settings by the Network administrator" 61 msgstr "Der Netzwerkadministrator hat die Änderung der Einstellungen verhindert" 62 63 msgid "Allow site administrators to configure plugin for their sites" 64 msgstr "Erlauben Sie Site-Administratoren, Plugins für ihre Sites zu konfigurieren" 65 66 msgid "Inherit Network Settings" 67 msgstr "Netzwerkeinstellungen übernehmen" 68 69 msgid "Connection Settings" 70 msgstr "Verbindungseinstellungen" 71 72 #: controllers/js/frontend-controller.js 73 msgid "ONLYOFFICE Docs cannot be reached. Please contact admin." 74 msgstr "ONLYOFFICE Docs ist nicht zugänglich. Bitte wende Dich an Deinen Administrator." 75 76 msgid "Files that can be edited and opened in ONLYOFFICE Docs editor are displayed here." 77 msgstr "Hier werden die Dateien angezeigt, die Sie in ONLYOFFICE Docs öffnen und bearbeiten können." 78 79 msgid "No files found for editing or viewing in ONLYOFFICE Docs editor." 80 msgstr "Keine Dateien zum Öffnen oder Bearbeiten in ONLYOFFICE Docs gefunden." 81 82 msgid "Add ONLYOFFICE Docs editor on page" 83 msgstr "ONLYOFFICE Docs zur Seite hinzufügen" 71 84 72 85 msgid "ONLYOFFICE Docs Cloud" … … 78 91 msgid "Get Now" 79 92 msgstr "Jetzt erhalten" 93 94 #: onlyoffice-wordpress-block/build/index.js 95 msgid "Embedded" 96 msgstr "Eingebettet" 97 98 #: onlyoffice-wordpress-block/build/index.js 99 msgid "Document view" 100 msgstr "Dokument-Ansicht" 101 102 #: onlyoffice-wordpress-block/build/index.js 103 msgid "Open in ONLYOFFICE" 104 msgstr "In ONLYOFFICE öffnen" 105 106 #: onlyoffice-wordpress-block/build/index.js 107 msgid "Show Open in ONLYOFFICE button" 108 msgstr "Schaltfläche 'In ONLYOFFICE öffnen' anzeigen" 109 110 #: onlyoffice-wordpress-block/build/index.js 111 #: controllers/js/frontend-controller.js 112 msgid "File not found!" 113 msgstr "Datei nicht gefunden!" 114 115 msgid "Settings update" 116 msgstr "Einstellungen aktualisieren" 117 118 #: admin/js/settings.js 119 msgid "Do you want to allow sites administrators to configure the plugin themselves?" 120 msgstr "Möchten Sie Site-Administratoren erlauben, das Plugin selbst zu konfigurieren?" 121 122 #: admin/js/settings.js 123 msgid "Do you want to apply these settings to all sites?" 124 msgstr "Möchten Sie diese Einstellungen auf alle Websites anwenden?" 125 126 #: admin/js/settings.js 127 msgid "Do you want to apply the network settings?" 128 msgstr "Möchten Sie die Netzwerkeinstellungen übernehmen?" -
onlyoffice/trunk/languages/onlyoffice-plugin-en.po
r2976437 r3070758 11 11 "Content-Transfer-Encoding: 8bit\n" 12 12 "Plural-Forms: nplurals=2; plural=(n != 1);\n" 13 "X-Generator: Poedit 3.0.1\n" 14 15 msgid "General Settings" 16 msgstr "General Settings" 13 "X-Generator: Poedit 3.4.1\n" 17 14 18 15 msgid "Document Editing Service address" … … 31 28 msgstr "Leave blank to use default header" 32 29 33 msgid "Settings Saved"34 msgstr "Settings Saved"35 36 30 msgid "Open in ONLYOFFICE" 37 31 msgstr "Open in ONLYOFFICE" … … 49 43 msgstr "Settings" 50 44 51 msgid "General settings section"52 msgstr "General settings section"53 54 45 msgid "Files" 55 46 msgstr "Files" 56 47 57 msgid " Configure ONLYOFFICE connector settings"58 msgstr " Configure ONLYOFFICE connector settings"48 msgid "ONLYOFFICE Docs Settings" 49 msgstr "ONLYOFFICE Docs Settings" 59 50 60 msgid " ONLYOFFICE cannot be reached. Please contact admin"61 msgstr " ONLYOFFICE cannot be reached. Please contact admin"51 msgid "Configure ONLYOFFICE Docs plugin settings." 52 msgstr "Configure ONLYOFFICE Docs plugin settings." 62 53 63 msgid " Files that can be edited and opened in ONLYOFFICE will be displayed here"64 msgstr " Files that can be edited and opened in ONLYOFFICE will be displayed here"54 msgid "Configure ONLYOFFICE Docs plugin settings for the whole network." 55 msgstr "Configure ONLYOFFICE Docs plugin settings for the whole network." 65 56 66 msgid " No files found for editing or viewing in ONLYOFFICE."67 msgstr " No files found for editing or viewing in ONLYOFFICE."57 msgid "Configure ONLYOFFICE Docs plugin settings for %s site." 58 msgstr "Configure ONLYOFFICE Docs plugin settings for %s site." 68 59 69 msgid "Add ONLYOFFICE editor on page" 70 msgstr "Add ONLYOFFICE editor on page" 60 msgid "Blocked from changing settings by the Network administrator" 61 msgstr "Blocked from changing settings by the Network administrator" 62 63 msgid "Allow site administrators to configure plugin for their sites" 64 msgstr "Allow site administrators to configure plugin for their sites" 65 66 msgid "Inherit Network Settings" 67 msgstr "Inherit Network Settings" 68 69 msgid "Connection Settings" 70 msgstr "Connection Settings" 71 72 #: controllers/js/frontend-controller.js 73 msgid "ONLYOFFICE Docs cannot be reached. Please contact admin." 74 msgstr "ONLYOFFICE Docs cannot be reached. Please contact admin." 75 76 msgid "Files that can be edited and opened in ONLYOFFICE Docs editor are displayed here." 77 msgstr "Files that can be edited and opened in ONLYOFFICE Docs editor are displayed here." 78 79 msgid "No files found for editing or viewing in ONLYOFFICE Docs editor." 80 msgstr "No files found for editing or viewing in ONLYOFFICE Docs editor." 81 82 msgid "Add ONLYOFFICE Docs editor on page" 83 msgstr "Add ONLYOFFICE Docs editor on page" 71 84 72 85 msgid "ONLYOFFICE Docs Cloud" … … 78 91 msgid "Get Now" 79 92 msgstr "Get Now" 93 94 #: onlyoffice-wordpress-block/build/index.js 95 msgid "Embedded" 96 msgstr "Embedded" 97 98 #: onlyoffice-wordpress-block/build/index.js 99 msgid "Document view" 100 msgstr "Document view" 101 102 #: onlyoffice-wordpress-block/build/index.js 103 msgid "Open in ONLYOFFICE" 104 msgstr "Open in ONLYOFFICE" 105 106 #: onlyoffice-wordpress-block/build/index.js 107 msgid "Show Open in ONLYOFFICE button" 108 msgstr "Show Open in ONLYOFFICE button" 109 110 #: onlyoffice-wordpress-block/build/index.js 111 #: controllers/js/frontend-controller.js 112 msgid "File not found!" 113 msgstr "File not found!" 114 115 msgid "Settings update" 116 msgstr "Settings update" 117 118 #: admin/js/settings.js 119 msgid "Do you want to allow sites administrators to configure the plugin themselves?" 120 msgstr "Do you want to allow sites administrators to configure the plugin themselves?" 121 122 #: admin/js/settings.js 123 msgid "Do you want to apply these settings to all sites?" 124 msgstr "Do you want to apply these settings to all sites?" 125 126 #: admin/js/settings.js 127 msgid "Do you want to apply the network settings?" 128 msgstr "Do you want to apply the network settings?" -
onlyoffice/trunk/languages/onlyoffice-plugin-es_ES.po
r2976437 r3070758 11 11 "Content-Transfer-Encoding: 8bit\n" 12 12 "Plural-Forms: nplurals=2; plural=(n != 1);\n" 13 "X-Generator: Poedit 3.0.1\n" 14 15 msgid "General Settings" 16 msgstr "Ajustes generales" 13 "X-Generator: Poedit 3.4.1\n" 17 14 18 15 msgid "Document Editing Service address" … … 31 28 msgstr "Dejar en blanco para utilizar el encabezado predeterminado" 32 29 33 msgid "Settings Saved"34 msgstr "Los ajustes se han guardado"35 36 30 msgid "Open in ONLYOFFICE" 37 31 msgstr "Abrir en ONLYOFFICE" … … 49 43 msgstr "Ajustes" 50 44 51 msgid "General settings section"52 msgstr "Sección de ajustes generales"53 54 45 msgid "Files" 55 46 msgstr "Archivos" 56 47 57 msgid " Configure ONLYOFFICE connector settings"58 msgstr " Configurar los ajustes del conector de ONLYOFFICE"48 msgid "ONLYOFFICE Docs Settings" 49 msgstr "Ajustes de ONLYOFFICE Docs" 59 50 60 msgid " ONLYOFFICE cannot be reached. Please contact admin"61 msgstr " No se puede establecer contacto con ONLYOFFICE. Por favor, contacte con admin"51 msgid "Configure ONLYOFFICE Docs plugin settings." 52 msgstr "Configurar los ajustes del plugin de ONLYOFFICE Docs" 62 53 63 msgid " Files that can be edited and opened in ONLYOFFICE will be displayed here"64 msgstr " Los archivos que se pueden editar y abrir en ONLYOFFICE se mostrarán aquí"54 msgid "Configure ONLYOFFICE Docs plugin settings for the whole network." 55 msgstr "Configurar los ajustes del plugin ONLYOFFICE Docs para toda la red." 65 56 66 msgid " No files found for editing or viewing in ONLYOFFICE."67 msgstr " No se han encontrado archivos para editar o ver en ONLYOFFICE."57 msgid "Configure ONLYOFFICE Docs plugin settings for %s site." 58 msgstr "Configurar los ajustes del plugin ONLYOFFICE Docs para el sitio %s." 68 59 69 msgid "Add ONLYOFFICE editor on page" 70 msgstr "Añadir el editor de ONLYOFFICE en la página" 60 msgid "Blocked from changing settings by the Network administrator" 61 msgstr "El administrador de la red no le permite cambiar los ajustes" 62 63 msgid "Allow site administrators to configure plugin for their sites" 64 msgstr "Permitir a los administradores de los sitios configurar el plugin para sus sitios" 65 66 msgid "Inherit Network Settings" 67 msgstr "Aplicar los ajustes de red" 68 69 msgid "Connection Settings" 70 msgstr "Ajustes de conexión" 71 72 #: controllers/js/frontend-controller.js 73 msgid "ONLYOFFICE Docs cannot be reached. Please contact admin." 74 msgstr "No se puede acceder a ONLYOFFICE Docs. Por favor, contacte con el administrador." 75 76 msgid "Files that can be edited and opened in ONLYOFFICE Docs editor are displayed here." 77 msgstr "Los archivos que se pueden editar y abrir en el editor de ONLYOFFICE Docs se mostrarán aquí." 78 79 msgid "No files found for editing or viewing in ONLYOFFICE Docs editor." 80 msgstr "No se han encontrado archivos para editar o ver en el editor de ONLYOFFICE Docs." 81 82 msgid "Add ONLYOFFICE Docs editor on page" 83 msgstr "Añadir el editor de ONLYOFFICE Docs a la página" 71 84 72 85 msgid "ONLYOFFICE Docs Cloud" … … 78 91 msgid "Get Now" 79 92 msgstr "Obtener ahora" 93 94 #: onlyoffice-wordpress-block/build/index.js 95 msgid "Embedded" 96 msgstr "Incorporado" 97 98 #: onlyoffice-wordpress-block/build/index.js 99 msgid "Document view" 100 msgstr "Visualización de documento" 101 102 #: onlyoffice-wordpress-block/build/index.js 103 msgid "Open in ONLYOFFICE" 104 msgstr "Abrir en ONLYOFFICE" 105 106 #: onlyoffice-wordpress-block/build/index.js 107 msgid "Show Open in ONLYOFFICE button" 108 msgstr "Mostrar el botón Abrir en ONLYOFFICE" 109 110 #: onlyoffice-wordpress-block/build/index.js 111 #: controllers/js/frontend-controller.js 112 msgid "File not found!" 113 msgstr "¡No se ha encontrado el archivo!" 114 115 msgid "Settings update" 116 msgstr "Actualización de los ajustes" 117 118 #: admin/js/settings.js 119 msgid "Do you want to allow sites administrators to configure the plugin themselves?" 120 msgstr "¿Desea permitir a los administradores de los sitios que configuren ellos mismos el plugin?" 121 122 #: admin/js/settings.js 123 msgid "Do you want to apply these settings to all sites?" 124 msgstr "¿Desea aplicar estos ajustes a todos los sitios?" 125 126 #: admin/js/settings.js 127 msgid "Do you want to apply the network settings?" 128 msgstr "¿Desea aplicar los ajustes de red?" -
onlyoffice/trunk/languages/onlyoffice-plugin-fr_FR.po
r2976437 r3070758 11 11 "Content-Transfer-Encoding: 8bit\n" 12 12 "Plural-Forms: nplurals=2; plural=(n > 1);\n" 13 "X-Generator: Poedit 3.0.1\n" 14 15 msgid "General Settings" 16 msgstr "Paramètres généraux" 13 "X-Generator: Poedit 3.4.1\n" 17 14 18 15 msgid "Document Editing Service address" … … 31 28 msgstr "Laissez vide pour utiliser l'en-tête par défaut" 32 29 33 msgid "Settings Saved"34 msgstr "Paramètres sauvegardés"35 36 30 msgid "Open in ONLYOFFICE" 37 31 msgstr "Ouvrir dans ONLYOFFICE" … … 49 43 msgstr "Paramètres" 50 44 51 msgid "General settings section"52 msgstr "Section des paramètres généraux"53 54 45 msgid "Files" 55 46 msgstr "Fichiers" 56 47 57 msgid " Configure ONLYOFFICE connector settings"58 msgstr " Configurer les paramètres du connecteur ONLYOFFICE"48 msgid "ONLYOFFICE Docs Settings" 49 msgstr "Paramètres d'ONLYOFFICE Docs" 59 50 60 msgid " ONLYOFFICE cannot be reached. Please contact admin"61 msgstr " Impossible de joindre ONLYOFFICE. Veuillez contacter l'administrateur"51 msgid "Configure ONLYOFFICE Docs plugin settings." 52 msgstr "Configurer les paramètres du connecteur ONLYOFFICE Docs" 62 53 63 msgid " Files that can be edited and opened in ONLYOFFICE will be displayed here"64 msgstr " Les fichiers qui peuvent être édités et ouverts dans ONLYOFFICE seront affichés ici"54 msgid "Configure ONLYOFFICE Docs plugin settings for the whole network." 55 msgstr "Configurez les paramètres du plugin ONLYOFFICE Docs pour l'ensemble du réseau." 65 56 66 msgid " No files found for editing or viewing in ONLYOFFICE."67 msgstr " Aucun fichier trouvé pour être édité ou affiché dans ONLYOFFICE."57 msgid "Configure ONLYOFFICE Docs plugin settings for %s site." 58 msgstr "Configurez les paramètres du plugin ONLYOFFICE Docs pour le site %s." 68 59 69 msgid "Add ONLYOFFICE editor on page" 70 msgstr "Ajouter l'éditeur ONLYOFFICE à la page" 60 msgid "Blocked from changing settings by the Network administrator" 61 msgstr "L'administrateur du réseau a bloqué la modification des paramètres" 62 63 msgid "Allow site administrators to configure plugin for their sites" 64 msgstr "Permettez aux administrateurs de sites de configurer le plugin pour leurs sites" 65 66 msgid "Inherit Network Settings" 67 msgstr "Appliquer les paramètres réseau" 68 69 msgid "Connection Settings" 70 msgstr "Paramètres de connexion" 71 72 #: controllers/js/frontend-controller.js 73 msgid "ONLYOFFICE Docs cannot be reached. Please contact admin." 74 msgstr "Impossible de joindre ONLYOFFICE Docs. Veuillez contacter l'administrateur." 75 76 msgid "Files that can be edited and opened in ONLYOFFICE Docs editor are displayed here." 77 msgstr "Les fichiers qui peuvent être édités et ouverts dans l'éditeur ONLYOFFICE Docs sont affichés ici." 78 79 msgid "No files found for editing or viewing in ONLYOFFICE Docs editor." 80 msgstr "Aucun fichier trouvé pour être édité ou affiché dans ONLYOFFICE Docs." 81 82 msgid "Add ONLYOFFICE Docs editor on page" 83 msgstr "Ajouter l'éditeur ONLYOFFICE Docs à la page" 71 84 72 85 msgid "ONLYOFFICE Docs Cloud" … … 78 91 msgid "Get Now" 79 92 msgstr "Obtenir maintenant" 93 94 #: onlyoffice-wordpress-block/build/index.js 95 msgid "Embedded" 96 msgstr "Intégré" 97 98 #: onlyoffice-wordpress-block/build/index.js 99 msgid "Document view" 100 msgstr "Vue du document" 101 102 #: onlyoffice-wordpress-block/build/index.js 103 msgid "Open in ONLYOFFICE" 104 msgstr "Ouvrir dans ONLYOFFICE" 105 106 #: onlyoffice-wordpress-block/build/index.js 107 msgid "Show Open in ONLYOFFICE button" 108 msgstr "Afficher le bouton Ouvrir dans ONLYOFFICE" 109 110 #: onlyoffice-wordpress-block/build/index.js 111 #: controllers/js/frontend-controller.js 112 msgid "File not found!" 113 msgstr "Fichier non trouvé !" 114 115 msgid "Settings update" 116 msgstr "Actualiser les paramètres" 117 118 #: admin/js/settings.js 119 msgid "Do you want to allow sites administrators to configure the plugin themselves?" 120 msgstr "Souhaitez-vous permettre aux administrateurs de sites de configurer eux-mêmes le plugin ?" 121 122 #: admin/js/settings.js 123 msgid "Do you want to apply these settings to all sites?" 124 msgstr "Souhaitez-vous appliquer ces paramètres à tous les sites ?" 125 126 #: admin/js/settings.js 127 msgid "Do you want to apply the network settings?" 128 msgstr "Souhaitez-vous appliquer les paramètres du réseau ?" -
onlyoffice/trunk/languages/onlyoffice-plugin-it_IT.po
r2976437 r3070758 11 11 "Content-Transfer-Encoding: 8bit\n" 12 12 "Plural-Forms: nplurals=2; plural=(n != 1);\n" 13 "X-Generator: Poedit 3.0.1\n" 14 15 msgid "General Settings" 16 msgstr "Impostazioni generali" 13 "X-Generator: Poedit 3.4.1\n" 17 14 18 15 msgid "Document Editing Service address" … … 31 28 msgstr "Lascia vuoto per utilizzare l'intestazione predefinita" 32 29 33 msgid "Settings Saved"34 msgstr "Le impostazioni sono state salvate"35 36 30 msgid "Open in ONLYOFFICE" 37 31 msgstr "Aprire in ONLYOFFICE" … … 49 43 msgstr "Impostazioni" 50 44 51 msgid "General settings section"52 msgstr "Sezione Impostazioni generali"53 54 45 msgid "Files" 55 46 msgstr "File" 56 47 57 msgid " Configure ONLYOFFICE connector settings"58 msgstr " Configurare le impostazioni del connettore ONLYOFFICE"48 msgid "ONLYOFFICE Docs Settings" 49 msgstr "Impostazioni di ONLYOFFICE Docs" 59 50 60 msgid " ONLYOFFICE cannot be reached. Please contact admin"61 msgstr " Impossibile raggiungere ONLYOFFICE. Si prega di contattare l'amministratore"51 msgid "Configure ONLYOFFICE Docs plugin settings." 52 msgstr "Configura le impostazioni del plugin di ONLYOFFICE Docs" 62 53 63 msgid " Files that can be edited and opened in ONLYOFFICE will be displayed here"64 msgstr " I file che possono essere modificati e aperti in ONLYOFFICE verranno visualizzati qui"54 msgid "Configure ONLYOFFICE Docs plugin settings for the whole network." 55 msgstr "Configura le impostazioni del plugin di ONLYOFFICE Docs per l'intera rete." 65 56 66 msgid " No files found for editing or viewing in ONLYOFFICE."67 msgstr " Nessun file trovato per la modifica o la visualizzazione in ONLYOFFICE"57 msgid "Configure ONLYOFFICE Docs plugin settings for %s site." 58 msgstr "Configura le impostazioni del plugin di ONLYOFFICE Docs per il sito di %s." 68 59 69 msgid "Add ONLYOFFICE editor on page" 70 msgstr "Aggiungere l'editor ONLYOFFICE alla pagina" 60 msgid "Blocked from changing settings by the Network administrator" 61 msgstr "Bloccato dalle modifiche delle impostazioni da parte dell'amministratore di rete" 62 63 msgid "Allow site administrators to configure plugin for their sites" 64 msgstr "Consenti agli amministratori del sito di configurare il plugin per i loro siti" 65 66 msgid "Inherit Network Settings" 67 msgstr "Eredita le impostazioni di rete" 68 69 msgid "Connection Settings" 70 msgstr "Impostazioni della connessione" 71 72 #: controllers/js/frontend-controller.js 73 msgid "ONLYOFFICE Docs cannot be reached. Please contact admin." 74 msgstr "Impossibile raggiungere ONLYOFFICE Docs. Ti preghiamo di contattare l'amministratore." 75 76 msgid "Files that can be edited and opened in ONLYOFFICE Docs editor are displayed here." 77 msgstr "I file che possono essere modificati e aperti nell'editor di ONLYOFFICE Docs vengono visualizzati qui." 78 79 msgid "No files found for editing or viewing in ONLYOFFICE Docs editor." 80 msgstr "Nessun file trovato per la modifica o la visualizzazione nell'editor di ONLYOFFICE Docs." 81 82 msgid "Add ONLYOFFICE Docs editor on page" 83 msgstr "Aggiungi l'editor di ONLYOFFICE Docs alla pagina" 71 84 72 85 msgid "ONLYOFFICE Docs Cloud" 73 msgstr "ONLYOFFICE Docs nelCloud"86 msgstr "ONLYOFFICE Docs Cloud" 74 87 75 88 msgid "Easily launch the editors in the cloud without downloading and installation" … … 78 91 msgid "Get Now" 79 92 msgstr "Ottieni ora" 93 94 #: onlyoffice-wordpress-block/build/index.js 95 msgid "Embedded" 96 msgstr "Incorporato" 97 98 #: onlyoffice-wordpress-block/build/index.js 99 msgid "Document view" 100 msgstr "Visualizzazione del documento" 101 102 #: onlyoffice-wordpress-block/build/index.js 103 msgid "Open in ONLYOFFICE" 104 msgstr "Aprire in ONLYOFFICE" 105 106 #: onlyoffice-wordpress-block/build/index.js 107 msgid "Show Open in ONLYOFFICE button" 108 msgstr "Mostra il pulsante Apri in ONLYOFFICE" 109 110 #: onlyoffice-wordpress-block/build/index.js 111 #: controllers/js/frontend-controller.js 112 msgid "File not found!" 113 msgstr "File non trovato!" 114 115 msgid "Settings update" 116 msgstr "Aggiornamento delle impostazioni" 117 118 #: admin/js/settings.js 119 msgid "Do you want to allow sites administrators to configure the plugin themselves?" 120 msgstr "Vuoi consentire agli amministratori dei siti di configurare il plugin autonomamente?" 121 122 #: admin/js/settings.js 123 msgid "Do you want to apply these settings to all sites?" 124 msgstr "Vuoi applicare queste impostazioni a tutti i siti?" 125 126 #: admin/js/settings.js 127 msgid "Do you want to apply the network settings?" 128 msgstr "Vuoi applicare le impostazioni di rete?" -
onlyoffice/trunk/languages/onlyoffice-plugin-ja.po
r2976437 r3070758 11 11 "Content-Transfer-Encoding: 8bit\n" 12 12 "Plural-Forms: nplurals=1; plural=0;\n" 13 "X-Generator: Poedit 3.0.1\n" 14 15 msgid "General Settings" 16 msgstr "一般設定" 13 "X-Generator: Poedit 3.4.1\n" 17 14 18 15 msgid "Document Editing Service address" … … 31 28 msgstr "デフォルトのヘッダーを使用したい場合は空白にしてください" 32 29 33 msgid "Settings Saved"34 msgstr "設定が保存されました"35 36 30 msgid "Open in ONLYOFFICE" 37 31 msgstr "ONLYOFFICEで開く" … … 49 43 msgstr "設定" 50 44 51 msgid "General settings section"52 msgstr "一般設定セクション"53 54 45 msgid "Files" 55 46 msgstr "ファイル" 56 47 57 msgid " Configure ONLYOFFICE connector settings"58 msgstr "ONLYOFFICE コネクタ設定を構成する"48 msgid "ONLYOFFICE Docs Settings" 49 msgstr "ONLYOFFICE Docsの設定" 59 50 60 msgid " ONLYOFFICE cannot be reached. Please contact admin"61 msgstr "ONLYOFFICE に接続できません。管理者にお問い合わせください"51 msgid "Configure ONLYOFFICE Docs plugin settings." 52 msgstr "ONLYOFFICE Docsプラグインの設定" 62 53 63 msgid " Files that can be edited and opened in ONLYOFFICE will be displayed here"64 msgstr " ONLYOFFICEで開いて、編集することができるファイルがここに表示されます"54 msgid "Configure ONLYOFFICE Docs plugin settings for the whole network." 55 msgstr "ネットワーク全体のONLYOFFICE Docsプラグイン設定を行う" 65 56 66 msgid " No files found for editing or viewing in ONLYOFFICE."67 msgstr " ONLYOFFICEで編集または表示するファイルが見つかりません。"57 msgid "Configure ONLYOFFICE Docs plugin settings for %s site." 58 msgstr "%s サイトのONLYOFFICE Docsプラグイン設定を行う" 68 59 69 msgid "Add ONLYOFFICE editor on page" 70 msgstr "ページにONLYOFFICEエディターを追加する" 60 msgid "Blocked from changing settings by the Network administrator" 61 msgstr "ネットワーク管理者による設定の変更がブロックされています" 62 63 msgid "Allow site administrators to configure plugin for their sites" 64 msgstr "サイト管理者が自分のサイトのプラグインを設定できるようにする" 65 66 msgid "Inherit Network Settings" 67 msgstr "ネットワーク設定の継承" 68 69 msgid "Connection Settings" 70 msgstr "接続設定" 71 72 #: controllers/js/frontend-controller.js 73 msgid "ONLYOFFICE Docs cannot be reached. Please contact admin." 74 msgstr "ONLYOFFICE Docsにアクセスできません。管理者にお問い合わせください。" 75 76 msgid "Files that can be edited and opened in ONLYOFFICE Docs editor are displayed here." 77 msgstr "ここではONLYOFFICE Docsエディタで編集・閲覧可能なファイルが表示されます。" 78 79 msgid "No files found for editing or viewing in ONLYOFFICE Docs editor." 80 msgstr "ONLYOFFICE Docsエディタで編集・閲覧可能なファイルは見つかりませんでした。" 81 82 msgid "Add ONLYOFFICE Docs editor on page" 83 msgstr "ONLYOFFICE Docsエディタ追加ページ" 71 84 72 85 msgid "ONLYOFFICE Docs Cloud" 73 msgstr "ONLYOFFICE Docs Cloud"86 msgstr "ONLYOFFICEドキュメントエディタをページに追加する" 74 87 75 88 msgid "Easily launch the editors in the cloud without downloading and installation" … … 78 91 msgid "Get Now" 79 92 msgstr "今すぐ使ってみる" 93 94 #: onlyoffice-wordpress-block/build/index.js 95 msgid "Embedded" 96 msgstr "埋め込み" 97 98 #: onlyoffice-wordpress-block/build/index.js 99 msgid "Document view" 100 msgstr "ドキュメント表示" 101 102 #: onlyoffice-wordpress-block/build/index.js 103 msgid "Open in ONLYOFFICE" 104 msgstr "ONLYOFFICEで開く" 105 106 #: onlyoffice-wordpress-block/build/index.js 107 msgid "Show Open in ONLYOFFICE button" 108 msgstr "「ONLYOFFICEで開く」ボタンを表示" 109 110 #: onlyoffice-wordpress-block/build/index.js 111 #: controllers/js/frontend-controller.js 112 msgid "File not found!" 113 msgstr "ファイルが見つかりません!" 114 115 msgid "Settings update" 116 msgstr "設定の更新" 117 118 #: admin/js/settings.js 119 msgid "Do you want to allow sites administrators to configure the plugin themselves?" 120 msgstr "サイト管理者自身がプラグインを設定できるようにしますか?" 121 122 #: admin/js/settings.js 123 msgid "Do you want to apply these settings to all sites?" 124 msgstr "これらの設定をすべてのサイトに適用しますか?" 125 126 #: admin/js/settings.js 127 msgid "Do you want to apply the network settings?" 128 msgstr "ネットワーク設定を適用しますか?" -
onlyoffice/trunk/languages/onlyoffice-plugin-ru_RU.po
r2976437 r3070758 11 11 "Content-Transfer-Encoding: 8bit\n" 12 12 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n" 13 "X-Generator: Poedit 3.0.1\n" 14 15 msgid "General Settings" 16 msgstr "Основные настройки" 13 "X-Generator: Poedit 3.4.1\n" 17 14 18 15 msgid "Document Editing Service address" … … 31 28 msgstr "Оставьте пустым, чтобы использовать заголовок по умолчанию" 32 29 33 msgid "Settings Saved"34 msgstr "Настройки сохранены"35 36 30 msgid "Open in ONLYOFFICE" 37 31 msgstr "Открыть в ONLYOFFICE" … … 49 43 msgstr "Настройки" 50 44 51 msgid "General settings section"52 msgstr "Раздел основных настроек"53 54 45 msgid "Files" 55 46 msgstr "Файлы" 56 47 57 msgid " Configure ONLYOFFICE connector settings"58 msgstr "Настройк а параметров коннектора ONLYOFFICE"48 msgid "ONLYOFFICE Docs Settings" 49 msgstr "Настройки ONLYOFFICE Docs" 59 50 60 msgid " ONLYOFFICE cannot be reached. Please contact admin"61 msgstr " Приложение ONLYOFFICE недоступно. Пожалуйста, свяжитесь с администратором"51 msgid "Configure ONLYOFFICE Docs plugin settings." 52 msgstr "Настройте параметры плагина ONLYOFFICE Docs." 62 53 63 msgid " Files that can be edited and opened in ONLYOFFICE will be displayed here"64 msgstr " Здесь будут отражены файлы, которые можно редактировать и открывать в ONLYOFFICE"54 msgid "Configure ONLYOFFICE Docs plugin settings for the whole network." 55 msgstr "Настройте параметры плагина ONLYOFFICE Docs для всей сети." 65 56 66 msgid " No files found for editing or viewing in ONLYOFFICE."67 msgstr "Н е найдены файлы для редактирования или просмотра в ONLYOFFICE."57 msgid "Configure ONLYOFFICE Docs plugin settings for %s site." 58 msgstr "Настройте параметры плагина ONLYOFFICE Docs для сайта %s." 68 59 69 msgid "Add ONLYOFFICE editor on page" 70 msgstr "Добавить редактор ONLYOFFICE на страницу" 60 msgid "Blocked from changing settings by the Network administrator" 61 msgstr "Администратор сети заблокировал изменение настроек." 62 63 msgid "Allow site administrators to configure plugin for their sites" 64 msgstr "Разрешить администраторам сайта настраивать плагин для своих сайтов" 65 66 msgid "Inherit Network Settings" 67 msgstr "Наследовать настройки сети" 68 69 msgid "Connection Settings" 70 msgstr "Настройки соединения" 71 72 #: controllers/js/frontend-controller.js 73 msgid "ONLYOFFICE Docs cannot be reached. Please contact admin." 74 msgstr "Приложение ONLYOFFICE Docs недоступно. Пожалуйста, свяжитесь с администратором." 75 76 msgid "Files that can be edited and opened in ONLYOFFICE Docs editor are displayed here." 77 msgstr "Здесь отображаются файлы, которые можно редактировать и открывать в редакторе ONLYOFFICE Docs." 78 79 msgid "No files found for editing or viewing in ONLYOFFICE Docs editor." 80 msgstr "Не найдены файлы для редактирования или просмотра в редакторе ONLYOFFICE Docs." 81 82 msgid "Add ONLYOFFICE Docs editor on page" 83 msgstr "Добавить редактор ONLYOFFICE Docs на страницу" 71 84 72 85 msgid "ONLYOFFICE Docs Cloud" … … 78 91 msgid "Get Now" 79 92 msgstr "Получить сейчас" 93 94 #: onlyoffice-wordpress-block/build/index.js 95 msgid "Embedded" 96 msgstr "Встроенный" 97 98 #: onlyoffice-wordpress-block/build/index.js 99 msgid "Document view" 100 msgstr "Просмотр документа" 101 102 #: onlyoffice-wordpress-block/build/index.js 103 msgid "Open in ONLYOFFICE" 104 msgstr "Открыть в ONLYOFFICE" 105 106 #: onlyoffice-wordpress-block/build/index.js 107 msgid "Show Open in ONLYOFFICE button" 108 msgstr "Показать кнопку Открыть в ONLYOFFICE" 109 110 #: onlyoffice-wordpress-block/build/index.js 111 #: controllers/js/frontend-controller.js 112 msgid "File not found!" 113 msgstr "Файл не найден!" 114 115 msgid "Settings update" 116 msgstr "Обновление настроек" 117 118 #: admin/js/settings.js 119 msgid "Do you want to allow sites administrators to configure the plugin themselves?" 120 msgstr "Хотите разрешить администраторам сайтов самостоятельно настраивать плагин?" 121 122 #: admin/js/settings.js 123 msgid "Do you want to apply these settings to all sites?" 124 msgstr "Хотите применить эти настройки ко всем сайтам?" 125 126 #: admin/js/settings.js 127 msgid "Do you want to apply the network settings?" 128 msgstr "Хотите применить настройки сети?" -
onlyoffice/trunk/languages/onlyoffice-plugin-zh_CN.po
r2976437 r3070758 11 11 "Content-Transfer-Encoding: 8bit\n" 12 12 "Plural-Forms: nplurals=1; plural=0;\n" 13 "X-Generator: Poedit 3.0.1\n" 14 15 msgid "General Settings" 16 msgstr "一般设置" 13 "X-Generator: Poedit 3.4.1\n" 17 14 18 15 msgid "Document Editing Service address" … … 31 28 msgstr "留空以使用默认的标头" 32 29 33 msgid "Settings Saved"34 msgstr "设置已保存"35 36 30 msgid "Open in ONLYOFFICE" 37 31 msgstr "用 ONLYOFFICE 打开" … … 49 43 msgstr "设置" 50 44 51 msgid "General settings section"52 msgstr "通用设置部分"53 54 45 msgid "Files" 55 46 msgstr "文件" 56 47 57 msgid " Configure ONLYOFFICE connector settings"58 msgstr " 配置ONLYOFFICE连接器设置"48 msgid "ONLYOFFICE Docs Settings" 49 msgstr "ONLYOFFICE 文档设置" 59 50 60 msgid " ONLYOFFICE cannot be reached. Please contact admin"61 msgstr " 无法联系到ONLYOFFICE。请联系管理员"51 msgid "Configure ONLYOFFICE Docs plugin settings" 52 msgstr "配置 ONLYOFFICE 文档插件设置" 62 53 63 msgid " Files that can be edited and opened in ONLYOFFICE will be displayed here"64 msgstr " 可在ONLYOFFICE中编辑并打开的文件将在这里显示"54 msgid "Configure ONLYOFFICE Docs plugin settings for the whole network." 55 msgstr "为整个网络进行 ONLYOFFICE 文档插件设置。" 65 56 66 msgid " No files found for editing or viewing in ONLYOFFICE."67 msgstr " 未发现可在ONLYOFFICE中编辑或查看的文件。"57 msgid "Configure ONLYOFFICE Docs plugin settings for %s site." 58 msgstr "为 %s 站点进行 ONLYOFFICE 文档插件设置。" 68 59 69 msgid "Add ONLYOFFICE editor on page" 70 msgstr "将ONLYOFFICE编辑器添加到页面上" 60 msgid "Blocked from changing settings by the Network administrator" 61 msgstr "更改设置已被网络管理员阻止" 62 63 msgid "Allow site administrators to configure plugin for their sites" 64 msgstr "允许站点管理员为其站点配置插件" 65 66 msgid "Inherit Network Settings" 67 msgstr "继承网络设置" 68 69 msgid "Connection Settings" 70 msgstr "连接设置" 71 72 #: controllers/js/frontend-controller.js 73 msgid "ONLYOFFICE Docs cannot be reached. Please contact admin." 74 msgstr "无法连接到 ONLYOFFICE 文档。请联系管理员。" 75 76 msgid "Files that can be edited and opened in ONLYOFFICE Docs editor are displayed here." 77 msgstr "可在 ONLYOFFICE 文档中编辑并打开的文件在这里显示。" 78 79 msgid "No files found for editing or viewing in ONLYOFFICE Docs editor." 80 msgstr "未找到可在 ONLYOFFICE 文档编辑器中编辑或查看的文件。" 81 82 msgid "Add ONLYOFFICE Docs editor on page" 83 msgstr "将 ONLYOFFICE 文档编辑器添加到页面上" 71 84 72 85 msgid "ONLYOFFICE Docs Cloud" … … 78 91 msgid "Get Now" 79 92 msgstr "立即获取" 93 94 #: onlyoffice-wordpress-block/build/index.js 95 msgid "Embedded" 96 msgstr "嵌入式" 97 98 #: onlyoffice-wordpress-block/build/index.js 99 msgid "Document view" 100 msgstr "文档视图" 101 102 #: onlyoffice-wordpress-block/build/index.js 103 msgid "Open in ONLYOFFICE" 104 msgstr "用 ONLYOFFICE 打开" 105 106 #: onlyoffice-wordpress-block/build/index.js 107 msgid "Show Open in ONLYOFFICE button" 108 msgstr "显示在 ONLYOFFICE 中打开按钮" 109 110 #: onlyoffice-wordpress-block/build/index.js 111 #: controllers/js/frontend-controller.js 112 msgid "File not found!" 113 msgstr "未找到文件!" 114 115 msgid "Settings update" 116 msgstr "设置更新" 117 118 #: admin/js/settings.js 119 msgid "Do you want to allow sites administrators to configure the plugin themselves?" 120 msgstr "您是否允许站点管理员自己配置插件?" 121 122 #: admin/js/settings.js 123 msgid "Do you want to apply these settings to all sites?" 124 msgstr "是否将这些设置应用到所有站点?" 125 126 #: admin/js/settings.js 127 msgid "Do you want to apply the network settings?" 128 msgstr "是否应用网络设置?" -
onlyoffice/trunk/languages/onlyoffice-plugin.pot
r2976437 r3070758 3 3 "Content-Type: text/plain; charset=UTF-8\n" 4 4 5 msgid "General Settings" 6 msgstr "" 5 6 7 8 9 10 11 12 13 7 14 8 15 msgid "Document Editing Service address" … … 19 26 20 27 msgid "Leave blank to use default header" 21 msgstr ""22 23 msgid "Settings Saved"24 28 msgstr "" 25 29 … … 39 43 msgstr "" 40 44 41 msgid "General settings section"42 msgstr ""43 44 45 msgid "Files" 45 46 msgstr "" 46 47 47 msgid " Configure ONLYOFFICE connector settings"48 msgid "ONLYOFFICE Docs Settings" 48 49 msgstr "" 49 50 50 msgid " ONLYOFFICE cannot be reached. Please contact admin"51 msgid "Configure ONLYOFFICE Docs plugin settings." 51 52 msgstr "" 52 53 53 msgid " Files that can be edited and opened in ONLYOFFYCE will be displayed here"54 msgid "Configure ONLYOFFICE Docs plugin settings for the whole network." 54 55 msgstr "" 55 56 56 msgid " No files found for editing or viewing in ONLYOFFICE."57 msgid "Configure ONLYOFFICE Docs plugin settings for %s site." 57 58 msgstr "" 58 59 59 msgid "Add ONLYOFFICE editor on page" 60 msgid "Blocked from changing settings by the Network administrator" 61 msgstr "" 62 63 msgid "Allow site administrators to configure plugin for their sites" 64 msgstr "" 65 66 msgid "Inherit Network Settings" 67 msgstr "" 68 69 msgid "Connection Settings" 70 msgstr "" 71 72 #: controllers/js/frontend-controller.js 73 msgid "ONLYOFFICE Docs cannot be reached. Please contact admin." 74 msgstr "" 75 76 msgid "Files that can be edited and opened in ONLYOFFICE Docs editor are displayed here." 77 msgstr "" 78 79 msgid "No files found for editing or viewing in ONLYOFFICE Docs editor." 80 msgstr "" 81 82 msgid "Add ONLYOFFICE Docs editor on page" 60 83 msgstr "" 61 84 … … 68 91 msgid "Get Now" 69 92 msgstr "" 93 94 #: onlyoffice-wordpress-block/build/index.js 95 msgid "Embedded" 96 msgstr "" 97 98 #: onlyoffice-wordpress-block/build/index.js 99 msgid "Document view" 100 msgstr "" 101 102 #: onlyoffice-wordpress-block/build/index.js 103 msgid "Open in ONLYOFFICE" 104 msgstr "" 105 106 #: onlyoffice-wordpress-block/build/index.js 107 msgid "Show Open in ONLYOFFICE button" 108 msgstr "" 109 110 #: onlyoffice-wordpress-block/build/index.js 111 #: controllers/js/frontend-controller.js 112 msgid "File not found!" 113 msgstr "" 114 115 msgid "Settings update" 116 msgstr "" 117 118 #: admin/js/settings.js 119 msgid "Do you want to allow sites administrators to configure the plugin themselves?" 120 msgstr "" 121 122 #: admin/js/settings.js 123 msgid "Do you want to apply these settings to all sites?" 124 msgstr "" 125 126 #: admin/js/settings.js 127 msgid "Do you want to apply the network settings?" 128 msgstr "" -
onlyoffice/trunk/licenses/3rd-Party.license
r2976437 r3070758 1 ONLYOFFICE WordPress plugin uses code from the following 3rd party projects.1 ONLYOFFICE Docs plugin uses code from the following 3rd party projects. 2 2 3 3 JWT - A simple library to encode and decode JSON Web Tokens (JWT) in PHP. (https://github.com/firebase/php-jwt) -
onlyoffice/trunk/onlyoffice-tinymce/onlyoffice-tinymce.js
r2976437 r3070758 1 /* 2 * (c) Copyright Ascensio System SIA 20231 /** 2 * JS for ONLYOFFICE Docs TinyMCE. 3 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 */ 4 * @package Onlyoffice_Wordpress 5 */ 18 6 19 (function() { 20 tinymce.PluginManager.add("onlyoffice-tinymce", function(editor) { 21 editor.addButton("onlyoffice-tinymce", { 22 tooltip: "ONLYOFFICE", 23 onclick: function() { 24 let frameOnlyoffice = wp.media.frames.onlyoffice; 7 ( function ( ) { 8 tinymce.PluginManager.add( 9 "onlyoffice-tinymce", 10 function ( editor ) { 11 editor.addButton( 12 "onlyoffice-tinymce", 13 { 14 tooltip: "ONLYOFFICE", 15 onclick: function () { 16 let frameOnlyoffice = wp.media.frames.onlyoffice; 25 17 26 if (frameOnlyoffice) {27 frameOnlyoffice.open();28 return;29 }18 if (frameOnlyoffice) { 19 frameOnlyoffice.open(); 20 return; 21 } 30 22 31 const onlyofficeAllowedExts = oo_media.formats.toString().split(" ").join("").split(".").join("").split(","); 32 let onlyofficeAllowedMimes = []; 23 let onlyofficeAllowedMimes = []; 33 24 34 for (let ext of onlyofficeAllowedExts) {35 var mimeType = getMimeType(ext);25 for (let ext of ONLYOFFICE.formatsUtils.getViewableExtensions()) { 26 var mimeType = getMimeType( ext ); 36 27 37 if (mimeType){38 onlyofficeAllowedMimes.push(mimeType);39 }40 }28 if ( mimeType ) { 29 onlyofficeAllowedMimes.push( mimeType ); 30 } 31 } 41 32 42 frameOnlyoffice = wp.media.frames.onlyoffice = wp.media({ 43 title: wp.i18n.__("Select or Upload Media"), 44 library: { 45 type: onlyofficeAllowedMimes 46 } 47 }); 33 frameOnlyoffice = wp.media.frames.onlyoffice = wp.media( 34 { 35 title: wp.i18n.__( "Select or Upload Media" ), 36 library: { 37 type: onlyofficeAllowedMimes 38 } 39 } 40 ); 48 41 49 frameOnlyoffice.on("select", function() { 50 const selectedAttachment = frameOnlyoffice.state().get('selection').first(); 42 frameOnlyoffice.on( 43 "select", 44 function () { 45 const selectedAttachment = frameOnlyoffice.state().get( 'selection' ).first(); 51 46 52 let params = {53 id: selectedAttachment.id,54 fileName: selectedAttachment.attributes.filename,55 }47 let params = { 48 id: selectedAttachment.id, 49 fileName: selectedAttachment.attributes.filename, 50 } 56 51 57 const wpOnlyofficeBlock = `<!-- wp:onlyoffice-wordpress/onlyoffice ${JSON.stringify(params)} -->`;52 const wpOnlyofficeBlock = "<!-- wp:onlyoffice-wordpress/onlyoffice " + JSON.stringify( params ) + " -->"; 58 53 59 let wpOnlyofficeBody = "[onlyoffice id=" + selectedAttachment.id + " /]";54 let wpOnlyofficeBody = "[onlyoffice id=" + selectedAttachment.id + " /]"; 60 55 61 let wpOnlyofficeBlockEnd = "<!-- /wp:onlyoffice-wordpress/onlyoffice -->"56 let wpOnlyofficeBlockEnd = "<!-- /wp:onlyoffice-wordpress/onlyoffice -->" 62 57 63 editor.insertContent(wpOnlyofficeBlock + wpOnlyofficeBody + wpOnlyofficeBlockEnd); 64 }); 58 editor.insertContent( wpOnlyofficeBlock + wpOnlyofficeBody + wpOnlyofficeBlockEnd ); 59 } 60 ); 65 61 66 frameOnlyoffice.open(); 67 } 68 }); 69 }); 62 frameOnlyoffice.open(); 63 } 64 } 65 ); 66 } 67 ); 70 68 71 var getMimeType = function( name ) {72 var allTypes = oo_media.mimeTypes;69 var getMimeType = function ( name ) { 70 var allTypes = ONLYOFFICE.mimeTypes; 73 71 74 if (allTypes[name] !== undefined) {75 return allTypes[name];76 }72 if ( allTypes[name] !== undefined ) { 73 return allTypes[name]; 74 } 77 75 78 for(var key in allTypes) {79 if(key.indexOf(name) !== -1) {80 return allTypes[key];81 }82 }76 for ( var key in allTypes ) { 77 if ( key.indexOf( name ) !== -1 ) { 78 return allTypes[key]; 79 } 80 } 83 81 84 return false;85 };82 return false; 83 }; 86 84 })(); -
onlyoffice/trunk/onlyoffice-tinymce/onlyoffice-tinymce.php
r2976437 r3070758 9 9 /** 10 10 * 11 * (c) Copyright Ascensio System SIA 202 311 * (c) Copyright Ascensio System SIA 2024 12 12 * 13 13 * This program is free software; you can redistribute it and/or -
onlyoffice/trunk/onlyoffice-wordpress-block/block.json
r2976437 r3070758 3 3 "apiVersion": 2, 4 4 "name": "onlyoffice-wordpress/onlyoffice", 5 "title": "ONLYOFFICE ",5 "title": "ONLYOFFICE Docs", 6 6 "category": "media", 7 7 "editorScript": "file:./build/index.js", 8 "editorStyle": "file:build/index.css", 8 9 "keywords": ["onlyoffice"], 9 10 "textdomain": "onlyoffice-plugin", … … 14 15 "fileName": { 15 16 "type": "string" 17 }, 18 "documentView": { 19 "type": "string" 20 }, 21 "inNewTab": { 22 "type": "boolean", 23 "default": true 24 }, 25 "width": { 26 "type": "string" 27 }, 28 "height":{ 29 "type": "string" 30 }, 31 "showOpenButton":{ 32 "type": "boolean", 33 "default": true 34 }, 35 "openButtonText":{ 36 "type": "string" 16 37 } 38 }, 39 "supports": { 40 "align": true 17 41 } 18 42 } -
onlyoffice/trunk/onlyoffice-wordpress-block/build/index.asset.php
r2976437 r3070758 1 <?php return array('dependencies' => array(' wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '704b791d5149e64f7dcc');1 <?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '4f7c984e58f9263b6891'); -
onlyoffice/trunk/onlyoffice-wordpress-block/build/index.js
r2976437 r3070758 1 !function(){"use strict";var e={d:function(t,l){for(var n in l)e.o(l,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:l[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}};e.d({},{l:function(){return r},i:function(){return d}});var t=window.wp.element,l=window.wp.blocks,n=JSON.parse('{"u2":"onlyoffice-wordpress/onlyoffice"}'),i=window.wp.blockEditor,o=window.wp.components,a=window.wp.i18n;const r={padding:"20px"},d=(0,t.createElement)("svg",{width:"66",height:"60",viewBox:"0 0 66 60",fill:"black",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{opacity:"0.5",fillRule:"evenodd",clipRule:"evenodd",d:"M28.9406 59.2644L2.20792 46.9066C-0.0693069 45.8277 -0.0693069 44.1604 2.20792 43.1796L11.5148 38.8642L28.8416 46.9066C31.1188 47.9854 34.7822 47.9854 36.9604 46.9066L54.2871 38.8642L63.5941 43.1796C65.8713 44.2585 65.8713 45.9258 63.5941 46.9066L36.8614 59.2644C34.7822 60.2452 31.1188 60.2452 28.9406 59.2644Z",fill:"black"}),(0,t.createElement)("path",{opacity:"0.75",fillRule:"evenodd",clipRule:"evenodd",d:"M28.9406 44.0606L2.20792 31.7028C-0.069307 30.6239 -0.069307 28.9566 2.20792 27.9758L11.3168 23.7584L28.9406 31.8989C31.2178 32.9778 34.8812 32.9778 37.0594 31.8989L54.6832 23.7584L63.7921 27.9758C66.0693 29.0547 66.0693 30.722 63.7921 31.7028L37.0594 44.0606C34.7822 45.1395 31.1188 45.1395 28.9406 44.0606Z",fill:"black"}),(0,t.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.9406 29.2518L2.20792 16.8939C-0.069307 15.8151 -0.069307 14.1478 2.20792 13.167L28.9406 0.809144C31.2178 -0.269715 34.8812 -0.269715 37.0594 0.809144L63.7921 13.167C66.0693 14.2458 66.0693 15.9132 63.7921 16.8939L37.0594 29.2518C34.7822 30.2325 31.1188 30.2325 28.9406 29.2518Z",fill:"black"}));(0,l.registerBlockType)(n.u2,{icon:d,edit:e=>{let{attributes:l,setAttributes:n}=e;const c=oo_media.formats;let s=[];const p=function(e){var t=oo_media.mimeTypes;if(void 0!==t[e])return t[e];for(var l in t)if(-1!==l.indexOf(e))return t[l];return!1};for(let e of c){let t=p(e);t&&s.push(t)}const f=(0,i.useBlockProps)({style:r});return l.id?(0,t.createElement)("div",f,(0,t.createElement)(i.InspectorControls,{key:"setting"},(0,t.createElement)(o.PanelBody,{title:(0,a.__)("Settings")},(0,t.createElement)(o.__experimentalInputControl,{label:(0,a.__)("Name"),value:l.fileName,onChange:e=>n({fileName:e})}))),(0,t.createElement)("p",{style:{display:"flex"}},d,(0,t.createElement)("p",{style:{marginLeft:"25px"}}," ",l.fileName||"")),(0,t.createElement)(i.BlockControls,null,(0,t.createElement)(i.MediaReplaceFlow,{mediaId:l.id,allowedTypes:s,accept:s.join(),onSelect:e=>{e&&e.hasOwnProperty("id")&&n({id:e.id,fileName:e.filename||e.guid.raw.substring(e.guid.raw.lastIndexOf("/")+1)})},name:(0,a.__)("Replace")}))):(0,t.createElement)(i.MediaPlaceholder,{labels:{title:"ONLYOFFICE"},allowedTypes:s,accept:s.join(),onSelect:e=>{e&&e.hasOwnProperty("id")&&n({id:e.id,fileName:e.filename||e.guid.raw.substring(e.guid.raw.lastIndexOf("/")+1)})}})},save:e=>{let{attributes:l}=e;return(0,t.createElement)(t.RawHTML,null,`[onlyoffice id=${l.id} /]`)}})}();1 (()=>{"use strict";var e={d:(t,l)=>{for(var n in l)e.o(l,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:l[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};e.d({},{V:()=>p});const t=window.React,l=window.wp.blocks,n=JSON.parse('{"UU":"onlyoffice-wordpress/onlyoffice"}'),i=window.wp.blockEditor,a=window.wp.components,o=window.wp.i18n,C=(0,t.createElement)("svg",{width:"161",height:"205",viewBox:"0 0 161 205",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M152.45 37.2371V191.59C152.45 192.738 151.994 193.84 151.182 194.652C150.37 195.464 149.268 195.92 148.12 195.92H12.88C11.7316 195.92 10.6302 195.464 9.81821 194.652C9.00618 193.84 8.54999 192.738 8.54999 191.59V12.88C8.54999 11.7316 9.00618 10.6302 9.81822 9.81822C10.6302 9.00618 11.7316 8.54999 12.88 8.54999H123.763L152.45 37.2371Z",fill:"#214479",stroke:"#1A3661"}),(0,t.createElement)("path",{opacity:"0.2",d:"M151.5 37.03H128.8C127.519 37.03 126.29 36.5211 125.385 35.6153C124.479 34.7095 123.97 33.481 123.97 32.2V9.5L151.5 37.03Z",fill:"black"}),(0,t.createElement)("path",{d:"M70.9538 167.902L68.2292 178.61H65.6437L64.1936 172.985C64.1643 172.878 64.1252 172.714 64.0764 172.494C64.0275 172.275 63.9763 172.035 63.9226 171.776C63.8688 171.513 63.82 171.266 63.7761 171.037C63.737 170.802 63.7102 170.617 63.6955 170.48C63.6809 170.617 63.6516 170.8 63.6076 171.029C63.5686 171.259 63.5222 171.503 63.4685 171.762C63.4196 172.021 63.3708 172.262 63.322 172.487C63.2731 172.712 63.2341 172.882 63.2048 173L61.7619 178.61H59.1838L56.4519 167.902H58.6857L60.0554 173.747C60.0944 173.922 60.1384 174.132 60.1872 174.377C60.2409 174.621 60.2922 174.877 60.341 175.146C60.3947 175.409 60.4411 175.666 60.4802 175.915C60.5241 176.159 60.5559 176.371 60.5754 176.552C60.5998 176.366 60.6315 176.151 60.6706 175.907C60.7097 175.658 60.7512 175.407 60.7951 175.153C60.8439 174.894 60.8928 174.655 60.9416 174.435C60.9904 174.215 61.0344 174.037 61.0734 173.901L62.6335 167.902H64.7795L66.3396 173.901C66.3737 174.032 66.4128 174.211 66.4567 174.435C66.5056 174.655 66.5544 174.894 66.6032 175.153C66.6521 175.412 66.696 175.666 66.7351 175.915C66.779 176.159 66.8107 176.371 66.8303 176.552C66.8645 176.308 66.9108 176.012 66.9694 175.666C67.0329 175.314 67.0988 174.965 67.1672 174.618C67.2404 174.272 67.3039 173.981 67.3576 173.747L68.7199 167.902H70.9538ZM82.0207 173.241C82.0207 174.067 81.9182 174.818 81.7131 175.497C81.508 176.171 81.1955 176.752 80.7756 177.24C80.3605 177.729 79.8332 178.105 79.1936 178.368C78.5539 178.627 77.7971 178.756 76.923 178.756C76.049 178.756 75.2922 178.627 74.6525 178.368C74.0129 178.105 73.4831 177.729 73.0632 177.24C72.6481 176.752 72.3381 176.169 72.133 175.49C71.9279 174.811 71.8254 174.057 71.8254 173.227C71.8254 172.118 72.0061 171.154 72.3674 170.334C72.7336 169.508 73.2951 168.869 74.052 168.415C74.8088 167.961 75.7707 167.734 76.9377 167.734C78.0998 167.734 79.0544 167.961 79.8015 168.415C80.5534 168.869 81.1101 169.508 81.4714 170.334C81.8376 171.159 82.0207 172.128 82.0207 173.241ZM74.2058 173.241C74.2058 173.988 74.2985 174.633 74.4841 175.175C74.6745 175.712 74.9699 176.127 75.3703 176.42C75.7707 176.708 76.2883 176.852 76.923 176.852C77.5676 176.852 78.09 176.708 78.4904 176.42C78.8908 176.127 79.1813 175.712 79.362 175.175C79.5476 174.633 79.6403 173.988 79.6403 173.241C79.6403 172.118 79.4304 171.234 79.0104 170.59C78.5905 169.945 77.8996 169.623 76.9377 169.623C76.298 169.623 75.7756 169.77 75.3703 170.063C74.9699 170.351 74.6745 170.766 74.4841 171.308C74.2985 171.845 74.2058 172.489 74.2058 173.241ZM87.3601 167.902C88.3317 167.902 89.1325 168.019 89.7624 168.254C90.3972 168.488 90.8684 168.842 91.176 169.316C91.4836 169.789 91.6374 170.387 91.6374 171.11C91.6374 171.598 91.5446 172.026 91.3591 172.392C91.1735 172.758 90.9294 173.068 90.6267 173.322C90.3239 173.576 89.9968 173.783 89.6452 173.944L92.7946 178.61H90.2751L87.7189 174.501H86.5104V178.61H84.2399V167.902H87.3601ZM87.1989 169.762H86.5104V172.655H87.2429C87.9948 172.655 88.5319 172.531 88.8542 172.282C89.1813 172.028 89.3449 171.657 89.3449 171.169C89.3449 170.661 89.1691 170.299 88.8176 170.085C88.4709 169.87 87.9313 169.762 87.1989 169.762ZM103.027 173.153C103.027 174.359 102.795 175.368 102.331 176.178C101.872 176.984 101.205 177.592 100.331 178.002C99.4572 178.407 98.405 178.61 97.1745 178.61H94.1423V167.902H97.5041C98.6271 167.902 99.6013 168.102 100.426 168.503C101.252 168.898 101.891 169.486 102.345 170.268C102.8 171.044 103.027 172.006 103.027 173.153ZM100.668 173.212C100.668 172.421 100.551 171.772 100.317 171.264C100.087 170.751 99.7453 170.373 99.2912 170.129C98.842 169.884 98.2854 169.762 97.6213 169.762H96.4128V176.735H97.3869C98.4953 176.735 99.3181 176.44 99.8552 175.849C100.397 175.258 100.668 174.379 100.668 173.212Z",fill:"white"}),(0,t.createElement)("path",{d:"M109.158 77.28L99.015 120.75L87.745 77.28H82.915H78.085L66.815 120.75L56.672 77.28H47.334L61.019 132.02H71.323L82.915 87.101L94.507 132.02H104.811L118.496 77.28H109.158Z",fill:"white"})),r=(0,t.createElement)("svg",{width:"161",height:"205",viewBox:"0 0 161 205",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M123.763 9.01997L152.45 37.7071V192.06C152.45 193.208 151.994 194.31 151.182 195.122C150.37 195.934 149.268 196.39 148.12 196.39H12.88C11.7316 196.39 10.6302 195.934 9.81822 195.122L9.46466 195.475L9.81821 195.122C9.00618 194.31 8.54999 193.208 8.54999 192.06V13.35C8.54999 12.2016 9.00618 11.1002 9.81822 10.2882C10.6302 9.47617 11.7316 9.01997 12.88 9.01997H123.763Z",fill:"#1F7244",stroke:"#195B36"}),(0,t.createElement)("path",{opacity:"0.2",d:"M151.5 37.47H128.833C127.551 37.47 126.322 36.9783 125.416 36.1031C124.509 35.228 124 34.041 124 32.8033V9.96997L151.5 37.47Z",fill:"black"}),(0,t.createElement)("path",{d:"M68.5777 170.108C68.1431 170.108 67.7574 170.193 67.4204 170.364C67.0884 170.53 66.8077 170.772 66.5782 171.089C66.3536 171.407 66.1827 171.79 66.0655 172.239C65.9483 172.688 65.8897 173.194 65.8897 173.755C65.8897 174.512 65.9825 175.159 66.168 175.696C66.3584 176.228 66.6514 176.636 67.0469 176.919C67.4424 177.198 67.9527 177.337 68.5777 177.337C69.0122 177.337 69.4468 177.288 69.8814 177.19C70.3208 177.093 70.7969 176.953 71.3096 176.773V178.677C70.836 178.872 70.3697 179.012 69.9107 179.095C69.4517 179.182 68.9366 179.226 68.3653 179.226C67.2618 179.226 66.3536 178.999 65.6407 178.545C64.9327 178.086 64.4078 177.447 64.066 176.626C63.7242 175.801 63.5533 174.839 63.5533 173.741C63.5533 172.93 63.6631 172.188 63.8828 171.514C64.1026 170.84 64.4248 170.257 64.8496 169.764C65.2745 169.27 65.7994 168.89 66.4244 168.621C67.0494 168.352 67.7671 168.218 68.5777 168.218C69.1099 168.218 69.6421 168.286 70.1744 168.423C70.7115 168.555 71.2242 168.738 71.7124 168.973L70.98 170.818C70.5796 170.628 70.1768 170.462 69.7715 170.32C69.3662 170.179 68.9683 170.108 68.5777 170.108ZM79.7618 179.08H73.5948V168.372H79.7618V170.232H75.8653V172.583H79.4908V174.444H75.8653V177.205H79.7618V179.08ZM82.003 179.08V168.372H84.2735V177.205H88.6167V179.08H82.003ZM90.4844 179.08V168.372H92.7549V177.205H97.0982V179.08H90.4844Z",fill:"white"}),(0,t.createElement)("path",{d:"M84.9275 99.6943L103.04 72.92H94.185L80.5 93.1416L66.815 72.92H57.96L76.0725 99.6943L57.155 127.66H66.01L80.5 106.247L94.99 127.66H103.845L84.9275 99.6943Z",fill:"white"})),c=(0,t.createElement)("svg",{width:"161",height:"206",viewBox:"0 0 161 206",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M152.45 37.8027V192.557C152.45 193.709 151.993 194.813 151.181 195.628C150.369 196.442 149.268 196.899 148.12 196.899H12.88C11.732 196.899 10.6308 196.442 9.81867 195.628C9.0065 194.813 8.54999 193.709 8.54999 192.557V13.3834C8.54999 12.2313 9.0065 11.1266 9.81867 10.3123C10.6308 9.49806 11.732 9.04086 12.88 9.04086H123.762L152.45 37.8027Z",fill:"#DD682B",stroke:"#B15322"}),(0,t.createElement)("path",{opacity:"0.2",d:"M151.5 37.596H128.8C127.519 37.596 126.29 37.0858 125.385 36.1776C124.479 35.2695 123.97 34.0378 123.97 32.7535V9.97L151.5 37.596Z",fill:"black"}),(0,t.createElement)("path",{d:"M68.0131 176.528C68.0131 177.163 67.8593 177.714 67.5517 178.183C67.2441 178.652 66.7949 179.013 66.2041 179.267C65.6181 179.521 64.9052 179.648 64.0654 179.648C63.6943 179.648 63.3305 179.624 62.9741 179.575C62.6225 179.526 62.2832 179.455 61.956 179.362C61.6337 179.265 61.3261 179.145 61.0332 179.003V176.894C61.541 177.119 62.0683 177.321 62.6152 177.502C63.1621 177.683 63.7041 177.773 64.2412 177.773C64.6123 177.773 64.9101 177.724 65.1347 177.627C65.3642 177.529 65.5302 177.395 65.6328 177.224C65.7353 177.053 65.7866 176.857 65.7866 176.638C65.7866 176.369 65.6962 176.14 65.5156 175.949C65.3349 175.759 65.0859 175.581 64.7685 175.415C64.456 175.249 64.102 175.07 63.7065 174.88C63.4575 174.763 63.1865 174.621 62.8935 174.455C62.6005 174.284 62.3222 174.077 62.0585 173.833C61.7949 173.588 61.5776 173.293 61.4067 172.946C61.2407 172.595 61.1577 172.175 61.1577 171.687C61.1577 171.047 61.3042 170.5 61.5971 170.046C61.8901 169.592 62.3076 169.245 62.8496 169.006C63.3964 168.762 64.041 168.64 64.7832 168.64C65.3398 168.64 65.8696 168.706 66.3725 168.837C66.8803 168.964 67.4101 169.15 67.9619 169.394L67.2294 171.159C66.7363 170.959 66.2944 170.805 65.9038 170.698C65.5131 170.585 65.1152 170.529 64.7099 170.529C64.4267 170.529 64.185 170.576 63.9848 170.669C63.7846 170.756 63.6333 170.883 63.5307 171.049C63.4282 171.21 63.3769 171.398 63.3769 171.613C63.3769 171.867 63.4501 172.082 63.5966 172.258C63.748 172.429 63.9726 172.595 64.2705 172.756C64.5732 172.917 64.9492 173.105 65.3984 173.32C65.9453 173.579 66.4116 173.85 66.7973 174.133C67.1879 174.411 67.4882 174.741 67.6982 175.122C67.9082 175.498 68.0131 175.966 68.0131 176.528ZM69.9541 179.502V168.794H72.2246V177.627H76.5678V179.502H69.9541ZM78.4355 179.502V168.794H80.706V179.502H78.4355ZM92.2856 174.045C92.2856 175.251 92.0537 176.259 91.5898 177.07C91.1308 177.876 90.4643 178.483 89.5903 178.894C88.7163 179.299 87.664 179.502 86.4335 179.502H83.4013V168.794H86.7631C87.8862 168.794 88.8603 168.994 89.6855 169.394C90.5107 169.79 91.1503 170.378 91.6044 171.159C92.0585 171.936 92.2856 172.898 92.2856 174.045ZM89.9272 174.104C89.9272 173.313 89.81 172.663 89.5756 172.155C89.3461 171.643 89.0043 171.264 88.5502 171.02C88.101 170.776 87.5444 170.654 86.8803 170.654H85.6718V177.627H86.6459C87.7543 177.627 88.5771 177.331 89.1142 176.74C89.6562 176.149 89.9272 175.271 89.9272 174.104ZM100.672 179.502H94.5048V168.794H100.672V170.654H96.7753V173.005H100.401V174.865H96.7753V177.627H100.672V179.502Z",fill:"white"}),(0,t.createElement)("path",{d:"M80.5 111.848C87.332 111.848 93.8841 109.127 98.7151 104.283C103.546 99.44 106.26 92.8709 106.26 86.0212H80.5V60.1944C73.668 60.1944 67.1159 62.9154 62.2849 67.7589C57.454 72.6024 54.74 79.1715 54.74 86.0212C54.74 92.8709 57.454 99.44 62.2849 104.283C67.1159 109.127 73.668 111.848 80.5 111.848Z",fill:"white"}),(0,t.createElement)("path",{d:"M85.33 55.3519V81.1787H111.09C111.09 74.329 108.376 67.7598 103.545 62.9164C98.7141 58.0729 92.162 55.3519 85.33 55.3519Z",fill:"white"}),(0,t.createElement)("path",{d:"M120.75 144.131H40.25V147.36H120.75V144.131Z",fill:"white"}),(0,t.createElement)("path",{d:"M120.75 134.446H40.25V137.675H120.75V134.446Z",fill:"white"}),(0,t.createElement)("path",{d:"M120.75 124.761H40.25V127.99H120.75V124.761Z",fill:"white"})),d=(0,t.createElement)("svg",{width:"163",height:"205",viewBox:"0 0 163 205",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M154.4 37.126V192.087C154.4 193.371 153.888 194.603 152.977 195.511C152.065 196.419 150.829 196.929 149.54 196.929H13.46C12.171 196.929 10.9349 196.419 10.0234 195.511C9.11201 194.603 8.59998 193.371 8.59998 192.087V12.9134C8.59998 11.6291 9.11201 10.3974 10.0234 9.4892C10.9349 8.58105 12.171 8.07086 13.46 8.07086H125.24L154.4 37.126Z",fill:"#F8F8F8"}),(0,t.createElement)("path",{opacity:"0.2",d:"M125.24 8.07086H13.46C12.171 8.07086 10.9349 8.58105 10.0234 9.4892C9.11201 10.3974 8.59998 11.6291 8.59998 12.9134V192.087C8.59998 193.371 9.11201 194.603 10.0234 195.511C10.9349 196.419 12.171 196.929 13.46 196.929H149.54C150.829 196.929 152.065 196.419 152.977 195.511C153.888 194.603 154.4 193.371 154.4 192.087V37.126L125.24 8.07086ZM152.78 192.087C152.78 192.943 152.439 193.764 151.831 194.369C151.223 194.975 150.399 195.315 149.54 195.315H13.46C12.6007 195.315 11.7766 194.975 11.1689 194.369C10.5613 193.764 10.22 192.943 10.22 192.087V12.9134C10.22 12.0572 10.5613 11.236 11.1689 10.6306C11.7766 10.0252 12.6007 9.68504 13.46 9.68504H124.576L125.24 10.3468V32.2835C125.24 33.5678 125.752 34.7995 126.663 35.7076C127.575 36.6158 128.811 37.126 130.1 37.126H152.116L152.78 37.7878V192.087Z",fill:"black"}),(0,t.createElement)("g",{opacity:"0.2"},(0,t.createElement)("path",{opacity:"0.2",d:"M122 138.819H81.5V142.047H122V138.819Z",fill:"black"}),(0,t.createElement)("path",{opacity:"0.2",d:"M122 129.134H41V132.362H122V129.134Z",fill:"black"}),(0,t.createElement)("path",{opacity:"0.2",d:"M122 119.449H41V122.677H122V119.449Z",fill:"black"}),(0,t.createElement)("path",{opacity:"0.2",d:"M122 109.764H41V112.992H122V109.764Z",fill:"black"}),(0,t.createElement)("path",{opacity:"0.2",d:"M122 100.079H41V103.307H122V100.079Z",fill:"black"}),(0,t.createElement)("path",{opacity:"0.2",d:"M79.88 69.4094H41V72.6378H79.88V69.4094Z",fill:"black"}),(0,t.createElement)("path",{opacity:"0.2",d:"M71.78 59.7244H41V62.9527H71.78V59.7244Z",fill:"black"}))),h=window.wp.element,p={height:"500px"},w=(0,t.createElement)("svg",{width:"66",height:"60",viewBox:"0 0 66 60",fill:"black",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{opacity:"0.5",fillRule:"evenodd",clipRule:"evenodd",d:"M28.9406 59.2644L2.20792 46.9066C-0.0693069 45.8277 -0.0693069 44.1604 2.20792 43.1796L11.5148 38.8642L28.8416 46.9066C31.1188 47.9854 34.7822 47.9854 36.9604 46.9066L54.2871 38.8642L63.5941 43.1796C65.8713 44.2585 65.8713 45.9258 63.5941 46.9066L36.8614 59.2644C34.7822 60.2452 31.1188 60.2452 28.9406 59.2644Z",fill:"black"}),(0,t.createElement)("path",{opacity:"0.75",fillRule:"evenodd",clipRule:"evenodd",d:"M28.9406 44.0606L2.20792 31.7028C-0.069307 30.6239 -0.069307 28.9566 2.20792 27.9758L11.3168 23.7584L28.9406 31.8989C31.2178 32.9778 34.8812 32.9778 37.0594 31.8989L54.6832 23.7584L63.7921 27.9758C66.0693 29.0547 66.0693 30.722 63.7921 31.7028L37.0594 44.0606C34.7822 45.1395 31.1188 45.1395 28.9406 44.0606Z",fill:"black"}),(0,t.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.9406 29.2518L2.20792 16.8939C-0.069307 15.8151 -0.069307 14.1478 2.20792 13.167L28.9406 0.809144C31.2178 -0.269715 34.8812 -0.269715 37.0594 0.809144L63.7921 13.167C66.0693 14.2458 66.0693 15.9132 63.7921 16.8939L37.0594 29.2518C34.7822 30.2325 31.1188 30.2325 28.9406 29.2518Z",fill:"black"}));(0,l.registerBlockType)(n.UU,{icon:w,edit:({attributes:e,setAttributes:l})=>{const[n,h]=(0,t.useState)(null),w=["core/bold","core/image","core/italic","core/strikethrough","core/text-color","core/code","core/keyboard","core/subscript","core/superscript"];let s=[];const m=[{label:(0,o.__)("Embedded","onlyoffice-plugin"),value:"embedded"},{label:(0,o.__)("Link"),value:"link"}];(0,t.useEffect)((()=>{e.id&&ONLYOFFICE.formatsUtils.getFileName(e.id).then((e=>{const t=ONLYOFFICE.formatsUtils.getDocumentType(e);h(t)}))}),[e.id]),e.hasOwnProperty("width")&&e.width.length>0&&(p.width=e.width),e.hasOwnProperty("height")&&e.height.length>0&&(p.height=e.height);let H=!0;"full"===e.align&&(delete p.width,H=!1);const f=function(e){var t=ONLYOFFICE.mimeTypes;if(void 0!==t[e])return t[e];for(var l in t)if(-1!==l.indexOf(e))return t[l];return!1};for(let e of ONLYOFFICE.formatsUtils.getViewableExtensions()){let t=f(e);t&&s.push(t)}const u="link"!==e.documentView&&e.id?(0,i.useBlockProps)({style:p}):(0,i.useBlockProps)({style:null});return(0,t.createElement)("div",{...u},e.id?(0,t.createElement)(t.Fragment,null,(0,t.createElement)(i.InspectorControls,{key:"setting"},(0,t.createElement)(a.PanelBody,{title:(0,o.__)("Settings")},(0,t.createElement)(a.__experimentalInputControl,{label:(0,o.__)("Name"),value:e.fileName,onChange:e=>l({fileName:e})}),(0,t.createElement)(a.SelectControl,{label:(0,o.__)("Document view","onlyoffice-plugin"),value:e.documentView,options:m,onChange:e=>{l({documentView:e})}}),"link"===e.documentView?(0,t.createElement)("div",null,(0,t.createElement)(a.ToggleControl,{checked:e.inNewTab,label:(0,o.__)("Open in new tab"),onChange:e=>l({inNewTab:e})}),(0,t.createElement)(a.ToggleControl,{checked:e.showOpenButton,label:(0,o.__)("Show Open in ONLYOFFICE button","onlyoffice-plugin"),onChange:e=>l({showOpenButton:e})})):(0,t.createElement)("div",null,H?(0,t.createElement)(i.HeightControl,{label:(0,o.__)("Width","onlyoffice-docspace-plugin"),value:e.width,onChange:e=>l({width:e})}):"",(0,t.createElement)(i.HeightControl,{label:(0,o.__)("Height","onlyoffice-docspace-plugin"),value:e.height,onChange:e=>l({height:e})})))),"link"===e.documentView?(0,t.createElement)("div",null,(0,t.createElement)(i.RichText,{tagName:"a",allowedFormats:w,onChange:e=>l({fileName:e}),value:e.fileName}),e.showOpenButton?(0,t.createElement)("div",{class:"wp-block-onlyoffice-wordpress-onlyoffice__button-richtext-wrapper"},(0,t.createElement)(i.RichText,{tagName:"div",className:"wp-element-button",value:e.openButtonText||(0,o.__)("Open in ONLYOFFICE","onlyoffice-plugin"),allowedFormats:w,onChange:e=>l({openButtonText:e}),placeholder:(0,o.__)("Add text...")})):""):(0,t.createElement)("div",{className:`wp-block-onlyoffice-wordpress-onlyoffice__embedded ${n}`},(0,t.createElement)("div",null,(e=>{switch(e){case"word":return C;case"cell":return r;case"slide":return c;default:return d}})(n),(0,t.createElement)("p",null," ",n?e.fileName||"":(0,o.__)("File not found!","onlyoffice-plugin")))),(0,t.createElement)(i.BlockControls,{group:"other"},(0,t.createElement)(i.MediaReplaceFlow,{mediaId:e.id,allowedTypes:s,accept:s.join(),onSelect:e=>{e&&e.hasOwnProperty("id")&&l({id:e.id,fileName:e.filename||e.guid.raw.substring(e.guid.raw.lastIndexOf("/")+1)})},name:(0,o.__)("Replace")}))):(0,t.createElement)(i.MediaPlaceholder,{labels:{title:"ONLYOFFICE Docs"},allowedTypes:s,accept:s.join(),onSelect:e=>{e&&e.hasOwnProperty("id")&&l({id:e.id,fileName:e.filename||e.guid.raw.substring(e.guid.raw.lastIndexOf("/")+1)})}}))},save:({attributes:e})=>{if(!e.id)return"";let l="";return e.hasOwnProperty("id")&&(l+="id="+e.id+" "),e.hasOwnProperty("documentView")&&e.documentView.length>0&&(l+="documentView="+e.documentView+" "),e.hasOwnProperty("inNewTab")&&(l+="inNewTab="+e.inNewTab+" "),e.hasOwnProperty("align")&&e.align.length>0&&(l+="align="+e.align+" "),e.hasOwnProperty("width")&&e.width.length>0&&(l+="width="+e.width+" "),e.hasOwnProperty("height")&&e.height.length>0&&(l+="height="+e.height+" "),e.hasOwnProperty("showOpenButton")&&(l+="showOpenButton="+e.showOpenButton+" "),e.hasOwnProperty("openButtonText")&&e.openButtonText.length>0&&(l+="openButtonText="+e.openButtonText+" "),(0,t.createElement)(h.RawHTML,null,`[onlyoffice ${l} /]`)}})})(); -
onlyoffice/trunk/onlyoffice-wordpress-block/src/edit.js
r2976437 r3070758 1 1 /* 2 * (c) Copyright Ascensio System SIA 202 32 * (c) Copyright Ascensio System SIA 2024 3 3 * 4 4 * This program is free software; you can redistribute it and/or … … 23 23 MediaReplaceFlow, 24 24 InspectorControls, 25 RichText, 26 HeightControl 25 27 } from '@wordpress/block-editor'; 26 28 import { 27 29 PanelBody, 30 ToggleControl, 31 SelectControl, 28 32 __experimentalInputControl as InputControl 29 33 } from '@wordpress/components'; … … 31 35 import { blockStyle } from "./index"; 32 36 import { __ } from '@wordpress/i18n'; 37 import { useState, useEffect } from 'react'; 38 import { getLogoByDocumentType } from "./logos"; 33 39 34 40 const Edit = ({attributes, setAttributes}) => { 35 const onlyofficeAllowedExts = oo_media.formats; 41 const [documentType, setDocumentType] = useState(null); 42 43 const richTextAllowedFormats = [ 'core/bold', 'core/image', 'core/italic', 'core/strikethrough', 'core/text-color', 'core/code', 'core/keyboard' , 'core/subscript', 'core/superscript' ]; 36 44 let onlyofficeAllowedMimes = []; 45 const viewOptions = [ 46 { 47 label: __('Embedded', 'onlyoffice-plugin'), 48 value: 'embedded' 49 }, 50 { 51 label: __('Link'), 52 value: 'link' 53 } 54 ]; 55 56 useEffect(() => { 57 if (attributes.id) { 58 ONLYOFFICE.formatsUtils.getFileName(attributes.id).then((fileName) => { 59 const documentType = ONLYOFFICE.formatsUtils.getDocumentType(fileName); 60 setDocumentType(documentType); 61 }); 62 } 63 }, [attributes.id]); 64 65 if (attributes.hasOwnProperty('width') && attributes.width.length > 0) { 66 blockStyle.width = attributes.width; 67 } 68 69 if (attributes.hasOwnProperty('height') && attributes.height.length > 0) { 70 blockStyle.height = attributes.height; 71 } 72 73 let showWidthControl = true; 74 75 if (attributes.align === "full") { 76 delete blockStyle.width; 77 showWidthControl = false; 78 } 37 79 38 80 const getMimeType = function( name ) { 39 var allTypes = oo_media.mimeTypes;81 var allTypes = ONLYOFFICE.mimeTypes; 40 82 41 83 if (allTypes[name] !== undefined) { … … 52 94 }; 53 95 54 for (let ext of onlyofficeAllowedExts) {96 for (let ext of ONLYOFFICE.formatsUtils.getViewableExtensions()) { 55 97 let mimeType = getMimeType(ext); 56 98 … … 60 102 } 61 103 62 const blockProps = useBlockProps( { style: blockStyle } );104 const blockProps = attributes.documentView === 'link' || ! attributes.id ? useBlockProps( { style: null } ) : useBlockProps( { style: blockStyle } ); 63 105 return ( 64 attributes.id ? 65 <div {...blockProps}> 106 <div {...blockProps}> 107 {attributes.id ? 108 <> 66 109 <InspectorControls key="setting"> 67 110 <PanelBody title={__('Settings')}> 68 111 <InputControl label={__('Name')} value={attributes.fileName} onChange={ ( value ) => setAttributes({ fileName: value }) } /> 112 <SelectControl 113 label={__('Document view', 'onlyoffice-plugin')} 114 value={attributes.documentView} 115 options={viewOptions} 116 onChange={(value) => {setAttributes({ documentView: value })}} 117 /> 118 { 119 attributes.documentView === 'link' ? 120 <div> 121 <ToggleControl 122 checked={attributes.inNewTab} 123 label={__('Open in new tab')} 124 onChange={(value) => setAttributes({ inNewTab: value })} 125 /> 126 <ToggleControl 127 checked={attributes.showOpenButton} 128 label={__('Show Open in ONLYOFFICE button', 'onlyoffice-plugin')} 129 onChange={(value) => setAttributes({ showOpenButton: value })} 130 /> 131 </div> 132 : 133 <div> 134 { 135 showWidthControl ? 136 <HeightControl label={ __("Width", "onlyoffice-docspace-plugin") } value={attributes.width} onChange={ ( value ) => setAttributes({ width: value }) }/> 137 : 138 '' 139 } 140 <HeightControl label={ __("Height", "onlyoffice-docspace-plugin") } value={attributes.height} onChange={ ( value ) => setAttributes({ height: value }) }/> 141 </div> 142 } 69 143 </PanelBody> 70 144 </InspectorControls> 71 145 72 <p style={{display: 'flex'}}> 73 {onlyofficeIcon} 74 <p style={{marginLeft: '25px'}}> {attributes.fileName || ""}</p> 75 </p> 76 <BlockControls> 146 { 147 attributes.documentView === 'link' ? 148 <div> 149 <RichText 150 tagName="a" 151 allowedFormats={ richTextAllowedFormats } 152 onChange={ ( value ) => setAttributes({ fileName: value }) } 153 value={ attributes.fileName } 154 /> 155 { 156 attributes.showOpenButton ? 157 <div class="wp-block-onlyoffice-wordpress-onlyoffice__button-richtext-wrapper"> 158 <RichText 159 tagName="div" 160 className = {'wp-element-button'} 161 value= { attributes.openButtonText || __('Open in ONLYOFFICE', 'onlyoffice-plugin') } 162 allowedFormats={ richTextAllowedFormats } 163 onChange={ ( openButtonText ) => setAttributes( { openButtonText } ) } 164 placeholder={ __('Add text...') } 165 /> 166 </div> 167 : 168 '' 169 } 170 </div> 171 172 : 173 <div className={ `wp-block-onlyoffice-wordpress-onlyoffice__embedded ${documentType}`}> 174 <div> 175 {getLogoByDocumentType(documentType)} 176 <p> {documentType ? attributes.fileName || "" : __('File not found!', 'onlyoffice-plugin')}</p> 177 </div> 178 </div> 179 } 180 181 <BlockControls group="other"> 77 182 <MediaReplaceFlow 78 183 mediaId={ attributes.id } … … 87 192 /> 88 193 </BlockControls> 89 </ div>194 </> 90 195 : 91 196 <MediaPlaceholder 92 labels={{title: 'ONLYOFFICE '}}197 labels={{title: 'ONLYOFFICE Docs'}} 93 198 allowedTypes={onlyofficeAllowedMimes} 94 199 accept={onlyofficeAllowedMimes.join()} … … 99 204 }} 100 205 /> 206 } 207 </div> 101 208 ) 102 209 }; -
onlyoffice/trunk/onlyoffice-wordpress-block/src/index.js
r2976437 r3070758 1 1 /* 2 * (c) Copyright Ascensio System SIA 202 32 * (c) Copyright Ascensio System SIA 2024 3 3 * 4 4 * This program is free software; you can redistribute it and/or … … 19 19 import { registerBlockType } from '@wordpress/blocks'; 20 20 21 import "./styles.css" 22 21 23 import block from '../block.json'; 22 24 import edit from './edit'; … … 24 26 25 27 export const blockStyle = { 26 padding: '20px',28 height: '500px', 27 29 }; 28 30 -
onlyoffice/trunk/onlyoffice-wordpress-block/src/save.js
r2976437 r3070758 1 1 /* 2 * (c) Copyright Ascensio System SIA 202 32 * (c) Copyright Ascensio System SIA 2024 3 3 * 4 4 * This program is free software; you can redistribute it and/or … … 20 20 21 21 const Save = ( { attributes } ) => { 22 return <RawHTML>{ `[onlyoffice id=${ attributes.id } /]` }</RawHTML>; 22 if ( !attributes.id ) { 23 return ''; 24 } 25 26 let parameters = ''; 27 28 if ( attributes.hasOwnProperty('id')) { 29 parameters += 'id=' + attributes.id + ' '; 30 } 31 32 if ( attributes.hasOwnProperty('documentView') && attributes.documentView.length > 0 ) { 33 parameters += 'documentView=' + attributes.documentView + ' '; 34 } 35 36 if ( attributes.hasOwnProperty('inNewTab')) { 37 parameters += 'inNewTab=' + attributes.inNewTab + ' '; 38 } 39 40 if ( attributes.hasOwnProperty('align') && attributes.align.length > 0 ) { 41 parameters += 'align=' + attributes.align + ' '; 42 } 43 44 if ( attributes.hasOwnProperty('width') && attributes.width.length > 0 ) { 45 parameters += 'width=' + attributes.width + ' '; 46 } 47 48 if ( attributes.hasOwnProperty('height') && attributes.height.length > 0 ) { 49 parameters += 'height=' + attributes.height + ' '; 50 } 51 52 if ( attributes.hasOwnProperty('showOpenButton') ) { 53 parameters += 'showOpenButton=' + attributes.showOpenButton + ' '; 54 } 55 56 if ( attributes.hasOwnProperty('openButtonText') && attributes.openButtonText.length > 0 ) { 57 parameters += 'openButtonText=' + attributes.openButtonText + ' '; 58 } 59 60 return <RawHTML>{ `[onlyoffice ${ parameters } /]` }</RawHTML>; 23 61 }; 24 62 export default Save; -
onlyoffice/trunk/onlyoffice-wordpress.php
r2976437 r3070758 5 5 * @package Onlyoffice_Plugin 6 6 * 7 * Plugin Name: ONLYOFFICE 7 * Plugin Name: ONLYOFFICE Docs 8 8 * Plugin URI: https://github.com/ONLYOFFICE/onlyoffice-wordpress 9 * Description: Add ONLYOFFICE editor on page10 * Version: 1.1.09 * Description: Add ONLYOFFICE Docs blocks to posts to allow your site visitors to view the inserted file without downloading. Edit and collaborate on office documents from the admin dashboard. 10 * Version: 2.0.0 11 11 * Requires at least: 5.7 12 12 * Requires PHP: 7.4 … … 21 21 /** 22 22 * 23 * (c) Copyright Ascensio System SIA 202 323 * (c) Copyright Ascensio System SIA 2024 24 24 * 25 25 * This program is free software; you can redistribute it and/or … … 41 41 * Currently plugin version. 42 42 */ 43 define( 'ONLYOFFICE_PLUGIN_VERSION', '1.1.0' ); 43 define( 'ONLYOFFICE_PLUGIN_NAME', 'onlyoffice-plugin' ); 44 define( 'ONLYOFFICE_PLUGIN_VERSION', '2.0.0' ); 44 45 define( 'ONLYOFFICE_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 46 define( 'ONLYOFFICE_PLUGIN_FILE', __FILE__ ); 45 47 46 48 … … 66 68 */ 67 69 function uninstall_onlyoffice_wordpress_plugin() { 68 delete_option( 'onlyoffice_settings' ); 69 delete_option( 'onlyoffice-plugin-uuid' ); 70 delete_option( 'onlyoffice-plugin-bytes' ); 70 delete_site_option( 'onlyoffice_settings' ); 71 delete_site_option( 'onlyoffice-plugin-uuid' ); 72 delete_site_option( 'onlyoffice-plugin-bytes' ); 73 delete_site_option( 'onlyoffice-formats' ); 71 74 } 72 75 … … 99 102 100 103 /** 101 * Data about additional ONLYOFFICE formats.104 * Data about additional ONLYOFFICE Docs formats. 102 105 * 103 106 * @since 2.0.0 … … 107 110 */ 108 111 function onlyoffice_forms_mime_types( $mimes ) { 109 $mimes['oform'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document.oform';110 112 $mimes['docxf'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf'; 111 113 … … 127 129 $ext = pathinfo( $filename, PATHINFO_EXTENSION ); 128 130 switch ( $ext ) { 129 case 'oform':130 $data['ext'] = 'oform';131 $data['type'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document.oform';132 break;133 131 case 'docxf': 134 132 $data['ext'] = 'docxf'; -
onlyoffice/trunk/public/assets/document-formats/CHANGELOG.md
r2976437 r3070758 1 1 # Change Log 2 2 3 ## 4 - fb2 additional mime 5 6 ## 1.1.0 7 - filling pdf 3 8 - conversion formats for txt, csv 4 9 - formats for auto conversion -
onlyoffice/trunk/public/assets/document-formats/onlyoffice-docs-formats.json
r2976437 r3070758 32 32 "type": "word", 33 33 "actions": ["view", "edit"], 34 "convert": ["docx", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "o form", "ott", "pdf", "pdfa", "png", "rtf", "txt"],34 "convert": ["docx", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"], 35 35 "mime": ["application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf"] 36 36 }, … … 68 68 "actions": ["view", "lossy-edit", "auto-convert"], 69 69 "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "gif", "html", "jpg", "odt", "ott", "pdf", "pdfa", "png", "rtf", "txt"], 70 "mime": ["text/fb2+xml" ]70 "mime": ["text/fb2+xml", "application/x-fictionbook+xml"] 71 71 }, 72 72 { … … 115 115 "name": "oform", 116 116 "type": "word", 117 "actions": ["view" , "fill"],117 "actions": ["view"], 118 118 "convert": ["pdf"], 119 119 "mime": ["application/vnd.openxmlformats-officedocument.wordprocessingml.document.oform"] … … 136 136 "name": "pdf", 137 137 "type": "word", 138 "actions": ["view" ],138 "actions": ["view", "fill"], 139 139 "convert": ["docx", "docxf", "bmp", "docm", "dotm", "dotx", "epub", "fb2", "gif", "html", "jpg", "odt", "ott", "pdfa", "png", "rtf", "txt"], 140 140 "mime": ["application/pdf", "application/acrobat", "application/nappdf", "application/x-pdf", "image/pdf"] … … 398 398 "convert": ["pptx", "bmp", "gif", "jpg", "odp", "otp", "pdf", "pdfa", "png", "potm", "potx", "ppsm", "ppsx", "pptm"], 399 399 "mime": ["application/vnd.sun.xml.impress"] 400 }, 401 { 402 "name": "bmp", 403 "type": "", 404 "actions": [], 405 "convert": [], 406 "mime": ["image/bmp"] 407 }, 408 { 409 "name": "gif", 410 "type": "", 411 "actions": [], 412 "convert": [], 413 "mime": ["image/gif"] 414 }, 415 { 416 "name": "jpg", 417 "type": "", 418 "actions": [], 419 "convert": [], 420 "mime": ["image/jpeg"] 421 }, 422 { 423 "name": "pdfa", 424 "type": "", 425 "actions": [], 426 "convert": [], 427 "mime": ["application/pdf", "application/acrobat", "application/nappdf", "application/x-pdf", "image/pdf"] 428 }, 429 { 430 "name": "png", 431 "type": "", 432 "actions": [], 433 "convert": [], 434 "mime": ["image/png"] 435 }, 436 { 437 "name": "zip", 438 "type": "", 439 "actions": [], 440 "convert": [], 441 "mime": ["application/zip"] 400 442 } 401 443 ] -
onlyoffice/trunk/public/class-onlyoffice-plugin-public.php
r2976437 r3070758 12 12 /** 13 13 * 14 * (c) Copyright Ascensio System SIA 202 314 * (c) Copyright Ascensio System SIA 2024 15 15 * 16 16 * This program is free software; you can redistribute it and/or … … 42 42 43 43 /** 44 * The ID of this plugin.45 *46 * @since 1.0.047 * @access private48 * @var string $plugin_name The ID of this plugin.49 */50 private $plugin_name;51 52 /**53 * The version of this plugin.54 *55 * @since 1.0.056 * @access private57 * @var string $version The current version of this plugin.58 */59 private $version;60 61 /**62 * Initialize the class and set its properties.63 *64 * @since 1.0.065 * @param string $plugin_name The name of the plugin.66 * @param string $version The version of this plugin.67 */68 public function __construct( $plugin_name, $version ) {69 $this->plugin_name = $plugin_name;70 $this->version = $version;71 }72 73 /**74 44 * Register the stylesheets for the public-facing side of the site. 75 45 * … … 95 65 require_once plugin_dir_path( __FILE__ ) . 'views/class-onlyoffice-plugin-callback.php'; 96 66 require_once plugin_dir_path( __FILE__ ) . 'views/class-onlyoffice-plugin-download.php'; 97 require_once plugin_dir_path( __FILE__ ) . 'views/class-onlyoffice-plugin-editor.php';98 67 99 68 $callback = new Onlyoffice_Plugin_Callback(); 100 69 $download = new Onlyoffice_Plugin_Download(); 101 $editor = new Onlyoffice_Plugin_Editor();102 70 103 71 // "oo."-prefix is needed to keep the connector working in conjunction with the plugin "Force Lowercase URLs" 104 72 // (https://wordpress.org/plugins/force-lowercase-urls/) 105 106 register_rest_route(107 'onlyoffice',108 '/oo.editor/(?P<id>[^\/\n\r]+)',109 array(110 'methods' => WP_REST_Server::READABLE,111 'callback' => array( $editor, 'editor' ),112 'permission_callback' => array( $this, 'check_attachment_id' ),113 )114 );115 73 116 74 register_rest_route( -
onlyoffice/trunk/public/views/class-onlyoffice-plugin-callback.php
r2976437 r3070758 12 12 /** 13 13 * 14 * (c) Copyright Ascensio System SIA 202 314 * (c) Copyright Ascensio System SIA 2024 15 15 * 16 16 * This program is free software; you can redistribute it and/or … … 113 113 $param = urldecode( str_replace( ',', '%', $req->get_params()['id'] ) ); 114 114 115 $attachemnt_id = intval( Onlyoffice_Plugin_Url_Manager::decode_openssl_data( $param, get_ option( 'onlyoffice-plugin-uuid' ) ) );115 $attachemnt_id = intval( Onlyoffice_Plugin_Url_Manager::decode_openssl_data( $param, get_site_option( 'onlyoffice-plugin-uuid' ) ) ); 116 116 $user_id = isset( $body['actions'] ) ? $body['actions'][0]['userid'] : null; 117 117 … … 136 136 break; 137 137 case 'MustSave': 138 $can_edit = Onlyoffice_Plugin_Document_Manager:: has_edit_capability( $attachemnt_id );138 $can_edit = Onlyoffice_Plugin_Document_Manager::can_user_edit_attachment( $attachemnt_id ); 139 139 if ( ! $can_edit ) { 140 140 wp_die( 'No edit capability', '', array( 'response' => 403 ) ); -
onlyoffice/trunk/public/views/class-onlyoffice-plugin-download.php
r2976437 r3070758 12 12 /** 13 13 * 14 * (c) Copyright Ascensio System SIA 202 314 * (c) Copyright Ascensio System SIA 2024 15 15 * 16 16 * This program is free software; you can redistribute it and/or … … 43 43 * @param array $req The request. 44 44 * 45 * @return void 45 * @return void|WP_Error 46 46 */ 47 47 public function get_file( $req ) { 48 global $wp_filesystem; 48 49 49 50 if ( Onlyoffice_Plugin_JWT_Manager::is_jwt_enabled() ) { … … 91 92 } 92 93 93 $filepath = get_attached_file( $attachment_id ); 94 if ( ! function_exists( 'WP_Filesystem' ) ) { 95 include ABSPATH . '/wp-admin/includes/file.php'; 96 } 94 97 95 header( 'Content-Length: ' . filesize( $filepath ) );96 header( 'Content-Disposition: attachment; filename*=UTF-8\'\'' . urldecode( basename( $filepath ) ));97 header( 'Content-Type: ' . Onlyoffice_Plugin_Document_Manager::get_mime_type( $filepath ) );98 if ( ! WP_Filesystem() ) { 99 return new WP_Error( 'filesystem_error', 'Unable to initialize the filesystem.' ); 100 } 98 101 99 readfile( $filepath ); 100 flush(); 101 exit; 102 $file_path = get_attached_file( $attachment_id ); 103 104 if ( $wp_filesystem->is_file( $file_path ) ) { 105 header( 'Content-Length: ' . filesize( $file_path ) ); 106 header( 'Content-Disposition: attachment; filename*=UTF-8\'\'' . urldecode( basename( $file_path ) ) ); 107 header( 'Content-Type: ' . Onlyoffice_Plugin_Document_Manager::get_mime_type( $file_path ) ); 108 109 $file_content = $wp_filesystem->get_contents( $file_path ); 110 echo $file_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 111 112 exit; 113 } else { 114 return new WP_Error( 'file_not_found', 'File not found.' ); 115 } 102 116 } 103 117 } -
onlyoffice/trunk/readme.txt
r2976437 r3070758 1 === ONLYOFFICE ===1 === ONLYOFFICE Docs === 2 2 Contributors: onlyoffice 3 Tags: onlyoffice, integration, collaboration, editor, office, document, spreadsheet, presentation3 Tags: onlyoffice, collaboration, editor, office, document, spreadsheet, presentation, forms, pdf 4 4 Requires at least: 5.7 5 5 Tested up to: 6.1 6 Stable tag: 1.1.06 Stable tag: 2.0.0 7 7 Requires PHP: 7.4 8 8 License: GPLv2 9 9 License URI: https://github.com/ONLYOFFICE/onlyoffice-wordpress/blob/main/LICENSE 10 10 11 ONLYOFFICE plugin allows users to edit and view office documents from WordPress using ONLYOFFICE Docs.11 ONLYOFFICE Docs plugin allows users to edit and view office documents from WordPress using ONLYOFFICE Docs. 12 12 13 13 == Description == 14 14 15 ONLYOFFICE integration plugin allows WordPress administrators to open documents, spreadsheets, and presentations for collaborative editing using ONLYOFFICE Docs (online document editors). In published posts, the editors are visible to all WordPress site visitors (both authorized and unauthorized) in the Embedded mode only.15 ONLYOFFICE Docs integration plugin allows WordPress administrators to open documents, spreadsheets, and presentations for collaborative editing using ONLYOFFICE Docs (online document editors). In published posts, the editors are visible to all WordPress site visitors (both authorized and unauthorized) in the Embedded mode only. 16 16 17 17 **Editing files uploaded to Wordpress** 18 18 19 All uploaded files from the Media section will appear on the ONLYOFFICE -> Files page. The editor opens in the same tab by clicking on the file name. Users with administrator rights are able to co-edit documents. All the changes are saved in the same file.19 All uploaded files from the Media section will appear on the ONLYOFFICE Docs -> Files page. The editor opens in the same tab by clicking on the file name. Users with administrator rights are able to co-edit documents. All the changes are saved in the same file. 20 20 21 21 **Creating a post** 22 22 23 When creating a post, you can add the ONLYOFFICE element (block) and then upload a new file or select one from the Media Library. The added file will be displayed as the ONLYOFFICE logo with the file name in the currently edited post. After the post is published (when you press the Publish or Update button), your WordPress site visitors will have access to this file for viewing in the Embedded mode.23 When creating a post, you can add the ONLYOFFICE Docs element (block) and then upload a new file or select one from the Media Library. The added file will be displayed as the ONLYOFFICE logo with the file name in the currently edited post. After the post is published (when you press the Publish or Update button), your WordPress site visitors will have access to this file for viewing in the Embedded mode. 24 24 25 25 == Frequently Asked Questions == … … 31 31 = How to configure the plugin? = 32 32 33 Go to WordPress administrative dashboard -> ONLYOFFICE -> Settings. Specify the URL of the installed ONLYOFFICE Document Server and the Secret key.33 Go to WordPress administrative dashboard -> ONLYOFFICE Docs -> Settings. Specify the URL of the installed ONLYOFFICE Document Server and the Secret key. 34 34 35 35 Please note: Starting from version 7.2 of ONLYOFFICE Docs, JWT is enabled by default and the secret key is generated automatically to restrict the access to ONLYOFFICE Docs and for security reasons and data integrity. Specify your own secret key in the WordPress administrative configuration. In the ONLYOFFICE Docs [config file](https://api.onlyoffice.com/editors/signature/), specify the same secret key and enable the validation. … … 41 41 == Screenshots == 42 42 43 1. ONLYOFFICE plugin configuration settings within the WordPress administrative dashboard.44 2. ONLYOFFICE -> Files page within the WordPress administrative dashboard.45 3. ONLYOFFICE documenteditor opened from the WordPress admin dashboard.46 4. Adding ONLYOFFICE block when creating a post.47 5. Uploading a new file or selecting one from the Media Library to the ONLYOFFICE block.43 1. ONLYOFFICE Docs plugin configuration settings within the WordPress administrative dashboard. 44 2. ONLYOFFICE Docs -> Files page within the WordPress administrative dashboard. 45 3. ONLYOFFICE Docs editor opened from the WordPress admin dashboard. 46 4. Adding ONLYOFFICE Docs block when creating a post. 47 5. Uploading a new file or selecting one from the Media Library to the ONLYOFFICE Docs block. 48 48 6. Added file displayed as the ONLYOFFICE logo with the file name in the currently edited post. 49 49 7. ONLYOFFICE file available for viewing in the Embedded mode to the WordPress site visitors. 50 50 51 51 == Changelog == 52 = 2.0.0 = 53 * multisite support 54 * stub for onlyoffice-wordpress-block that displays error information if the document server is not accessible or the file is not found 55 * settings for onlyoffice block (width, height, align, show open in onlyoffice button) 56 * button copy link to editor, in the table with files 57 * ability to insert a link to the editor on the page 58 * access for an anonymous user, open the document for viewing in the editor if the document is attached to a public post 59 * filling pdf 60 * editor url 61 * displaying the onlyoffice-wordpress-block component in the Gutenberg editor 62 * remove filling for oform 63 * supported formats updated 64 65 = 1.1.0 = 66 * extended list of supported formats 67 * support docxf and oform formats 68 * support for the connector to work in conjunction with the plugin "Force Lowercase URLs" (https://wordpress.org/plugins/force-lowercase-urls) 69 * setting authorization header 70 * compatible with classic editor TinyMCE 71 * Link to docs cloud 52 72 53 73 = 1.0.2 = … … 65 85 * set favicon on editor page 66 86 * added goBack url for document editor 67 68 == Upgrade Notice ==69 70 = 1.0 =71 This is the first version of the plugin. -
onlyoffice/trunk/vendor/autoload.php
r2976472 r3070758 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInit 38bfbb3e5772cda36e94ef9ca1a3fa4f::getLoader();25 return ComposerAutoloaderInit233fba0d7a41b0f5c532bee7586a2e7b::getLoader(); -
onlyoffice/trunk/vendor/composer/autoload_real.php
r2976472 r3070758 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 38bfbb3e5772cda36e94ef9ca1a3fa4f5 class ComposerAutoloaderInit233fba0d7a41b0f5c532bee7586a2e7b 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit 38bfbb3e5772cda36e94ef9ca1a3fa4f', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInit233fba0d7a41b0f5c532bee7586a2e7b', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInit 38bfbb3e5772cda36e94ef9ca1a3fa4f', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit233fba0d7a41b0f5c532bee7586a2e7b', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit 38bfbb3e5772cda36e94ef9ca1a3fa4f::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInit233fba0d7a41b0f5c532bee7586a2e7b::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
onlyoffice/trunk/vendor/composer/autoload_static.php
r2976472 r3070758 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 38bfbb3e5772cda36e94ef9ca1a3fa4f7 class ComposerStaticInit233fba0d7a41b0f5c532bee7586a2e7b 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 28 28 { 29 29 return \Closure::bind(function () use ($loader) { 30 $loader->prefixLengthsPsr4 = ComposerStaticInit 38bfbb3e5772cda36e94ef9ca1a3fa4f::$prefixLengthsPsr4;31 $loader->prefixDirsPsr4 = ComposerStaticInit 38bfbb3e5772cda36e94ef9ca1a3fa4f::$prefixDirsPsr4;32 $loader->classMap = ComposerStaticInit 38bfbb3e5772cda36e94ef9ca1a3fa4f::$classMap;30 $loader->prefixLengthsPsr4 = ComposerStaticInit233fba0d7a41b0f5c532bee7586a2e7b::$prefixLengthsPsr4; 31 $loader->prefixDirsPsr4 = ComposerStaticInit233fba0d7a41b0f5c532bee7586a2e7b::$prefixDirsPsr4; 32 $loader->classMap = ComposerStaticInit233fba0d7a41b0f5c532bee7586a2e7b::$classMap; 33 33 34 34 }, null, ClassLoader::class); -
onlyoffice/trunk/vendor/composer/installed.json
r2976472 r3070758 3 3 { 4 4 "name": "firebase/php-jwt", 5 "version": "v6. 9.0",6 "version_normalized": "6. 9.0.0",5 "version": "v6.10.0", 6 "version_normalized": "6.10.0.0", 7 7 "source": { 8 8 "type": "git", 9 9 "url": "https://github.com/firebase/php-jwt.git", 10 "reference": " f03270e63eaccf3019ef0f32849c497385774e11"10 "reference": "a49db6f0a5033aef5143295342f1c95521b075ff" 11 11 }, 12 12 "dist": { 13 13 "type": "zip", 14 "url": "https://api.github.com/repos/firebase/php-jwt/zipball/ f03270e63eaccf3019ef0f32849c497385774e11",15 "reference": " f03270e63eaccf3019ef0f32849c497385774e11",14 "url": "https://api.github.com/repos/firebase/php-jwt/zipball/a49db6f0a5033aef5143295342f1c95521b075ff", 15 "reference": "a49db6f0a5033aef5143295342f1c95521b075ff", 16 16 "shasum": "" 17 17 }, … … 31 31 "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" 32 32 }, 33 "time": "2023-1 0-05T00:24:42+00:00",33 "time": "2023-12-01T16:26:39+00:00", 34 34 "type": "library", 35 35 "installation-source": "dist", … … 63 63 "support": { 64 64 "issues": "https://github.com/firebase/php-jwt/issues", 65 "source": "https://github.com/firebase/php-jwt/tree/v6. 9.0"65 "source": "https://github.com/firebase/php-jwt/tree/v6.10.0" 66 66 }, 67 67 "install-path": "../firebase/php-jwt" -
onlyoffice/trunk/vendor/composer/installed.php
r2976472 r3070758 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' 165dea0488ea93230789f01c30f2fa34fa319c15',6 'reference' => 'eb4282d29affcb188143d0992bcc70993ad7578d', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' 165dea0488ea93230789f01c30f2fa34fa319c15',16 'reference' => 'eb4282d29affcb188143d0992bcc70993ad7578d', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 'firebase/php-jwt' => array( 23 'pretty_version' => 'v6. 9.0',24 'version' => '6. 9.0.0',25 'reference' => ' f03270e63eaccf3019ef0f32849c497385774e11',23 'pretty_version' => 'v6.10.0', 24 'version' => '6.10.0.0', 25 'reference' => 'a49db6f0a5033aef5143295342f1c95521b075ff', 26 26 'type' => 'library', 27 27 'install_path' => __DIR__ . '/../firebase/php-jwt', -
onlyoffice/trunk/vendor/firebase/php-jwt/CHANGELOG.md
r2976472 r3070758 1 1 # Changelog 2 3 ## [6.10.0](https://github.com/firebase/php-jwt/compare/v6.9.0...v6.10.0) (2023-11-28) 4 5 6 ### Features 7 8 * allow typ header override ([#546](https://github.com/firebase/php-jwt/issues/546)) ([79cb30b](https://github.com/firebase/php-jwt/commit/79cb30b729a22931b2fbd6b53f20629a83031ba9)) 2 9 3 10 ## [6.9.0](https://github.com/firebase/php-jwt/compare/v6.8.1...v6.9.0) (2023-10-04) -
onlyoffice/trunk/vendor/firebase/php-jwt/src/JWT.php
r2976472 r3070758 204 204 array $head = null 205 205 ): string { 206 $header = ['typ' => 'JWT', 'alg' => $alg]; 206 $header = ['typ' => 'JWT']; 207 if (isset($head) && \is_array($head)) { 208 $header = \array_merge($header, $head); 209 } 210 $header['alg'] = $alg; 207 211 if ($keyId !== null) { 208 212 $header['kid'] = $keyId; 209 }210 if (isset($head) && \is_array($head)) {211 $header = \array_merge($head, $header);212 213 } 213 214 $segments = [];
Note: See TracChangeset
for help on using the changeset viewer.