Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
model.php 0000644 00000007602 15073240570 0006365 0 ustar 00 post = get_post( $data['id'] );
if ( ! $this->post ) {
$this->post = new \WP_Post( (object) [] );
}
if ( wp_is_post_revision( $this->post->ID ) ) {
$this->post_parent = get_post( $this->post->post_parent );
} else {
$this->post_parent = $this->post;
}
parent::__construct( $data );
}
/**
* Get model name.
*
* Retrieve page settings model name.
*
* @since 1.6.0
* @access public
*
* @return string Model name.
*/
public function get_name() {
return 'page-settings';
}
/**
* Get model unique name.
*
* Retrieve page settings model unique name.
*
* @since 1.6.0
* @access public
*
* @return string Model unique name.
*/
public function get_unique_name() {
return $this->get_name() . '-' . $this->post->ID;
}
/**
* Get CSS wrapper selector.
*
* Retrieve the wrapper selector for the page settings model.
*
* @since 1.6.0
* @access public
*
* @return string CSS wrapper selector.
*/
public function get_css_wrapper_selector() {
$document = Plugin::$instance->documents->get( $this->post_parent->ID );
return $document->get_css_wrapper_selector();
}
/**
* Get panel page settings.
*
* Retrieve the panel setting for the page settings model.
*
* @since 1.6.0
* @access public
*
* @return array {
* Panel settings.
*
* @type string $title The panel title.
* }
*/
public function get_panel_page_settings() {
$document = Plugin::$instance->documents->get( $this->post->ID );
return [
'title' => sprintf(
/* translators: %s: Document title. */
esc_html__( '%s Settings', 'elementor' ),
$document::get_title()
),
];
}
/**
* On export post meta.
*
* When exporting data, check if the post is not using page template and
* exclude it from the exported Elementor data.
*
* @since 1.6.0
* @access public
*
* @param array $element_data Element data.
*
* @return array Element data to be exported.
*/
public function on_export( $element_data ) {
if ( ! empty( $element_data['settings']['template'] ) ) {
/**
* @var \Elementor\Modules\PageTemplates\Module $page_templates_module
*/
$page_templates_module = Plugin::$instance->modules_manager->get_modules( 'page-templates' );
$is_elementor_template = (bool) $page_templates_module->get_template_path( $element_data['settings']['template'] );
if ( ! $is_elementor_template ) {
unset( $element_data['settings']['template'] );
}
}
return $element_data;
}
/**
* Register model controls.
*
* Used to add new controls to the page settings model.
*
* @since 3.1.0
* @access protected
*/
protected function register_controls() {
// Check if it's a real model, or abstract (for example - on import ).
if ( $this->post->ID ) {
$document = Plugin::$instance->documents->get_doc_or_auto_save( $this->post->ID );
if ( $document ) {
$controls = $document->get_controls();
foreach ( $controls as $control_id => $args ) {
$this->add_control( $control_id, $args );
}
}
}
}
}
manager.php 0000644 00000022414 15073240570 0006675 0 ustar 00 editor->is_edit_mode() ) {
return null;
}
if ( Plugin::$instance->editor->is_edit_mode() ) {
$post_id = Plugin::$instance->editor->get_post_id();
$document = Plugin::$instance->documents->get_doc_or_auto_save( $post_id );
} else {
$post_id = get_the_ID();
$document = Plugin::$instance->documents->get_doc_for_frontend( $post_id );
}
if ( ! $document ) {
return null;
}
$model = $this->get_model( $document->get_post()->ID );
if ( $document->is_autosave() ) {
$model->set_settings( 'post_status', $document->get_main_post()->post_status );
}
return $model;
}
/**
* Ajax before saving settings.
*
* Validate the data before saving it and updating the data in the database.
*
* @since 1.6.0
* @access public
*
* @param array $data Post data.
* @param int $id Post ID.
*
* @throws \Exception If invalid post returned using the `$id`.
* @throws \Exception If current user don't have permissions to edit the post.
*/
public function ajax_before_save_settings( array $data, $id ) {
$post = get_post( $id );
if ( empty( $post ) ) {
throw new \Exception( 'Invalid post.', Exceptions::NOT_FOUND ); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
}
if ( ! Utils::is_wp_cli() && ! current_user_can( 'edit_post', $id ) ) {
throw new \Exception( 'Access denied.', Exceptions::FORBIDDEN ); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
}
// Avoid save empty post title.
if ( ! empty( $data['post_title'] ) ) {
$post->post_title = $data['post_title'];
}
if ( isset( $data['post_excerpt'] ) && post_type_supports( $post->post_type, 'excerpt' ) ) {
$post->post_excerpt = $data['post_excerpt'];
}
if ( isset( $data['menu_order'] ) && is_post_type_hierarchical( $post->post_type ) ) {
$post->menu_order = $data['menu_order'];
}
if ( isset( $data['post_status'] ) ) {
$this->save_post_status( $id, $data['post_status'] );
unset( $post->post_status );
}
if ( isset( $data['comment_status'] ) && post_type_supports( $post->post_type, 'comments' ) ) {
$post->comment_status = $data['comment_status'];
}
wp_update_post( $post );
// Check updated status.
if ( Document::STATUS_PUBLISH === get_post_status( $id ) ) {
$autosave = wp_get_post_autosave( $post->ID );
if ( $autosave ) {
wp_delete_post_revision( $autosave->ID );
}
}
if ( isset( $data['post_featured_image'] ) && post_type_supports( $post->post_type, 'thumbnail' ) ) {
// Check if the user is at least an Author before allowing them to modify the thumbnail.
if ( ! current_user_can( 'publish_posts' ) ) {
throw new \Exception( 'You do not have permission to modify the featured image.', Exceptions::FORBIDDEN ); // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped
}
if ( empty( $data['post_featured_image']['id'] ) ) {
delete_post_thumbnail( $post->ID );
} else {
set_post_thumbnail( $post->ID, $data['post_featured_image']['id'] );
}
}
if ( Utils::is_cpt_custom_templates_supported() ) {
$template = get_metadata( 'post', $post->ID, '_wp_page_template', true );
if ( isset( $data['template'] ) ) {
$template = $data['template'];
}
if ( empty( $template ) ) {
$template = 'default';
}
// Use `update_metadata` in order to save also for revisions.
update_metadata( 'post', $post->ID, '_wp_page_template', $template );
}
}
/**
* @inheritDoc
*
* Override parent because the page setting moved to document.settings.
*/
protected function print_editor_template_content( $name ) {
?>
<#
const tabs = elementor.config.document.settings.tabs;
if ( Object.values( tabs ).length > 1 ) { #>