Skip to content

Commit

Permalink
Merge pull request #27 from codersaiful/1.0.1.0
Browse files Browse the repository at this point in the history
1.0.1.0
  • Loading branch information
codersaiful authored Feb 23, 2021
2 parents 561132d + ca6bb76 commit 08a75ed
Show file tree
Hide file tree
Showing 13 changed files with 875 additions and 96 deletions.
2 changes: 1 addition & 1 deletion admin/pages/extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

$checkbox_id = 'checkbox_' . $class_name;
$html_class = [];
$html_class[] = $name;
// $html_class[] = $name;
$html_class[] = $enbl_disbl_class;
//$html_class[] = $icon;
$html_class[] = $free_pro;
Expand Down
205 changes: 143 additions & 62 deletions admin/pages/header-footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Controlling Form Submission
*/
$form_datas = filter_input_array(INPUT_POST);

do_action( 'ultraaddons_save_data', $form_datas, 'header_foooter' );

$key = Header_Footer::$key;
Expand All @@ -18,73 +19,153 @@
update_option( $key, $form_datas );
}
$current_data = Header_Footer::get_data();
var_dump($current_data);
$type = isset( $current_data['type'] ) ? $current_data['type'] : '';
$wrapper = isset( $current_data['wrapper'] ) ? $current_data['wrapper'] : 'box';;

$template_obj = new Template_List();
$templates = $template_obj->get_templates();




?>
<form style="" action="" class="" method="POST">



<?php
if( is_array( $templates ) && count( $templates ) > 0 ){
?>
<div class="ultraaddons-field-container">
<label><?php echo esc_html__( 'Select Header', 'ultraaddons' ); ?></label>
<select class="ultraddons-select" name="header_id">
<option value=""><?php echo esc_html__( 'None', 'ultraaddons' ); ?></option>
<?php
foreach( $templates as $templ_id => $templ_name ){
$selected = isset( $current_data['header_id'] ) && $current_data['header_id'] == $templ_id ? 'selected' : '';
echo "<option value='{$templ_id}' $selected>{$templ_name}</option>";
}
?>
</select>
</div>
<div class="ultraaddons-field-container">
<label><?php echo esc_html__( 'Select Footer', 'ultraaddons' ); ?></label>
<select class="ultraddons-select" name="footer_id">
<option value=""><?php echo esc_html__( 'None', 'ultraaddons' ); ?></option>
<?php
foreach( $templates as $templ_id => $templ_name ){
$selected = isset( $current_data['footer_id'] ) && $current_data['footer_id'] == $templ_id ? 'selected' : '';
echo "<option value='{$templ_id}' $selected>{$templ_name}</option>";
}
?>
</select>
</div>


<?php
}else{
$add_new_elementor_template = admin_url( 'edit.php?post_type=elementor_library#add_new' );
?>
<h2 class="ultraaddons-header-footer-not"><?php echo esc_html__( "There is no Template founded in Elementor Library", 'ultraaddons' ); ?></h2>
<?php
}?>
<div class="ultraaddons-field-container">
<!--
Supported:
php: it will replace header file location with our plugin's header replace. header template will come from our plugins header file.
css: it will just hide theme's header by css. which classs should hav site-header, or id masterhead or side-header
addintional: for this option, header and footer will add as additional
-->
<label>Templating Type</label>
<input type="text" value="<?php echo isset( $current_data['type'] ) ? $current_data['type'] : 'php'; ?>" name="type">
</div>

<div class="ultraaddons-field-container">
<!--
Supported:
flued and box
-->
<label>Container Size</label>
<input type="text" value="<?php echo isset( $current_data['wrapper'] ) ? $current_data['wrapper'] : 'flued'; ?>" name="wrapper">

<div class="ultraaddons-section ua-option-wrapper">
<div class="ua-section-inside">
<div class="ua-header">
<h1 class="ua-page-title"><?php echo esc_html__( 'Header & Footer Controlling', 'ultraaddons' ); ?></h1>
</div>

<div class="ua-sectioon-content">
<div class="ua-content-inside">

<form class="ua-header-footer-form" action="" method="post">
<div class="ua-form-wrappper">
<?php
if( is_array( $templates ) && count( $templates ) > 0 ){
?>
<div class="ultraaddons-field-container">
<label class="field-label field-label-header-choose"><?php echo esc_html__( 'Select Header', 'ultraaddons' ); ?></label>
<select class="ultraddons-select" name="header_id">
<option value=""><?php echo esc_html__( 'None', 'ultraaddons' ); ?></option>
<?php
foreach( $templates as $templ_id => $templ_name ){
$selected = isset( $current_data['header_id'] ) && $current_data['header_id'] == $templ_id ? 'selected' : '';
echo "<option value='{$templ_id}' $selected>{$templ_name}</option>";
}
?>
</select>
<div class="ua-form-message">
<p>
Template list is coming from Elementor Template. If you already made your header in Elementor
Template, Then Choose any one. Otherwise,
Create new
<a href="<?php echo esc_url( $add_new_elementor_template ); ?>">
Header as Elementor Template
</a>.
</p>
</div>
</div>
<div class="ultraaddons-field-container">
<label class="field-label field-label-footer-choose"><?php echo esc_html__( 'Select Footer', 'ultraaddons' ); ?></label>
<select class="ultraddons-select" name="footer_id">
<option value=""><?php echo esc_html__( 'None', 'ultraaddons' ); ?></option>
<?php
foreach( $templates as $templ_id => $templ_name ){
$selected = isset( $current_data['footer_id'] ) && $current_data['footer_id'] == $templ_id ? 'selected' : '';
echo "<option value='{$templ_id}' $selected>{$templ_name}</option>";
}
?>
</select>
<div class="ua-form-message">
<p>
Template list is coming from Elementor Template. If you already made your header in Elementor
Template, Then Choose any one. Otherwise,
Create new
<a href="<?php echo esc_url( $add_new_elementor_template ); ?>">
Header as Elementor Template
</a>.
</p>
</div>
</div>
<div class="ultraaddons-field-container">
<!--
Supported:
php: it will replace header file location with our plugin's header replace. header template will come from our plugins header file.
css: it will just hide theme's header by css. which classs should hav site-header, or id masterhead or side-header
addintional: for this option, header and footer will add as additional
-->
<label class="field-label field-label-template-system">Template System</label>
<div class="ua-radion-type">
<label for="ua-header-footer-dir-change" class="radio-label radio-label-hf">
<div class="ua-radio-top">
<input <?php echo $type == 'php' ? 'checked' : ''; ?>
name="type" value="php" class="ua-hf-type-radio" type="radio" id="ua-header-footer-dir-change">
<h4 class="ua-hf-radio-label-title">Header Directory Change</h4>
</div>
<div class="ua-form-message ua-radio-message">
Template list is coming from Elementor Template. If you already made your header in Elementor
</div>
</label>

<label for="ua-header-footer-by-css" class="radio-label radio-label-hf">
<div class="ua-radio-top">
<input <?php echo $type == 'css' ? 'checked' : ''; ?>
name="type" value="css" class="ua-hf-type-radio" type="radio" id="ua-header-footer-by-css">
<h4 class="ua-hf-radio-label-title">Override by CSS</h4>
</div>
<div class="ua-form-message ua-radio-message">
To this system, Our plugin will not replace header.php file or don't change header file location.
We will hide current theme's header by css. we have used css <code>display: none;</code> for some selector:<b>.site-header/#site-header/#masthead/.site-footer/#site-footer</b>.<br>
If not available these class to your theme, Our plugin will not able to hide your theme's header.<br>
<i>In this situation, you have to hide your header or footer manually by css code.</i> You can add your css code to Customizer.
</div>
</label>
<label for="ua-header-footer-additional" class="radio-label radio-label-hf">
<div class="ua-radio-top">
<input <?php echo $type == 'additional' ? 'checked' : ''; ?>
name="type" value="additional" class="ua-hf-type-radio" type="radio" id="ua-header-footer-additional">
<h4 class="ua-hf-radio-label-title">Header Content as Additional </h4>
</div>
<div class="ua-form-message ua-radio-message">
This method/system will not hide current header or footer. Instead: Our plugin will add Additional Header part or Footer part for your site.
Header and Footer Template will add at the top of current Header/Footer.
</div>
</label>


</div>
</div>

<div class="ultraaddons-field-container field-container-size">
<label class="field-label field-label-header-choose"><?php echo esc_html__( 'Container Size', 'ultraaddons' ); ?></label>
<select class="ultraddons-select" name="wrapper">
<option value="box" selected="<?php echo $wrapper == 'box' ? 'selected' : ''; ?>"><?php echo esc_html__( 'Box', 'ultraaddons' ); ?></option>
<option value="flued" selected="<?php echo $wrapper == 'Flued' ? 'selected' : ''; ?>"><?php echo esc_html__( 'Flued', 'ultraaddons' ); ?></option>

</select>
<div class="ua-form-message">
<p>
Container size, Only for Template System: <b>Header Directory Change</b>. Otherwise, Container Size will not impact to your theme.
for <b>Box</b> size, container width accordingly 1170px,960px,730px,540px based on Browser Window size. On the other hand, for <b>Flued</b>, width will be 100%;
our container class is: <code>.ultraaddons-container</code>.
</p>
</div>
</div>

<?php
}else{
?>
<h2 class="ultraaddons-header-footer-not"><?php echo esc_html__( "There is no Template founded in Elementor Library", 'ultraaddons' ); ?></h2>
<?php } ?>

</div> <!-- /.ua-form-wrappper -->
<div class="ua-widget-footer">
<button class="primary button button-primary ua-primary ua-no-update" type="submit"><?php echo esc_html__( 'Save Change', 'ultraaddons' ); ?></button>
</div>
</form>

