Commit 78876ddd authored by Simonas's avatar Simonas

Merge branch 'dev'

parents 4c6d20ea c35bba6a
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
### DB backup ### DB backup
- `C:\web\dev.biuro> docker exec -i dev-biuro-mysql mysqldump -udev_user -pY6V6bFkD6@GyD!wTShgFmWz! --default-character-set=utf8 dev_biuro > docker/mariadb/data-004.sql` - `C:\web\dev.biuro> docker exec -i dev-biuro-mysql mysqldump -udev_user -pY6V6bFkD6@GyD!wTShgFmWz! --default-character-set=utf8 dev_biuro > docker/mariadb/data-004.sql`
- `sudo docker exec -i biuro-staging-mysql mysqldump -ustaging_user -p'qzl8pMNV^gZ&c1!7ebVsXqQh' --default-character-set=utf8 staging_biuro > docker/mariadb/data-005.sql` - `sudo docker exec -i biuro-staging-mysql mysqldump -ustaging_user -p'qzl8pMNV^gZ&c1!7ebVsXqQh' --default-character-set=utf8 staging_biuro > docker/mariadb/data-007.sql`
### DB restore ### DB restore
- `C:\web\dev.biuro> docker exec -i dev-biuro-mysql mysql -udev_user -pY6V6bFkD6@GyD!wTShgFmWz! --default-character-set=utf8 dev_biuro < docker/mariadb/data-004.sql` - `C:\web\dev.biuro> docker exec -i dev-biuro-mysql mysql -udev_user -pY6V6bFkD6@GyD!wTShgFmWz! --default-character-set=utf8 dev_biuro < docker/mariadb/data-004.sql`
...@@ -103,9 +103,10 @@ Restart docker (sometimes PC restart may be required) ...@@ -103,9 +103,10 @@ Restart docker (sometimes PC restart may be required)
- docker load --input ourdemo.tar - docker load --input ourdemo.tar
- docker build -t biuro/web:0.0.2 . - docker build -t biuro/web:0.0.4 .
- docker login --username=biuro --password=9Ndtjd2vKsLvGuFOeFq1KdJs - docker login --username=biuro --password=9Ndtjd2vKsLvGuFOeFq1KdJs
- docker push biuro/web:0.0.2 - sudo docker login --username=biuro --password=9Ndtjd2vKsLvGuFOeFq1KdJs
- docker push biuro/web:0.0.4
- sudo chown -R www-data:www-data wordpress/wp-content/plugins - sudo chown -R www-data:www-data wordpress/wp-content/plugins
......
...@@ -29,6 +29,11 @@ services: ...@@ -29,6 +29,11 @@ services:
- ./nginx/php.ini:/usr/local/etc/php/conf.d/php.ini - ./nginx/php.ini:/usr/local/etc/php/conf.d/php.ini
- ./wp-content/plugins/biuro-contacts:/var/www/html/wp-content/plugins/biuro-contacts - ./wp-content/plugins/biuro-contacts:/var/www/html/wp-content/plugins/biuro-contacts
- ./wp-content/plugins/biuro-feedbacks:/var/www/html/wp-content/plugins/biuro-feedbacks
- ./wp-content/plugins/biuro-sections:/var/www/html/wp-content/plugins/biuro-sections
- ./wp-content/plugins/biuro-services:/var/www/html/wp-content/plugins/biuro-services
- ./wp-content/plugins/biuro-values:/var/www/html/wp-content/plugins/biuro-values
- ./wp-content/plugins/cookies-warning:/var/www/html/wp-content/plugins/cookies-warning - ./wp-content/plugins/cookies-warning:/var/www/html/wp-content/plugins/cookies-warning
- ./wp-content/plugins/data-controller:/var/www/html/wp-content/plugins/data-controller - ./wp-content/plugins/data-controller:/var/www/html/wp-content/plugins/data-controller
- ./wp-content/plugins/jobs-importer:/var/www/html/wp-content/plugins/jobs-importer - ./wp-content/plugins/jobs-importer:/var/www/html/wp-content/plugins/jobs-importer
...@@ -80,6 +85,11 @@ services: ...@@ -80,6 +85,11 @@ services:
- ./certs-data:/data/letsencrypt - ./certs-data:/data/letsencrypt
- ./wp-content/plugins/biuro-contacts:/var/www/html/wp-content/plugins/biuro-contacts - ./wp-content/plugins/biuro-contacts:/var/www/html/wp-content/plugins/biuro-contacts
- ./wp-content/plugins/biuro-feedbacks:/var/www/html/wp-content/plugins/biuro-feedbacks
- ./wp-content/plugins/biuro-sections:/var/www/html/wp-content/plugins/biuro-sections
- ./wp-content/plugins/biuro-services:/var/www/html/wp-content/plugins/biuro-services
- ./wp-content/plugins/biuro-values:/var/www/html/wp-content/plugins/biuro-values
- ./wp-content/plugins/cookies-warning:/var/www/html/wp-content/plugins/cookies-warning - ./wp-content/plugins/cookies-warning:/var/www/html/wp-content/plugins/cookies-warning
- ./wp-content/plugins/data-controller:/var/www/html/wp-content/plugins/data-controller - ./wp-content/plugins/data-controller:/var/www/html/wp-content/plugins/data-controller
- ./wp-content/plugins/jobs-importer:/var/www/html/wp-content/plugins/jobs-importer - ./wp-content/plugins/jobs-importer:/var/www/html/wp-content/plugins/jobs-importer
...@@ -109,6 +119,11 @@ services: ...@@ -109,6 +119,11 @@ services:
- './var/wp-cli/cache:/etc/X11/fs/.wp-cli/cache' - './var/wp-cli/cache:/etc/X11/fs/.wp-cli/cache'
- ./wp-content/plugins/biuro-contacts:/var/www/html/wp-content/plugins/biuro-contacts - ./wp-content/plugins/biuro-contacts:/var/www/html/wp-content/plugins/biuro-contacts
- ./wp-content/plugins/biuro-feedbacks:/var/www/html/wp-content/plugins/biuro-feedbacks
- ./wp-content/plugins/biuro-sections:/var/www/html/wp-content/plugins/biuro-sections
- ./wp-content/plugins/biuro-services:/var/www/html/wp-content/plugins/biuro-services
- ./wp-content/plugins/biuro-values:/var/www/html/wp-content/plugins/biuro-values
- ./wp-content/plugins/cookies-warning:/var/www/html/wp-content/plugins/cookies-warning - ./wp-content/plugins/cookies-warning:/var/www/html/wp-content/plugins/cookies-warning
- ./wp-content/plugins/data-controller:/var/www/html/wp-content/plugins/data-controller - ./wp-content/plugins/data-controller:/var/www/html/wp-content/plugins/data-controller
- ./wp-content/plugins/jobs-importer:/var/www/html/wp-content/plugins/jobs-importer - ./wp-content/plugins/jobs-importer:/var/www/html/wp-content/plugins/jobs-importer
......
...@@ -97,7 +97,7 @@ http { ...@@ -97,7 +97,7 @@ http {
include h5bp/web_performance/compression-brotli.conf; include h5bp/web_performance/compression-brotli.conf;
# Specify file cache expiration. # Specify file cache expiration.
include h5bp/web_performance/cache_expiration.conf; # include h5bp/web_performance/cache_expiration.conf;
# Add X-XSS-Protection for HTML documents. # Add X-XSS-Protection for HTML documents.
# h5bp/security/x-xss-protection.conf # h5bp/security/x-xss-protection.conf
......
...@@ -32,6 +32,7 @@ rewrite ^/darbo-paieska/klauskite\;/?$ /darbuotojams/kontaktai/ permanent; ...@@ -32,6 +32,7 @@ rewrite ^/darbo-paieska/klauskite\;/?$ /darbuotojams/kontaktai/ permanent;
rewrite ^/darbo-paieska/klauskite/?$ /darbuotojams/kontaktai/ permanent; rewrite ^/darbo-paieska/klauskite/?$ /darbuotojams/kontaktai/ permanent;
rewrite ^/kontaktai/?$ /darbuotojams/kontaktai/ permanent; rewrite ^/kontaktai/?$ /darbuotojams/kontaktai/ permanent;
rewrite ^/kontaktai/darbinimo-agenturos/?$ /darbuotojams/kontaktai/ permanent; rewrite ^/kontaktai/darbinimo-agenturos/?$ /darbuotojams/kontaktai/ permanent;
rewrite ^/cv/?$ /darbuotojams/kontaktai/ permanent;
# --- Darbdaviams --- # --- Darbdaviams ---
# rewrite ^/personalo-nuoma/vasarosdarbubankas/?$ / permanent; # rewrite ^/personalo-nuoma/vasarosdarbubankas/?$ / permanent;
......
...@@ -126,6 +126,32 @@ class Biuro_Contacts_Public { ...@@ -126,6 +126,32 @@ class Biuro_Contacts_Public {
return $output; return $output;
} // employees_form() } // employees_form()
/**
* Processes shortcode biuro-contacts--employees
*
* @param array $attr The attributes from the shortcode
*
* @return mixed $output Output of the buffer
*/
public function employees_quick_form( $attr = array() ) {
$response = false;
ob_start();
if ( isset( $_POST['action-submit'] ) ) :
$response = true;
endif;
include 'partials/biuro-contacts-public--employees-2-steps.php';
$output = ob_get_contents();
ob_end_clean();
return $output;
} // employees_form()
/** /**
* Processes shortcode biuro-contacts--employers * Processes shortcode biuro-contacts--employers
* *
...@@ -184,6 +210,8 @@ class Biuro_Contacts_Public { ...@@ -184,6 +210,8 @@ class Biuro_Contacts_Public {
*/ */
public function register_shortcodes() { public function register_shortcodes() {
add_shortcode( 'biuro-contacts--employees-quick', array( $this, 'employees_quick_form' ) );
add_shortcode( 'biuro-contacts--employees', array( $this, 'employees_form' ) ); add_shortcode( 'biuro-contacts--employees', array( $this, 'employees_form' ) );
add_shortcode( 'biuro-contacts--employers', array( $this, 'employers_form' ) ); add_shortcode( 'biuro-contacts--employers', array( $this, 'employers_form' ) );
......
<?php
/**
* Provide a public-facing view for the plugin
*
* This file is used to markup the public-facing aspects of the plugin.
*
* @link https://www.biuro.lt
* @since 1.0.0
*
* @package Biuro_Contacts
* @subpackage Biuro_Contacts/public/partials
*/
?>
<form action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method="post" enctype="multipart/form-data" class="c-form">
<div class="c-form--row">
<label class="c-form--label" for="form-name">Name, Surname*</label>
<div class="c-form--input-wrap">
<input type="text" class="c-form--input <?php if ($response) { echo 'c-form--input--error'; } ?>" id="form-name" name="name" value="">
</div>
<div class="c-form--validation-error">
Name and Surname is required
</div>
</div><!-- .c-form--row -->
<div class="c-form--row">
<label class="c-form--label" for="form-phone">Phone no.*</label>
<div class="c-form--input-wrap">
<input type="tel" class="c-form--input <?php if ($response) { echo 'c-form--input--error'; } ?>" id="form-phone" name="phone" value="">
</div>
<div class="c-form--validation-error">
Phone number is required
</div>
</div><!-- .c-form--row -->
<div class="c-form--row">
<label class="c-form--label" for="form-email">Email address*</label>
<div class="c-form--input-wrap">
<input type="email" class="c-form--input <?php if ($response) { echo 'c-form--input--error'; } ?>" id="form-email" name="email" value="">
</div>
<div class="c-form--validation-error">
Email address is required
</div>
</div><!-- .c-form--row -->
<div class="c-form--row">
<div class="c-form--submit-wrap">
<button type="submit" class="c-form--submit" name="submit" value="1">Submit</button>
</div>
</div><!-- .c-form--row -->
<div class="c-form--row">
<div class="c-form--checkbox-wrap">
<input id="form-agree" type="checkbox" class="c-form--checkbox <?php if ($response) { echo 'c-form--checkbox--error'; } ?>" name="agree" value="1">
<label class="c-form--label-checkbox" for="form-agree">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem possimus, delectus unde enim dolores doloribus, recusandae a veritatis ducimus repudiandae iste eos voluptatum architecto mollitia?</label>
</div>
<div class="c-form--validation-error">
You have to agree with conditions
</div>
</div><!-- .c-form--row -->
</form>
<?php
/*
Plugin Name: Biuro Feedbacks
Description: Biuro Feedbacks plugin
Author: Biuro
Version: 1.0
Author URI: https://www.biuro.lt/
*/
class Biuro_Feedbacks extends WP_Widget {
// Main constructor
public function __construct() {
parent::__construct(
'biuro-feedbacks',
__( 'Biuro Feedbacks | Biuro', 'biuro' ),
array(
'customize_selective_refresh' => true,
)
);
}
// The widget form (for the backend )
public function form( $instance ) {
// Set widget defaults
$defaults = array(
'name1' => '',
'img1' => '',
'feedback1' => '',
'name2' => '',
'img2' => '',
'feedback2' => '',
'name3' => '',
'img3' => '',
'feedback3' => '',
'name4' => '',
'img4' => '',
'feedback4' => '',
'name5' => '',
'img5' => '',
'feedback5' => '',
'name6' => '',
'img6' => '',
'feedback6' => '',
'name7' => '',
'img7' => '',
'feedback7' => '',
'name8' => '',
'img8' => '',
'feedback8' => '',
);
// Parse current settings with defaults
extract( wp_parse_args( ( array ) $instance, $defaults ) ); ?>
<?php
for ($i = 1; $i <= 8; $i++):
?>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'name' . $i ) ); ?>"><?php _e( 'Name', 'biuro' ); ?><?php echo ' ' . $i . ':'; ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'name' . $i ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'name' . $i ) ); ?>" type="text" name="<?php echo esc_attr( ${'name' . $i} ); ?>" />
</p>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'img' . $i ) ); ?>"><?php _e( 'Image', 'biuro' ); ?><?php echo ' ' . $i . ':'; ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'img' . $i ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'img' . $i ) ); ?>" type="text" name="<?php echo esc_attr( ${'img' . $i} ); ?>" />
</p>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'feedback' . $i ) ); ?>"><?php _e( 'Feedback', 'biuro' ); ?><?php echo ' ' . $i . ':'; ?></label>
<textarea class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'feedback' . $i ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'feedback' . $i ) ); ?>" rows="4"><?php echo wp_kses_post( ${'feedback' . $i} ); ?></textarea>
</p>
<?php
endfor;
?>
<?php }
// Update widget settings
public function update( $new_instance, $old_instance ) {
$instance = $old_instance;
for ($i = 1; $i <= 8; $i++):
$instance['name' . $i] = isset( $new_instance['name' . $i] ) ? wp_strip_all_tags( $new_instance['name' . $i] ) : '';
$instance['img' . $i] = isset( $new_instance['img' . $i] ) ? wp_strip_all_tags( $new_instance['img' . $i] ) : '';
$instance['feedback' . $i] = isset( $new_instance['feedback' . $i] ) ? wp_kses_post( $new_instance['feedback' . $i] ) : '';
endfor;
return $instance;
}
// Display the widget
public function widget( $args, $instance ) {
extract( $args );
for ($i = 1; $i <= 8; $i++):
${'name' . $i} = isset( $instance['name' . $i] ) ?$instance['name' . $i] : '';
${'img' . $i} = isset( $instance['img' . $i] ) ?$instance['img' . $i] : '';
${'feedback' . $i} = isset( $instance['feedback' . $i] ) ?$instance['feedback' . $i] : '';
endfor;
// WordPress core before_widget hook (always include )
echo $before_widget;
// Display the widget
echo '<div class="c-biuro-feedbacks">';
for ($i = 1; $i <= 8; $i++):
if ( ${'name' . $i} ) {
echo '<h3>' . ${'name' . $i} . ${'img' . $i} . '</h3>';
}
if ( ${'feedback' . $i} ) {
echo '<p>' . ${'feedback' . $i} . '</p>';
}
endfor;
echo '</div>';
// WordPress core after_widget hook (always include )
echo $after_widget;
}
}
// register Biuro_Feedbacks
add_action( 'widgets_init', function(){
register_widget( 'Biuro_Feedbacks' );
});
<?php
/*
Plugin Name: Biuro Sections
Description: Biuro Sections plugin
Author: Biuro
Version: 1.0
Author URI: https://www.biuro.lt/
*/
class Biuro_Sections extends WP_Widget {
// Main constructor
public function __construct() {
parent::__construct(
'biuro-sections',
__( 'Biuro Sections | Biuro', 'biuro' ),
array(
'customize_selective_refresh' => true,
)
);
}
// The widget form (for the backend )
public function form( $instance ) {
// Set widget defaults
$defaults = array(
'title1' => '',
'img1' => '',
'description1' => '',
'content1' => '',
'title2' => '',
'img2' => '',
'description2' => '',
'content2' => '',
'title3' => '',
'img3' => '',
'description3' => '',
'content3' => '',
'title4' => '',
'img4' => '',
'description4' => '',
'content4' => '',
'title5' => '',
'img5' => '',
'description5' => '',
'content5' => '',
'title6' => '',
'img6' => '',
'description6' => '',
'content6' => '',
'title7' => '',
'img7' => '',
'description7' => '',
'content7' => '',
'title8' => '',
'img8' => '',
'description8' => '',
'content8' => '',
);
// Parse current settings with defaults
extract( wp_parse_args( ( array ) $instance, $defaults ) ); ?>
<?php
for ($i = 1; $i <= 8; $i++):
?>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'title' . $i ) ); ?>"><?php _e( 'Title', 'biuro' ); ?><?php echo ' ' . $i . ':'; ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' . $i ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' . $i ) ); ?>" type="text" value="<?php echo esc_attr( ${'title' . $i} ); ?>" />
</p>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'img' . $i ) ); ?>"><?php _e( 'Image', 'biuro' ); ?><?php echo ' ' . $i . ':'; ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'img' . $i ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'img' . $i ) ); ?>" type="text" value="<?php echo esc_attr( ${'img' . $i} ); ?>" />
</p>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'description' . $i ) ); ?>"><?php _e( 'Description', 'biuro' ); ?><?php echo ' ' . $i . ':'; ?></label>
<textarea class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'description' . $i ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'description' . $i ) ); ?>" rows="4"><?php echo wp_kses_post( ${'description' . $i} ); ?></textarea>
</p>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'content' . $i ) ); ?>"><?php _e( 'Section', 'biuro' ); ?><?php echo ' ' . $i . ':'; ?></label>
<textarea class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'content' . $i ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'content' . $i ) ); ?>" rows="4"><?php echo wp_kses_post( ${'content' . $i} ); ?></textarea>
</p>
<hr>
<?php
endfor;
?>
<?php }
// Update widget settings
public function update( $new_instance, $old_instance ) {
$instance = $old_instance;
for ($i = 1; $i <= 8; $i++):
$instance['title' . $i] = isset( $new_instance['title' . $i] ) ? wp_strip_all_tags( $new_instance['title' . $i] ) : '';
$instance['img' . $i] = isset( $new_instance['img' . $i] ) ? wp_strip_all_tags( $new_instance['img' . $i] ) : '';
$instance['description' . $i] = isset( $new_instance['description' . $i] ) ? wp_kses_post( $new_instance['description' . $i] ) : '';
$instance['content' . $i] = isset( $new_instance['content' . $i] ) ? wp_kses_post( $new_instance['content' . $i] ) : '';
endfor;
return $instance;
}
// Display the widget
public function widget( $args, $instance ) {
extract( $args );
for ($i = 1; $i <= 8; $i++):
${'title' . $i} = isset( $instance['title' . $i] ) ?$instance['title' . $i] : '';
${'img' . $i} = isset( $instance['img' . $i] ) ?$instance['img' . $i] : '';
${'description' . $i} = isset( $instance['description' . $i] ) ?$instance['description' . $i] : '';
${'content' . $i} = isset( $instance['content' . $i] ) ?$instance['content' . $i] : '';
endfor;
// WordPress core before_widget hook (always include )
echo $before_widget;
// Display the widget
echo '<div class="c-biuro-sections">';
for ($i = 1; $i <= 8; $i++):
if ( ${'title' . $i} ) {
echo '<h3>' . ${'title' . $i} . ' (img: ' . ${'img' . $i} . ')</h3>';
}
if ( ${'description' . $i} ) {
echo '<div>' . ${'description' . $i} . '</div>';
}
if ( ${'content' . $i} ) {
echo '<div>' . ${'content' . $i} . '</div>';
}
endfor;
echo '</div>';
// WordPress core after_widget hook (always include )
echo $after_widget;
}
}
// register Biuro_Sections
add_action( 'widgets_init', function(){
register_widget( 'Biuro_Sections' );
});
<?php
/*
Plugin Name: Biuro Services
Description: Biuro Services plugin
Author: Biuro
Version: 1.0
Author URI: https://www.biuro.lt/
*/
class Biuro_Services extends WP_Widget {
// Main constructor
public function __construct() {
parent::__construct(
'biuro-services',
__( 'Biuro Services | Biuro', 'biuro' ),
array(
'customize_selective_refresh' => true,
)
);
}
// The widget form (for the backend )
public function form( $instance ) {
// Set widget defaults
$defaults = array(
'title1' => '',
'position1' => '',
'content1' => '',
'title2' => '',
'position2' => '',
'content2' => '',
'title3' => '',
'position3' => '',
'content3' => '',
'title4' => '',
'position4' => '',
'content4' => '',
'title5' => '',
'position5' => '',
'content5' => '',
'title6' => '',
'position6' => '',
'content6' => '',
'title7' => '',
'position7' => '',
'content7' => '',
'title8' => '',
'position8' => '',
'content8' => '',
);
// Parse current settings with defaults
extract( wp_parse_args( ( array ) $instance, $defaults ) ); ?>
<?php
for ($i = 1; $i <= 8; $i++):
?>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'title' . $i ) ); ?>"><?php _e( 'Title', 'biuro' ); ?><?php echo ' ' . $i . ':'; ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' . $i ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' . $i ) ); ?>" type="text" value="<?php echo esc_attr( ${'title' . $i} ); ?>" />
</p>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'position' . $i ) ); ?>"><?php _e( 'Position', 'biuro' ); ?><?php echo ' ' . $i . ':'; ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'position' . $i ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'position' . $i ) ); ?>" type="text" value="<?php echo esc_attr( ${'position' . $i} ); ?>" />
</p>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'content' . $i ) ); ?>"><?php _e( 'Services', 'biuro' ); ?><?php echo ' ' . $i . ':'; ?></label>
<textarea class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'content' . $i ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'content' . $i ) ); ?>" rows="4"><?php echo wp_kses_post( ${'content' . $i} ); ?></textarea>
</p>
<?php
endfor;
?>
<?php }
// Update widget settings
public function update( $new_instance, $old_instance ) {
$instance = $old_instance;
for ($i = 1; $i <= 8; $i++):
$instance['title' . $i] = isset( $new_instance['title' . $i] ) ? wp_strip_all_tags( $new_instance['title' . $i] ) : '';
$instance['position' . $i] = isset( $new_instance['position' . $i] ) ? wp_strip_all_tags( $new_instance['position' . $i] ) : '';
$instance['content' . $i] = isset( $new_instance['content' . $i] ) ? wp_kses_post( $new_instance['content' . $i] ) : '';
endfor;
return $instance;
}
// Display the widget
public function widget( $args, $instance ) {
extract( $args );
for ($i = 1; $i <= 8; $i++):
${'title' . $i} = isset( $instance['title' . $i] ) ?$instance['title' . $i] : '';
${'position' . $i} = isset( $instance['position' . $i] ) ?$instance['position' . $i] : '';
${'content' . $i} = isset( $instance['content' . $i] ) ?$instance['content' . $i] : '';
endfor;
// WordPress core before_widget hook (always include )
echo $before_widget;
// Display the widget
echo '<div class="c-biuro-services">';
for ($i = 1; $i <= 8; $i++):
if ( ${'title' . $i} ) {
echo '<h3>' . ${'title' . $i} . ${'position' . $i} . '</h3>';
}
if ( ${'content' . $i} ) {
echo '<p>' . ${'content' . $i} . '</p>';
}
endfor;
echo '</div>';
// WordPress core after_widget hook (always include )
echo $after_widget;
}
}
// register Biuro_Services
add_action( 'widgets_init', function(){
register_widget( 'Biuro_Services' );
});
<?php
/*
Plugin Name: Biuro Values
Description: Biuro Values plugin
Author: Biuro
Version: 1.0
Author URI: https://www.biuro.lt/
*/
class Biuro_Values extends WP_Widget {
// Main constructor
public function __construct() {
parent::__construct(
'biuro-values',
__( 'Biuro Values | Biuro', 'biuro' ),
array(
'customize_selective_refresh' => true,
)
);
}
// The widget form (for the backend )
public function form( $instance ) {
// Set widget defaults
$defaults = array(
'value1' => '',
'content1' => '',
'value2' => '',
'content2' => '',
'value3' => '',
'content3' => '',
'value4' => '',
'content4' => '',
'value5' => '',
'content5' => '',
'value6' => '',
'content6' => '',
'value7' => '',
'content7' => '',
'value8' => '',
'content8' => '',
);
// Parse current settings with defaults
extract( wp_parse_args( ( array ) $instance, $defaults ) ); ?>
<?php
for ($i = 1; $i <= 8; $i++):
?>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'value' . $i ) ); ?>"><?php _e( 'Value', 'biuro' ); ?><?php echo ' ' . $i . ':'; ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'value' . $i ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'value' . $i ) ); ?>" type="text" value="<?php echo esc_attr( ${'value' . $i} ); ?>" />
</p>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'content' . $i ) ); ?>"><?php _e( 'Content', 'biuro' ); ?><?php echo ' ' . $i . ':'; ?></label>
<textarea class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'content' . $i ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'content' . $i ) ); ?>" rows="4"><?php echo wp_kses_post( ${'content' . $i} ); ?></textarea>
</p>
<?php
endfor;
?>
<?php }
// Update widget settings
public function update( $new_instance, $old_instance ) {
$instance = $old_instance;
for ($i = 1; $i <= 8; $i++):
$instance['value' . $i] = isset( $new_instance['value' . $i] ) ? wp_strip_all_tags( $new_instance['value' . $i] ) : '';
$instance['content' . $i] = isset( $new_instance['content' . $i] ) ? wp_kses_post( $new_instance['content' . $i] ) : '';
endfor;
return $instance;
}
// Display the widget
public function widget( $args, $instance ) {
extract( $args );
for ($i = 1; $i <= 8; $i++):
${'value' . $i} = isset( $instance['value' . $i] ) ?$instance['value' . $i] : '';
${'content' . $i} = isset( $instance['content' . $i] ) ?$instance['content' . $i] : '';
endfor;
// WordPress core before_widget hook (always include )
echo $before_widget;
// Display the widget
echo '<div class="c-biuro-values">';
for ($i = 1; $i <= 8; $i++):
if ( ${'value' . $i} ) {
echo '<h3>' . ${'value' . $i} . '</h3>';
}
if ( ${'content' . $i} ) {
echo '<p>' . ${'content' . $i} . '</p>';
}
endfor;
echo '</div>';
// WordPress core after_widget hook (always include )
echo $after_widget;
}
}
// register Biuro_Values
add_action( 'widgets_init', function(){
register_widget( 'Biuro_Values' );
});
...@@ -30,6 +30,8 @@ class JobsImporter ...@@ -30,6 +30,8 @@ class JobsImporter
'comment_status' => 'closed' 'comment_status' => 'closed'
]; ];
protected $primaryTerms = [];
public function __construct($data) public function __construct($data)
{ {
$this->data = $data; $this->data = $data;
...@@ -74,6 +76,8 @@ class JobsImporter ...@@ -74,6 +76,8 @@ class JobsImporter
foreach ($this->data as $ad) { foreach ($this->data as $ad) {
$this->primaryTerms = [];
// Set language code // Set language code
$lang = $this->getAdLang($ad); $lang = $this->getAdLang($ad);
// Set relations mapping // Set relations mapping
...@@ -94,12 +98,6 @@ class JobsImporter ...@@ -94,12 +98,6 @@ class JobsImporter
$relations $relations
); );
// if ($ad['properties'][$this->primaryKey] == 14531) {
//
// var_dump($ad);
// var_dump($adData);
// }
// Unique key of post // Unique key of post
$primaryKey = $adData[$this->primaryKey]; $primaryKey = $adData[$this->primaryKey];
...@@ -118,6 +116,7 @@ class JobsImporter ...@@ -118,6 +116,7 @@ class JobsImporter
print_r("Error while updating record ($this->idKey: $primaryKey). Error: $e->getMessage()<br>"); print_r("Error while updating record ($this->idKey: $primaryKey). Error: $e->getMessage()<br>");
} }
} else { } else {
try { try {
...@@ -132,6 +131,11 @@ class JobsImporter ...@@ -132,6 +131,11 @@ class JobsImporter
print_r("Error while creating record ($this->primaryKey: $primaryKey). Error: $e->getMessage()<br>"); print_r("Error while creating record ($this->primaryKey: $primaryKey). Error: $e->getMessage()<br>");
} }
} }
foreach ($this->primaryTerms as $term => $termKey) {
update_post_meta($podId, "_yoast_wpseo_primary_{$term}", $termKey);
}
} }
} }
...@@ -147,9 +151,23 @@ class JobsImporter ...@@ -147,9 +151,23 @@ class JobsImporter
{ {
$result = []; $result = [];
foreach ($terms as $termKey => $termData) { foreach ($terms as $termKey => $termsData) {
$slug = $this->getSlug($termKey, $termData, $lang); foreach ($termsData as $key => $data) {
$result[$termKey] = $this->getTerm($termKey, $slug, $termData['name'], $lang);
$primTerm = false;
if (isset($data['__primary'])) {
$primTerm = true;
unset($data['__primary']);
}
$data['slug'] = $this->getSlug($termKey, $data, $lang);
$term = $this->getTerm($termKey, $data, $lang);
$result[$termKey][] = $term;
if ($primTerm) {
$this->primaryTerms[$termKey] = $term;
}
}
} }
return $result; return $result;
...@@ -195,42 +213,35 @@ class JobsImporter ...@@ -195,42 +213,35 @@ class JobsImporter
/** /**
* Find and return taxonomy id, if not exist, create it * Find and return taxonomy id, if not exist, create it
* *
* @param string $key Taxonomy key name * @param string $key Taxonomy key name
* @param string $slug Taxonomy slug0 * @param $data
* @param string $value Taxonomy name
* @param string $lang Taxonomy language code * @param string $lang Taxonomy language code
* *
* @return int Taxonomy id * @return int Taxonomy id
*/ */
private function getTerm($key, $slug, $value, $lang) private function getTerm($key, $data, $lang)
{ {
$term = pods($key, $slug); $term = pods($key, $data['slug']);
if (!$term->exists()) { if (!$term->exists()) {
try { try {
$termId = pods($key)->add([ $termId = pods($key)->add($data);
'name' => $value,
'slug' => $slug,
]);
} catch (Exception $e) { } catch (Exception $e) {
print_r("Error while creating taxonomies ($key => $slug). Error: $e->getMessage()<br>"); print_r("Error while creating taxonomies ($key => $data[slug]). Error: $e->getMessage()<br>");
} }
} else { } else {
try { try {
$termId = $term->save([ $termId = $term->save($data);
'name' => $value,
'slug' => $slug,
]);
} catch (Exception $e) { } catch (Exception $e) {
print_r("Error while updating taxonomies ($key => $slug). Error: $e->getMessage()<br>"); print_r("Error while updating taxonomies ($key => $data[slug]). Error: $e->getMessage()<br>");
} }
} }
......
...@@ -12,30 +12,41 @@ class JsonDataCollector ...@@ -12,30 +12,41 @@ class JsonDataCollector
'title' => 'pareigos', 'title' => 'pareigos',
'post_content' => 'aprasymas', 'post_content' => 'aprasymas',
'slug' => 'seo_url', 'slug' => 'seo_url',
'contact' => 'kontaktai', 'contact' => 'contacts',
// 'email' => 'email', 'salary_from' => 'atlygis_nuo',
// 'work_time' => 'darbo_laikas', 'salary_to' => 'atlygis_iki',
'video_url' => 'video_url',
]; ];
// Taxonomies data map // Taxonomies data map
protected $terms = [ protected $terms = [
'city' => [ 'city' => [
'slug' => 'miestas_id', 'slug' => 'miestas_id',
'name' => 'regionas' 'name' => 'regionas',
'__primary' => true,
'additionalCities' => [
'slug' => 'city_id',
'name' => 'city',
]
], ],
'field' => [ 'field' => [
'slug' => 'kategorija', 'slug' => 'kategorija',
'name' => 'sritis' 'name' => 'sritis',
'__primary' => true,
'additionalCategories' => [
'slug' => 'category_id',
'name' => 'category_name',
]
], ],
'company' => [ 'company' => [
'name' => 'imone' 'name' => 'imone'
], ],
'type' => [ 'type' => [
'slug' => 'type', 'types' => [
'name' => 'type' 'slug' => 'type_id',
] 'name' => 'type_name'
// 'tag' ]
// 'position', ],
]; ];
// Custom posts data map // Custom posts data map
...@@ -43,7 +54,7 @@ class JsonDataCollector ...@@ -43,7 +54,7 @@ class JsonDataCollector
'division' => [ 'division' => [
'title' => 'padalinys_name', 'title' => 'padalinys_name',
'slug' => 'padalinys' 'slug' => 'padalinys'
] ],
]; ];
// Language map // Language map
...@@ -95,7 +106,6 @@ class JsonDataCollector ...@@ -95,7 +106,6 @@ class JsonDataCollector
], ],
]); ]);
$json = file_get_contents($source, false, $context); $json = file_get_contents($source, false, $context);
return json_decode($json); return json_decode($json);
} }
...@@ -121,24 +131,6 @@ class JsonDataCollector ...@@ -121,24 +131,6 @@ class JsonDataCollector
$item['posts'] = $this->getPosts($ad); $item['posts'] = $this->getPosts($ad);
$item['relations'] = $this->relationsMap; $item['relations'] = $this->relationsMap;
// foreach ($this->dataMap as $mapKey => $dataKey) {
// $dataValue = $ad->{$dataKey};
// $itemValue = $this->getValue($dataValue);
// $postValue = $this->getValue($dataValue);
// $item[$mapKey] = $itemValue;
//
//// if (array_key_exists($mapKey, $this->relationsMap)) {
//// $item['related_items'][$mapKey] = $this->relationsMap[$mapKey];
//// }
// }
//
// foreach ($this->relationsMap as $keyItem => $valueItem) {
// if (array_key_exists($keyItem, $item) && array_key_exists($valueItem, $item)) {
// $item[$valueItem] = [$valueItem . '_' . $item[$keyItem] => $item[$valueItem]];
// unset($item[$keyItem]);
// }
// }
$result[] = $item; $result[] = $item;
}; };
...@@ -164,10 +156,25 @@ class JsonDataCollector ...@@ -164,10 +156,25 @@ class JsonDataCollector
$result = []; $result = [];
foreach ($this->terms as $termKey => $termProperties) { foreach ($this->terms as $termKey => $termProperties) {
foreach ($termProperties as $propertyKey => $propertyValue) {
if (isset($ad->{$propertyValue})) { $entity = $this->getEntity($ad, $termProperties);
$dataValue = $ad->{$propertyValue};
$result[$termKey][$propertyKey] = $this->getValue($dataValue);
if ( ! empty($entity)) {
$result[$termKey][] = $entity;
}
$appends = array_filter($termProperties, function($item) {
return is_array($item);
});
foreach ($appends as $propertyKey => $propertyValues) {
if (isset($ad->{$propertyKey})) {
foreach ($ad->{$propertyKey} as $data) {
$result[$termKey][] = $this->getEntity($data, $propertyValues);
}
} }
} }
} }
...@@ -175,6 +182,26 @@ class JsonDataCollector ...@@ -175,6 +182,26 @@ class JsonDataCollector
return $result; return $result;
} }
private function getEntity($ad, $propertyMap)
{
$entity = [];
foreach ($propertyMap as $propertyKey => $propertyValue) {
if ( ! is_array($propertyValue)) {
if (preg_match('/^\_\_/', $propertyKey)) {
$entity[$propertyKey] = $propertyValue;
}
elseif (isset($ad->{$propertyValue})) {
$dataValue = $ad->{$propertyValue};
$entity[$propertyKey] = $this->getValue($dataValue);
}
}
}
return $entity;
}
private function getPosts($ad) private function getPosts($ad)
{ {
$result = []; $result = [];
......
...@@ -51,6 +51,7 @@ function do_import() ...@@ -51,6 +51,7 @@ function do_import()
if ($env === 'dev') { if ($env === 'dev') {
// $inputFile = plugin_dir_path(__FILE__) . "source_data/wp_biuro.php.xml"; // $inputFile = plugin_dir_path(__FILE__) . "source_data/wp_biuro.php.xml";
$inputFile = "https://base.biuro.lt/_export/wp_biuro.php"; $inputFile = "https://base.biuro.lt/_export/wp_biuro.php";
$inputFile = "https://base.biuro.lt/_export/new_wp.php";
} elseif ($env === 'prod') { } elseif ($env === 'prod') {
$inputFile = "http://export.biuro.lt/wp_biuro.php"; $inputFile = "http://export.biuro.lt/wp_biuro.php";
} }
...@@ -75,6 +76,7 @@ function do_import() ...@@ -75,6 +76,7 @@ function do_import()
// JSON reader // JSON reader
$ads = (new JsonDataCollector($inputFile))->getData(); $ads = (new JsonDataCollector($inputFile))->getData();
// print_r($ads);
print_r("Found " . count($ads) . " ads from Biuro.<br>"); print_r("Found " . count($ads) . " ads from Biuro.<br>");
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
/* critical:end */ /* critical:end */
.pods-pagination-paginate { display: block; padding-bottom: 1em; text-align: center; } .pods-pagination-paginate { display: block; padding-bottom: 1em; }
.page-numbers { margin: 0 1px; padding: 1px; .page-numbers { margin: 0 1px; padding: 1px;
&.current { font-weight: var(--typo--weight-bold); } &.current { font-weight: var(--typo--weight-bold); }
......
This diff is collapsed.
This diff is collapsed.
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
<footer class="l-footer"> <footer class="l-footer">
<br> <br>
<br> <br>
...@@ -125,5 +124,6 @@ document.querySelectorAll('.js-job-action').forEach(function (node) { ...@@ -125,5 +124,6 @@ document.querySelectorAll('.js-job-action').forEach(function (node) {
</script> </script>
<script src="/wp-content/themes/biuro/js/main-a9a206ea.min.js" async></script> <script src="/wp-content/themes/biuro/js/main-a9a206ea.min.js" async></script>
<?php wp_footer(); ?>
</body> </body>
</html> </html>
...@@ -55,9 +55,13 @@ ...@@ -55,9 +55,13 @@
<p><a href="/darbo-pasiulymai/" style="color: blue">Daugiau darbo skelbimų</a></p> <p><a href="/darbo-pasiulymai/" style="color: blue">Daugiau darbo skelbimų</a></p>
<br> <br>
<h2>Darbdaviams</h2>
<p>Bendradarbiaukime ir raskime geriausią sprendimą kartu, o jo įvykdymą patikėkite BIURO profesionalams. Ieškote darbuotojų? <a href="/kontaktai/personalo-nuomai/" style="color: blue">užpildykite užklausos formą</a> ir mes su Jumis susisieksime.</p>
<?php
if ( is_active_sidebar( 'front_page_values' ) ) :
dynamic_sidebar( 'front_page_values' );
endif;
?>
<br> <br>
...@@ -74,6 +78,17 @@ ...@@ -74,6 +78,17 @@
</div> </div>
<br> <br>
<br>
<div style="border: 1px solid red">
<?php
if ( is_active_sidebar( 'front_page_employees' ) ) :
dynamic_sidebar( 'front_page_employees' );
endif;
?>
<?php
echo do_shortcode('[biuro-contacts--employees-quick]');
?>
</div>
<?php get_footer(); <?php get_footer();
...@@ -96,15 +96,47 @@ function my_deregister_scripts(){ ...@@ -96,15 +96,47 @@ function my_deregister_scripts(){
} }
add_action( 'wp_footer', 'my_deregister_scripts' ); add_action( 'wp_footer', 'my_deregister_scripts' );
/** /**
* Register our sidebars and widgetized areas. * Register our sidebars and widgetized areas.
*/ */
function biuro_widger_areas() { function biuro_widger_areas() {
unregister_widget('Akismet_Widget');
unregister_widget('WP_Widget_Archives');
unregister_widget('WP_Widget_Media_Audio');
unregister_widget('WP_Widget_Calendar');
unregister_widget('WP_Widget_Categories');
unregister_widget('WP_Widget_Media_Gallery');
unregister_widget('WP_Widget_Media_Image');
// unregister_widget('WP_Widget_Gallery');
unregister_widget('WP_Widget_Pages');
// unregister_widget('WP_Widget_Links');
unregister_widget('WP_Widget_Meta');
unregister_widget('WP_Nav_Menu_Widget');
unregister_widget('WP_Widget_Search');
unregister_widget('WP_Widget_Text');
unregister_widget('WP_Widget_Recent_Posts');
unregister_widget('WP_Widget_Recent_Comments');
unregister_widget('WP_Widget_RSS');
unregister_widget('WP_Widget_Tag_Cloud');
// unregister_widget('Twenty_Eleven_Ephemera_Widget');
unregister_widget('WP_Widget_Media_Video');
// unregister_widget('WP_Widget_Custom_HTML');
unregister_widget('PLL_Widget_Calendar');
unregister_widget('PLL_Widget_Languages');
unregister_widget('PodsWidgetSingle');
unregister_widget('PodsWidgetList');
unregister_widget('PodsWidgetField');
unregister_widget('PodsWidgetForm');
unregister_widget('PodsWidgetView');
// unregister_widget('WP_Widget_Tag_Cloud');
register_sidebar( array( register_sidebar( array(
'name' => 'Footer area', 'name' => 'Global: Footer area',
'id' => 'footer_main', 'id' => 'footer_main',
'before_widget' => '', 'before_widget' => '',
'after_widget' => '', 'after_widget' => '',
...@@ -113,20 +145,87 @@ function biuro_widger_areas() { ...@@ -113,20 +145,87 @@ function biuro_widger_areas() {
) ); ) );
register_sidebar( array( register_sidebar( array(
'name' => 'Content append area', 'name' => 'Global: Content append area',
'id' => 'append_area', 'id' => 'append_area',
'before_widget' => '', 'before_widget' => '',
'after_widget' => '', 'after_widget' => '',
'before_title' => '', 'before_title' => '',
'after_title' => '', 'after_title' => '',
) ); ) );
}
add_action( 'widgets_init', 'biuro_widger_areas' );
register_sidebar( array(
'name' => 'Front page: Feedbacks',
'id' => 'front_page_feedbacks',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
) );
register_sidebar( array(
'name' => 'Front page: Biuro values',
'id' => 'front_page_values',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
) );
register_sidebar( array(
'name' => 'Front page: Employees',
'id' => 'front_page_employees',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
) );
register_sidebar( array(
'name' => 'Sales page: Biuro services',
'id' => 'sales_page_services',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
) );
register_sidebar( array(
'name' => 'Sales page: Biuro values',
'id' => 'sales_page_values',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
) );
register_sidebar( array(
'name' => 'Sales page: Employers',
'id' => 'sales_page_employers',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
) );
register_sidebar( array(
'name' => 'Sales page: Sections',
'id' => 'sales_page_sections',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
) );
register_sidebar( array(
'name' => 'Sales page: Feedbacks',
'id' => 'sales_page_feedbacks',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
) );
}
add_action( 'widgets_init', 'biuro_widger_areas' );
/** /**
* Disable the emoji's * Disable the emoji's
...@@ -312,29 +411,6 @@ add_action('init', 'df_disable_comments_admin_bar'); ...@@ -312,29 +411,6 @@ add_action('init', 'df_disable_comments_admin_bar');
// require_once 'includes/disable_discussion'; // require_once 'includes/disable_discussion';
function getSiteTree($taxonomy)
{
$terms = get_terms( array(
'taxonomy' => $taxonomy,
'hide_empty' => false,
));
if ( !empty( $terms ) && ! is_wp_error( $terms ) ):
echo '<ul>';
foreach ( $terms as $term ):
$page = get_term_meta( $term->term_id, 'page-id', true);
if ( $page ) :
?>
<li><a href="<?php echo get_page_link( $page['ID'] ); ?>"><?php echo $page['post_title']; ?></a></li>
<?
endif;
endforeach;
echo '</ul>';
endif;
}
function getDivisions ( $request ) { function getDivisions ( $request ) {
$res = array(); $res = array();
......
...@@ -33,14 +33,14 @@ define('cityID', $cityID); ...@@ -33,14 +33,14 @@ define('cityID', $cityID);
<style><?php include 'css/core-a25434ed1d.min.css'; ?></style> <style><?php include 'css/core-a25434ed1d.min.css'; ?></style>
<link rel="preload" href="/wp-content/themes/biuro/css/main-8c9c954583.min.css" as="style" onload="this.rel='stylesheet'"> <link rel="preload" href="/wp-content/themes/biuro/css/main-dcf0970343.min.css" as="style" onload="this.rel='stylesheet'">
<link rel="preload" href="/wp-content/themes/biuro/fonts/pt_sans_narrow.woff2" as="font" type="font/woff2" crossorigin> <link rel="preload" href="/wp-content/themes/biuro/fonts/pt_sans_narrow.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/wp-content/themes/biuro/fonts/pt_sans_narrow_bold.woff2" as="font" type="font/woff2" crossorigin> <link rel="preload" href="/wp-content/themes/biuro/fonts/pt_sans_narrow_bold.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/wp-content/themes/biuro/fonts/bebas-neue.woff2" as="font" type="font/woff2" crossorigin> <link rel="preload" href="/wp-content/themes/biuro/fonts/bebas-neue.woff2" as="font" type="font/woff2" crossorigin>
<noscript> <noscript>
<link rel="stylesheet" href="/wp-content/themes/biuro/css/main-8c9c954583.min.css"> <link rel="stylesheet" href="/wp-content/themes/biuro/css/main-dcf0970343.min.css">
</noscript> </noscript>
<?php wp_head(); ?> <?php wp_head(); ?>
......
<?php
/**
* Template Name: Sales page
*
* The sales page template file
* Learn more: https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Biuro
* @since 1.0
* @version 1.0
*/
get_header();
?>
<?php
// while ( have_posts() ) :
// the_post();
// the_content();
// endwhile;
?>
<br>
<h1>Ieškote darbuotojų - galime padėti.</h1>
<h2 style="color:; red">Paslaugos</h2>
<?php
if ( is_active_sidebar( 'sales_page_services' ) ) :
dynamic_sidebar( 'sales_page_services' );
endif;
?>
<h2 style="color:; red">Vertės</h2>
<?php
if ( is_active_sidebar( 'sales_page_values' ) ) :
dynamic_sidebar( 'sales_page_values' );
endif;
?>
<h2>Mumis pasitiki</h2>
<div class="c-logos">
<div>1 logo</div>
<div>2 logo</div>
<div>3 logo</div>
<div>4 logo</div>
<div>5 logo</div>
<div>6 logo</div>
<div>7 logo</div>
</div>
<h2 style="color:; red">Sektoriai</h2>
<?php
if ( is_active_sidebar( 'sales_page_sections' ) ) :
dynamic_sidebar( 'sales_page_sections' );
endif;
?>
<h2 style="color:; red">Atsiliepimai</h2>
<?php
if ( is_active_sidebar( 'sales_page_feedbacks' ) ) :
dynamic_sidebar( 'sales_page_feedbacks' );
endif;
?>
<br>
<h2>Forma</h2>
<p>ToDo</p>
<br>
<br>
<?php get_footer();
This diff is collapsed.
...@@ -36,13 +36,19 @@ get_header(); ...@@ -36,13 +36,19 @@ get_header();
// delog( $pod->field( 'post_title' ) ); // delog( $pod->field( 'post_title' ) );
// delog( $pod->field( 'post_date' ) ); // delog( $pod->field( 'post_date' ) );
// delog( $pod->field( 'valid' ) ); // delog( $pod->field( 'valid' ) );
// debug( $pod ); // debug( $pod->field( 'salary_from' ) );
?> ?>
<p> <p>
Atlyginimas nuo: <?php echo $pod->field( 'salary_from' ); ?>
<br>
Atlyginimas iki: <?php echo $pod->field( 'salary_to' ); ?>
<br>
<br>
Paskelbta: <?php echo date_i18n( get_option( 'date_format' ), strtotime( $pod->field( 'post_date' ) ) ); ?> Paskelbta: <?php echo date_i18n( get_option( 'date_format' ), strtotime( $pod->field( 'post_date' ) ) ); ?>
<br> <br>
Galioja iki: <?php echo date_i18n( get_option( 'date_format' ), strtotime( $pod->field( 'valid' ) ) ); ?> Galioja iki: <?php echo date_i18n( get_option( 'date_format' ), strtotime( $pod->field( 'valid' ) ) ); ?>
</p> </p>
<br> <br>
...@@ -52,7 +58,10 @@ get_header(); ...@@ -52,7 +58,10 @@ get_header();
?> ?>
</div> </div>
<div id="action--share" style="border: 1px solid grey; margin-bottom: 20px; display: none;"> <div id="action--share" style="border: 1px solid grey; margin-bottom: 20px; display: none;">
<h1>Dalintis</h1> icon - FB messenger, <br>
icon - mail, <br>
icon - FB postas, <br>
icon - sms<br>
</div> </div>
<div class="c-fixed-footer" style="overflow: hidden; margin-bottom: 2rem;"> <div class="c-fixed-footer" style="overflow: hidden; margin-bottom: 2rem;">
...@@ -61,5 +70,3 @@ get_header(); ...@@ -61,5 +70,3 @@ get_header();
</div> </div>
<?php get_footer(); <?php get_footer();
// get_footer('job');
...@@ -15,7 +15,7 @@ global $jobs; ...@@ -15,7 +15,7 @@ global $jobs;
<table cellspacing="0" cellpadding="0" class="c-jobs-list"> <table cellspacing="0" cellpadding="0" class="c-jobs-list">
<tr> <tr>
<th class="c-jobs-list--head">Pozicija </th> <th class="c-jobs-list--head">Pozicija</th>
<th class="c-jobs-list--head">Vietovė</th> <th class="c-jobs-list--head">Vietovė</th>
<th class="c-jobs-list--head">Galioja iki</th> <th class="c-jobs-list--head">Galioja iki</th>
</tr> </tr>
...@@ -32,7 +32,22 @@ global $jobs; ...@@ -32,7 +32,22 @@ global $jobs;
</a> </a>
</td> </td>
<td class="c-jobs-list--col c-jobs-list--col-city"> <td class="c-jobs-list--col c-jobs-list--col-city">
<?php echo $jobs->display( 'city' ); ?> <?php
$cities = $jobs->field( 'city');
$count = 0;
foreach($cities as $city):
if ($count):
echo ', ';
endif;
echo $city['name'];
$count++;
endforeach;
// echo $jobs->display( 'city' );
?>
</td> </td>
<td class="c-jobs-list--col c-jobs-list--col-valid"> <td class="c-jobs-list--col c-jobs-list--col-valid">
<?php echo date_i18n( get_option( 'date_format' ), strtotime( $jobs->field( 'valid' ) ) ); ?> <?php echo date_i18n( get_option( 'date_format' ), strtotime( $jobs->field( 'valid' ) ) ); ?>
...@@ -49,8 +64,8 @@ global $jobs; ...@@ -49,8 +64,8 @@ global $jobs;
if ( !is_front_page() ): if ( !is_front_page() ):
echo $jobs->pagination( array( echo $jobs->pagination( array(
'type' => 'paginate' , 'type' => 'paginate' ,
'prev_text' => '‹ ' . pll__('Previous'), 'prev_text' => '',
'next_text' => pll__('Next') . ' ›' 'next_text' => ''
) ); ) );
endif; endif;
......
<?php
function getSiteTree($taxonomy)
{
$terms = get_terms( array(
'taxonomy' => $taxonomy,
'hide_empty' => false,
));
// debug($terms);
if ( !empty( $terms ) && ! is_wp_error( $terms ) ):
echo '<ul>';
$res = array();
foreach ( $terms as $term ):
$termID = $term->term_id;
$where = 'valid.meta_value > "' . date('Y-m-d', strtotime('-1 days')) . '" AND ' . $taxonomy . '.term_id = ' . $termID;
$params = array(
'where' => $where,
'limit' => -1
);
$jobsIn = pods( 'job', $params );
if ( 0 < $jobsIn->total() ):
$page = get_term_meta( $termID, 'page-id', true);
$order = intval(get_term_meta( $termID, 'order', true));
if ( $page && $page['post_status'] === 'publish') :
array_push($res, array(
'name' => $page['post_title'],
'href' => get_page_link( $page['ID'] ),
'order' => $order,
'total' => $jobsIn->total()
));
endif;
endif;
endforeach;
usort($res, function($a, $b) {
$o = $b['order'] - $a['order'];
if ($o):
return $o;
endif;
$t = $b['total'] - $a['total'];
if ($t):
return $t;
endif;
return $a['name'] > $b['name'];
});
foreach ( $res as $r ):
?>
<li><a href="<?php echo $r['href']; ?>" title="<?php echo $r['name']; ?>"><?php echo $r['name'] . ' (' . $r['total'] . ')'; ?></a></li>
<?php
endforeach;
echo '</ul>';
endif;
}
?>
<h3>Miestas</h3> <h3>Miestas</h3>
<div style="border: 1px solid #666; margin-right: 20px"> <div style="border: 1px solid #666; margin-right: 20px">
<?php <?php
......
...@@ -11,6 +11,10 @@ ...@@ -11,6 +11,10 @@
$main = ''; $main = '';
function isSubActive($childID, $ID) { function isSubActive($childID, $ID) {
if (!$ID) {
return false;
}
if ($childID == $ID) { if ($childID == $ID) {
return true; return true;
} }
......
...@@ -40,7 +40,13 @@ wp plugin update --all ...@@ -40,7 +40,13 @@ wp plugin update --all
# Activate plugin. # Activate plugin.
wp plugin activate akismet --network wp plugin activate akismet --network
wp plugin activate biuro-contacts --network wp plugin activate biuro-contacts --network
wp plugin activate biuro-feedbacks --network
wp plugin activate biuro-sections --network
wp plugin activate biuro-services --network
wp plugin activate biuro-values --network
wp plugin activate cookies-warning --network wp plugin activate cookies-warning --network
wp plugin activate data-controller --network wp plugin activate data-controller --network
# wp plugin activate jobs-importer # wp plugin activate jobs-importer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment