first commit

This commit is contained in:
Roman Pyrih
2023-07-24 08:30:51 +02:00
commit c2e100a763
7128 changed files with 1622619 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
<?php if ( ! defined( 'ABSPATH' ) ) {
die( 'Direct access forbidden.' );
}
/**
* @var int $id ;
* @var Brizy_Editor_Post $post ;
*/
$state = $is_using_brizy ? 'disable' : 'enable';
$className = $is_using_brizy ? 'brizy-button--default' : 'brizy-button--primary';
$edit_url = esc_url( set_url_scheme( admin_url( 'admin-post.php?action=_brizy_admin_editor_' . $state . '&post=' . $post->ID ) ) );
?>
<div class="brizy-buttons is-classic-editor">
<?php
if ( $is_using_brizy ) {
?>
<a class="brizy-button brizy-button--primary enable-brizy-editor" href="<?php echo $edit_url; ?>">
<?php echo __( 'Back to WordPress Editor', 'brizy' ) ?>
</a>
<?php
} else {
?>
<a href="<?php echo $edit_url;?>" class="button button-primary button-large enable-brizy-editor">
<?php printf( esc_html__( 'Edit with %s', 'brizy' ), __bt( 'brizy', 'Brizy' ) ); ?>
</a>
<?php
}
?>
</div>
<?php
if ( $is_using_brizy ) {
?>
<style>
#post-status-info {
display: none;
}
</style>
<div class="brizy-editor">
<div class="brizy-buttons brizy-buttons-gutenberg">
<a href="<?php echo $url;?>" class="">
<div class="button button-primary button-large">
<?php printf( esc_html__( 'Edit with %s', 'brizy' ), __bt( 'brizy', 'Brizy' ) ); ?>
</div>
</a>
</div>
</div>
<?php
}
?>

View File

@@ -0,0 +1,6 @@
<div class="cloud-form">
<h2>Cloud</h2>
{% block content %}
{% endblock %}
</div>

View File

@@ -0,0 +1,32 @@
{% extends "cloud-base.html.twig" %}
{% block content %}
<form method="post">
{{ nonce | raw }}
<table class="form-table">
<tr>
<th scope="row">
<label for="cloud-username">User name</label>
</th>
<td>
<input name="cloud-username" type="text" value="{{ username }}" class="regular-text"
id="cloud-username"/>
</td>
</tr>
<tr>
<th scope="row">
<label for="cloud-password">Password</label>
</th>
<td>
<input name="cloud-password" type="password" value="{{ password }}" class="regular-text"
id="cloud-password"/>
</td>
</tr>
</table>
<p class="submit">
<input type="submit" name="brizy-cloud-login" id="submit" class="button button-primary"
value="Login">
</p>
</form>
{% endblock %}

View File

@@ -0,0 +1,40 @@
{% extends "cloud-base.html.twig" %}
{% block content %}
<p>
<a href="{{ logoutUrl }}">Logout</a>
</p>
<br>
<h3>Project</h3>
{% if containers|length > 0 %}
<div class="projects">
<form method="post" id="cloud-form" action="{{ pageUrl }}">
{{ nonce | raw }}
<table class="form-table">
<tr>
<th scope="row">
<label for="project-account">Select Account</label>
</th>
<td>
<select name="brizy-cloud-use-container" id="project-account" class="regular-text">
{% for container in containers %}
<option value="{{ container.id }}" {{ container.id==projectObject.container?'selected':'' }}>{{ container.name }}</option>
{% endfor %}
</select>
</td>
</tr>
</table>
<p class="submit">
<input type="submit" name="brizy-cloud-use-project-submit" id="submit" class="button button-primary"
value="Save">
</p>
</form>
</div>
{% else %}
<div class="no-projects">
You do not have an account yet.
</div>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,7 @@
<div class="wrap">
<h1>Cloud settings</h1>
</div>

View File

@@ -0,0 +1,22 @@
<?php if ( is_array( $news ) ) : ?>
<div class="brizy-overview__feed">
<h3 class="brizy-overview__heading">
<?php _e( 'News & Updates', 'brizy' ); ?>
</h3>
<ul class="brizy-overview__posts">
<?php foreach ( $news as $item ) : ?>
<li class="brizy-overview__post">
<a href="<?php echo esc_url( $item['url'] ); ?>" class="brizy-overview__post-link" target="_blank">
<span class="brizy-overview__badge"><?php _e( 'New', 'brizy' ); ?></span>
<?php echo strip_tags( $item['title'] ); ?>
</a>
<p class="brizy-overview__post-description"><?php echo strip_tags( $item['excerpt'] ); ?></p>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php else : ?>
<p>
<?php echo is_string( $news ) ? $news : __( 'No News', 'brizy' ); ?>
</p>
<?php endif; ?>

View File

@@ -0,0 +1,16 @@
<?php if ( count( $posts ) ) : ?>
<div class="brizy-overview__recently-edited">
<h3 class="brizy-overview__heading">
<?php _e( 'Recently Edited', 'brizy' ); ?>
</h3>
<ul class="brizy-overview__posts">
<?php foreach ( $posts as $apost ) : ?>
<li class="brizy-overview__post">
<a href="<?php echo esc_url( $apost['edit_url'] ); ?>" class="e-overview__post-link">
<?php echo $apost['title']; ?> <span class="dashicons dashicons-edit"></span>
</a> <span><?php echo $apost['date']; ?></span>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>

View File

@@ -0,0 +1,29 @@
<div class="brizy-news">
<?php echo $news; ?>
</div>
<div class="brizy-posts">
<?php echo $posts ?>
</div>
<p class="brizy-dashboard-widget-footer">
<a href="https://www.brizy.io/blog/" target="_blank">
<?php _e( 'Blog', 'brizy' ); ?>&nbsp;
<span aria-hidden="true" class="dashicons dashicons-external"></span>
</a>
|
<a href="https://support.brizy.io/hc/en-us" target="_blank">
<?php _e( 'Help', 'brizy' ); ?>&nbsp;
<span aria-hidden="true" class="dashicons dashicons-external"></span>
</a>
<?php if ( ! class_exists( 'BrizyPro_Main' ) ) : ?>
|
<a href="<?php echo Brizy_Config::GO_PRO_DASHBOARD_URL; ?>" target="_blank" class="brizy-dashboard-widget-footer__go-pro">
<?php _e( 'Go PRO', 'brizy' ); ?>&nbsp;
<svg height="20" width="20">
<path d="M13,7 L12,7 L12,4.73333333 C12,2.6744 10.206,1 8,1 C5.794,1 4,2.6744 4,4.73333333 L4,7 L3,7 C2.448,7 2,7.41813333 2,7.93333333 L2,14.0666667 C2,14.5818667 2.448,15 3,15 L13,15 C13.552,15 14,14.5818667 14,14.0666667 L14,7.93333333 C14,7.41813333 13.552,7 13,7 Z M10,5 L12,5 L12,7 L10,7 L6,7 L6,5 C6,3.897 6.897,3 8,3 C9.103,3 10,3.897 10,5 Z" fill-rule="nonzero"/>
</svg>
</a>
<?php endif; ?>
</p>

View File

@@ -0,0 +1,77 @@
<div class="brizy-featured-image hide-if-no-js">
<div class="wrapper">
<img id="featured-image-el" src="{{ thumbnailSrc[0] }}" alt="" width="100%">
<div class="focal-point" style="left: {{ focalPoint['x'] }}%; top: {{ focalPoint['y'] }}%;"></div>
<div class="deleteImage">
<a href="#" id="remove-post-thumbnail">
<svg class="brz-icon-svg">
<use xlink:href="{{ pluginUrl }}/editor/icons/icons.svg#nc-circle-remove"></use>
</svg>
</a>
</div>
</div>
<input type="hidden" id="_thumbnail_id" name="_thumbnail_id" value="{{ thumbnailId }}">
<input type="hidden" id="_thumbnail_focal_point_x" name="_thumbnail_focal_point_x" value="{{ focalPoint['x'] }}"/>
<input type="hidden" id="_thumbnail_focal_point_y" name="_thumbnail_focal_point_y" value="{{ focalPoint['y'] }}"/>
</div>
<script>
jQuery(document).ready(function ($) {
(function () {
var $focalPointDiv = $('.focal-point');
var $focalPointX = $('#_thumbnail_focal_point_x');
var $focalPointY = $('#_thumbnail_focal_point_y');
var $featuredImageEl = $('#featured-image-el');
var isDragging = false;
$('.brizy-featured-image .wrapper').on('mouseleave', function () {
isDragging = false;
});
$featuredImageEl.on('mousedown', function () {
isDragging = true;
});
$featuredImageEl.on('mouseup', function () {
isDragging = false;
});
$focalPointDiv.on('mouseup', function () {
isDragging = false;
});
$focalPointDiv.on('mousedown', function () {
isDragging = true;
});
$featuredImageEl.on( 'click mousemove', function ( e ) {
if ( ! isDragging && e.type!=='click' ) {
return;
}
if ( window.getSelection ) {
window.getSelection().removeAllRanges();
} else if ( document.selection ) {
document.selection.empty();
}
var $this = $(this);
var imageW = $this.width();
var imageH = $this.height();
//Calculate FocusPoint coordinates
var offsetX = e.pageX - $this.offset().left;
var offsetY = e.pageY - $this.offset().top;
//Calculate CSS Percentages
var percentageX = (offsetX / imageW) * 100;
var percentageY = (offsetY / imageH) * 100;
// Set positioning
$focalPointDiv.css({left: percentageX.toFixed(0) + '% ', top: percentageY.toFixed(0) + '%'});
$focalPointX.val(percentageX.toFixed(0));
$focalPointY.val(percentageY.toFixed(0));
});
})();
});
</script>

View File

@@ -0,0 +1,25 @@
<ul class="formData">
{% for field in data.formData %}
<li>
<label for="{{ field.name }}">{{ field.label }}</label>:
{% if field.type == "FileUpload" %}
<span id="{{ field.name }}"><a href="{{ field.value }}" target="_blank">{{ field.value }}</a></span>
{% else %}
<span id="{{ field.name }}">{{ field.value }}</span>
{% endif %}
</li>
{% endfor %}
</ul>
<style>
.formData {
margin: 0;
}
.formData label {
font-weight: bold;
}
.formData span {
vertical-align: middle;
}
</style>

View File

@@ -0,0 +1,30 @@
<?php
/**
* Output the roles checklist.
*
* @var $roles array All WordPress roles in name => label pairs.
* @var $user_roles array An array of role names belonging to the current user.
*/
$creating = isset( $_POST['createuser'] );
$selected_roles = $creating && isset( $_POST['editor_multiple_roles'] ) ? wp_unslash( $_POST['editor_multiple_roles'] ) : '';
?>
<div class="editor-checklist-roles" style="display:none;" data-label-text="<?php echo esc_attr( __( 'Roles' ) ); ?>">
<?php foreach( $roles as $name => $label ) : ?>
<label >
<input
type="checkbox"
name="editor_multiple_roles[]"
style="width:auto;"
value="<?php echo esc_attr( $name ); ?>"
<?php if ( ! is_null( $user_roles ) ) : // Edit user page
checked( in_array( $name, $user_roles ) );
elseif ( ! empty( $selected_roles ) ) : // Add new user page
checked( in_array( $name, $selected_roles ) );
endif; ?>
/>
<?php echo esc_html( translate_user_role( $label ) ); ?>
</label>
<br />
<?php endforeach; ?>
</div>

View File

@@ -0,0 +1,17 @@
<?php if ( ! defined( 'ABSPATH' ) ) {
die( 'Direct access forbidden.' );
}
/**
* @var string $message
* @var string $type
*/
?>
<div class="wrap">
<div class="<?php echo $type; ?> settings-<?php echo $type; ?> notice-<?php echo $type; ?> notice is-dismissible">
<p><strong><?php echo $message; ?></strong></p>
<button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php echo __('Dismiss this notice','brizy')?>.</span>
</button>
</div>
</div>

View File

@@ -0,0 +1,3 @@
<div class="brizy-template-rules submitbox">
<div id="rules"></div>
</div>

View File

@@ -0,0 +1,20 @@
<?php if ( ! defined( 'ABSPATH' ) ) {
die( 'Direct access forbidden.' );
}
/**
* @var array $types
*/
?>
<div class="wrap">
<h1>Debug Information</h1>
<fieldset style="border: 1px solid red; padding: 15px;">
<pre>
<?php
$data = get_option( 'brizy' );
print_r($data);
?>
</pre>
</fieldset>
</div>

View File

@@ -0,0 +1,62 @@
<?php if ( ! defined( 'ABSPATH' ) ) {
die( 'Direct access forbidden.' );
}
?>
<form method="post" novalidate="novalidate">
<input type="hidden" name="tab" value="general"/>
<?php wp_nonce_field() ?>
<table class="form-table">
<tbody>
<tr>
<th scope="row"><?php echo __( 'Activate' ) . ' ' . __bt( 'brizy', 'Brizy' ) . ' ' . __( 'For' ); ?></th>
<td>
<fieldset>
<?php foreach ( $types as $type ) {
do_action( 'brizy_settings_post_type_row', $type );
?><br><?php
}
?>
</fieldset>
</td>
</tr>
<tr>
<th scope="row"><?php echo __( 'Enable SVG uploads' ); ?></th>
<td>
<label>
<input type="checkbox"
id="svg-upload-enabled"
name="svg-upload-enabled"
value="1"
<?php echo $svgUploadEnabled ? 'checked' : ''; ?>
>
</label>
</td>
</tr>
<tr>
<th scope="row"><?php echo __( 'Enable JSON uploads' ); ?></th>
<td>
<label>
<input type="checkbox"
id="json-upload-enabled"
name="json-upload-enabled"
value="1"
<?php echo $jsonUploadEnabled ? 'checked' : ''; ?>
>
</label>
</td>
</tr>
</tbody>
</table>
<p class="submit">
<button type="submit"
name="brizy-general-submit"
id="submit"
class="button button-primary"
><?php echo __( 'Save Changes', 'brizy' ); ?></button>
</p>
</form>

View File

@@ -0,0 +1,79 @@
<?php defined( 'ABSPATH' ) or die(); ?>
<form method="post" novalidate="novalidate">
<input type="hidden" name="tab" value="maintenance"/>
<?php wp_nonce_field() ?>
<table class="form-table">
<tbody>
<tr id="brizy-maintenance-js-mode">
<th>
<label for="brizy-maintenance-mode"><?php _e( 'Choose Mode', 'brizy' ); ?></label>
</th>
<td>
<select name="brizy-maintenance[mode]" id="brizy-maintenance-mode">
<option value=""<?php selected( $mode, '' ); ?>><?php _e( 'Disabled', 'brizy' ); ?></option>
<option value="coming_soon"<?php selected( $mode, 'coming_soon' ); ?>><?php _e( 'Coming Soon', 'brizy' ); ?></option>
<option value="maintenance"<?php selected( $mode, 'maintenance' ); ?>><?php _e( 'Maintenance', 'brizy' ); ?></option>
</select>
</td>
</tr>
<tr class="hidden">
<th>
<label for="brizy-maintenance-access-role"><?php _e( 'Who Can Access', 'brizy' ); ?></label>
</th>
<td>
<select name="brizy-maintenance[who]" id="brizy-maintenance-access-role">
<option value="logged"<?php selected( $who, 'logged' ); ?>><?php _e( 'Logged In', 'brizy' ); ?></option>
<option value="custom"<?php selected( $who, 'custom' ); ?>><?php _e( 'Custom', 'brizy' ); ?></option>
</select>
</td>
</tr>
<tr class="brizy-maintenance-roles hidden">
<th>
<?php _e( 'Roles', 'brizy' ); ?>
</th>
<td>
<fieldset>
<?php foreach ( $available_roles as $role ) : ?>
<label>
<input type="checkbox" name="brizy-maintenance[roles][]" value="<?php echo $role['id']; ?>"<?php checked( in_array( $role['id'], $roles ) ); ?>>
<?php echo $role['name']; ?>
</label>
<br>
<?php endforeach; ?>
</fieldset>
</td>
</tr>
<tr class="hidden">
<th>
<label for="brizy-maintenance-page"><?php _e( 'Choose a Page', 'brizy' ); ?></label>
</th>
<td>
<?php if ( $pages ) : ?>
<select name="brizy-maintenance[page]" id="brizy-maintenance-page">
<option value=""<?php selected( $page, '' ); ?>><?php _e( 'Select a page', 'brizy' ); ?></option>
<?php foreach ( $pages as $id => $title ) : ?>
<option value="<?php echo $id; ?>"<?php selected( $page, $id ); ?>><?php echo $title; ?></option>
<?php endforeach; ?>
</select>
<?php else : ?>
<?php printf( __( 'You have no pages. Please %s create %s one.', 'brizy' ), '<a href="' . admin_url( 'post-new.php?post_type=page' ) . '">', '</a>' ); ?>
<?php endif; ?>
</td>
</tr>
<tr class="hidden">
<th>
<label for="brizy-maintenance-ips"><?php _e( 'Whitelisted IP Addresses', 'brizy' ); ?></label>
</th>
<td>
<textarea name="brizy-maintenance[ips]" id="brizy-maintenance-ips" cols="25" rows="3" placeholder="122.45.23.22&#10;122.45.25.211"><?php echo $ips; ?></textarea>
</td>
</tr>
</tbody>
</table>
<p class="submit">
<button type="submit" id="submit" class="button button-primary">
<?php echo __( 'Save Changes', 'brizy' ); ?>
</button>
</p>
</form>

View File

@@ -0,0 +1,18 @@
<?php if ( ! defined( 'ABSPATH' ) ) {
die( 'Direct access forbidden.' );
}
/**
* @var array $types
*/
?>
<div class="wrap">
<h1><?php echo Brizy_Editor::get()->get_name() ?></h1>
<h2 class="nav-tab-wrapper">
<?php do_action( 'brizy_network_settings_render_tabs'); ?>
</h2>
<?php do_action( 'brizy_network_settings_render_content'); ?>
</div>

View File

@@ -0,0 +1,28 @@
<?php if ( ! defined( 'ABSPATH' ) ) {
die( 'Direct access forbidden.' );
}
?>
<form method="post" novalidate="novalidate">
<input type="hidden" name="tab" value="roles"/>
<?php wp_nonce_field() ?>
<table class="form-table">
<tbody>
<?php
if ( is_array( $roles ) ) {
foreach ( $roles as $role ) {
do_action( 'brizy_settings_role_capability_row', $role );
}
}
?>
</tbody>
</table>
<p class="submit">
<button type="submit"
id="submit"
class="button button-primary"
><?php echo __( 'Save Changes', 'brizy' ); ?></button>
</p>
</form>

View File

@@ -0,0 +1,18 @@
<?php if ( ! defined( 'ABSPATH' ) ) {
die( 'Direct access forbidden.' );
}
/**
* @var array $types
*/
?>
<div class="wrap">
<h1><?php echo Brizy_Editor::get()->get_name() ?></h1>
<h2 class="nav-tab-wrapper">
<?php do_action( 'brizy_settings_render_tabs'); ?>
</h2>
<?php do_action( 'brizy_settings_render_content'); ?>
</div>