</div>
</div>
</div>

<button type="submit"><?php echo esc_html__( 'Submit', 'ultraaddons' ); ?></button>
</form>
</div>
10 changes: 9 additions & 1 deletion admin/pages/widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@


$items = Widgets_Manager::widgets();
$items['More'] = [
'name' => __( 'More Widget Comming Soon ....', 'ultraaddons' ),
'is_free' => false,
'icon' => 'eicon-global-colors',
'cat' => [
__( 'Basic', 'ultraaddons' ),
],
];
$disable_items = Widgets_Manager::disableWidgetKeys();
?>

Expand All @@ -40,7 +48,7 @@
$enbl_disbl_class = in_array( $class_name, $disable_items ) ? 'disabled' : 'enabled';
$checkbox_id = 'checkbox_' . $class_name;
$html_class = [];
$html_class[] = $name;
//$html_class[] = $name;
$html_class[] = $enbl_disbl_class;
//$html_class[] = $icon;
$html_class[] = $free_pro;
Expand Down
109 changes: 105 additions & 4 deletions assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,17 @@ ul.ua-submenu li {
}

ul.ua-submenu li a {
color: #ebc3ff;
color: white;
padding: 15px 30px;
display: block;
border-bottom: 6px solid #07001526;
/*border-bottom: 6px solid #07001526;*/
border-top-right-radius: 12px;
border-bottom-left-radius: 7px;
background: linear-gradient(160deg, #7934d5, #fb3bd2);
/* background: #7439e5; */
background: #ac21f2;
/*background: #ac21f2;*/
border-bottom: 6px solid rgb(90, 42, 183);
background: rgb(116, 57, 229);
}
ul.ua-submenu li.ua-current-menu a {
background: #4caf50;
Expand Down Expand Up @@ -170,7 +172,7 @@ h1.ua-page-title {
background: #8020e705;
height: 45px;
width: 45px;
/* margin-bottom: 8px;
/* margin-bottom: 8px;
margin-top: 8px;*/
}
.ua-option-item:hover i.ua-option-icon {
Expand Down Expand Up @@ -239,6 +241,42 @@ h2.ua-item-name {
background: #e6e6e6;
}

/* for More */
.ua-option-item-wrappper label.ua-option-item.More {
background: #ffffff !important;
opacity: 1 !important;
/* width: 100%;
padding-left: 30px;
padding-right: 30px;*/
}

.ua-option-item-wrappper label.ua-option-item.More .ua-designed-checkbox {
background: #f06c99;
}

.ua-option-item-wrappper label.ua-option-item.More span.ua-option-version-type.ua-option-version-type-pro {
background: #ff9800;
font-size: 0;
}

.ua-option-item-wrappper label.ua-option-item.More h2.ua-item-name {font-style: italic;font-weight: bold;}
.ua-option-item-wrappper label.ua-option-item.More .ua-designed-checkbox:before{
animation-name: ultraaddons-animated-on-off;
animation-duration: .4s;
animation-iteration-count: infinite;
animation-direction: alternate;
}
@keyframes ultraaddons-animated-on-off {
from {left: 12px;background-color: black;}
to {left: 35px;}
}
/*.ua-option-item-wrappper label.ua-option-item.More .ua-option-item-inside {
display: flex;
align-items: center;
}*/
/* for More End*/



/**##### Checkbox ######**/
.ua-designed-checkbox {
Expand Down Expand Up @@ -308,3 +346,66 @@ input.ua-checkbox-hidden {


/*********For Widget Menu List | END *********/

/**** Header Footer Form ****/

.ua-form-wrappper {
display: flex;
flex-wrap: wrap;
column-gap: 30px;
row-gap: 30px;
align-items: stretch;
margin: 45px 0;
}
.ultraaddons-field-container {
width: 100%;
display: flex;
flex-direction: column;
}

.ultraaddons-field-container label {
padding: 0 0 15px 0;
font-size: 1.2em;
display: block;
}

.ultraaddons-field-container select.ultraddons-select,
.ultraaddons-field-container select,.ultraaddons-field-container input[type=text] {
width: 100%;
max-width: 25rem;
}
.ua-radio-top {
display: block;
}

h4.ua-hf-radio-label-title {
display: inline;
padding-left: 15px;
}

.ua-hf-type-radio {
}

.ua-radion-type {
background: #ddd0;
padding: 20px;
border: 1px solid #dddddd5c;
}

.ua-radio-message {
font-style: italic;
margin: 15px 15px 15px 40px;
}
.ua-form-message {
color: #afafaf;
}
.ua-hf-type-radio:checked + h4.ua-hf-radio-label-title {
color: #4caf50;
font-weight: bold;
}

input.ua-hf-type-radio[type=radio]:checked::before {
background-color: #4caf50;
}
.field-container-size{display: none;}
/**** Header Footer Form | END****/
Loading

0 comments on commit 08a75ed

Please sign in to comment.