Commit 9f69191e authored by agnez's avatar agnez

map wip

parent ca9e9c5e
# Copyright (C) 2017 GASAP users
# This file is distributed under the same license as the GASAP users package.
msgid ""
msgstr ""
"Project-Id-Version: GASAP users 1.0\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/gasap-users\n"
"POT-Creation-Date: 2017-05-19 15:00:29+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2017-05-19 17:03+0100\n"
"Last-Translator: Lore <lore@mipsum.be>\n"
"Language-Team: \n"
"X-Generator: Poedit 1.6.10\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"Language: fr_FR\n"
#: gasap-users.php:152 gasap-users.php:153
msgid "super GASAPiens"
msgstr ""
#: gasap-users.php:154 gasap-users.php:155
msgid "GASAPiens"
msgstr ""
#. Plugin Name of the plugin/theme
msgid "GASAP users"
msgstr "GASAP utilisateurs"
#. Description of the plugin/theme
msgid "Plugin for the GASAP network, managing user roles and capabilities"
msgstr "Plugin pour le réseau des GASAP, gestion de rôles d'utilisateurs"
#. Author of the plugin/theme
msgid "Lore Mipsum"
msgstr ""
#. Author URI of the plugin/theme
msgid "http://mipsum.be/"
msgstr ""
......@@ -442,7 +442,7 @@ main .uk-container{
padding:10px;
width: 100%;
h2.uk-accordion-title{
h3.uk-accordion-title{
margin-bottom: 0;
background-color: white;
text-align: left;
......
<?php
if ((isset($workertype))=== false) { $workertype =''; }
if ($workertype != ''){
echo '<article id="snippet_noyau">';
}
else {
echo '<article id="snippet_employes">';
}?>
<div class="largeur1"><?php
if ($workertype != ''){
$termid = $workertype;
echo '<h2>'. esc_html( 'Les membres du noyau*', 'beans_gasap' ) .'</h2>';
echo '<div class="textecenter">'. esc_html( 'C&#39;est plus sympa que &#34;Conseil d&#39;Administration&#34;, non ?', 'beans_gasap' ) .'</div>';
}
else {
$termid = 90;
echo '<h2 class="espacer">'. esc_html( 'Les employés', 'beans_gasap' ) .'</h2>';
}
$loopworker = new WP_Query( array(
'post_type' => 'worker',
'order_by' => 'rand',
'tax_query' => array(
array(
'taxonomy' => 'workertype',
'field' => 'term_id',
'terms' => $termid //FIX
)
)
)); ?>
<div class="uk-grid"><?php
while ( $loopworker->have_posts() ) : $loopworker->the_post();?>
<div class="uk-width-1 uk-width-small-1-2 uk-width-medium-1-4"><?php
if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?>
<h3><?php the_title(); ?></h3>
<?php the_content(); ?>
<?php edit_post_link( esc_html__( 'Edit', 'beans_gasap' ), '<span class="edit-link">', '</span>' ); ?>
</div><?php
endwhile;
wp_reset_postdata();?>
</div>
</div>
</article>
<?php
wp_reset_postdata();
\ No newline at end of file
......@@ -227,6 +227,30 @@ function gasap_posts_info_window( $output, $post, $gmw ) {
}
add_filter( 'gmw_pt_dropdown_taxonomy_args', 'gasap_gmw_modify_taxonomy', 10, 3 );
function gasap_gmw_modify_taxonomy( $args, $gmw, $taxonomy ) {
//check that we are within form ID 1, otherwise do nothing
if ( $gmw['ID'] != 1 )
return $args;
//check that this is 'gasapday' taxonomy, otherwise do nothing
if ( $taxonomy->name != 'gasapday' )
return $args;
//modify the show_option_all of the taxonomy which is responsible
//of the default value of the drop-down select box
$args['orderby'] = 'slug';
$args['order'] = 'ASC';
//return the modifyed args
return $args;
}
add_filter( 'shortcode_atts_wpcf7', 'custom_shortcode_atts_wpcf7_filter', 10, 3 );
function custom_shortcode_atts_wpcf7_filter( $out, $pairs, $atts ) {
$attr_mailreferent = 'email-referent';
......@@ -239,4 +263,5 @@ function custom_shortcode_atts_wpcf7_filter( $out, $pairs, $atts ) {
return $out;
}
// -----------
<?php
/**
* PT Search form function - Posts, Pages post types dropdown.
* @version 1.0
* @author Eyal Fitoussi
*/
function gmw_pt_form_get_post_types_dropdown( $gmw, $title, $class, $all_label ) {
if ( empty( $gmw['search_form']['post_types'] ) )
$gmw['search_form']['post_types'] = array( 'post' );
if ( count( $gmw['search_form']['post_types'] ) == 1 ) {
$output = '<input type="hidden" id="gmw-single-post-type-' . $gmw['ID'] . '" class="gmw-single-post-type gmw-single-post-type-' . $gmw['ID'] . ' ' . $class . '" name="'.$gmw['url_px'].'post" value="'.implode( ' ', $gmw['search_form']['post_types'] ).'" />';
return apply_filters( 'gmw_form_single_post_types', $output, $gmw, $title, $class, $all_label );
}
if ( empty( $all_label ) )
$all_label = $gmw['labels']['search_form']['search_site'];
$output = '';
if ( isset( $gmw['search_form']['post_types_type'] ) && $gmw['search_form']['post_types_type'] == 'checkbox' ) {
$output .= '<span class="search-all">'.$all_label.'</span>';
$output .= '<ul class="post-types-checkboxes">';
foreach ( $gmw['search_form']['post_types'] as $post_type ) {
$pto = get_post_type_object( $post_type );
if ( empty( $pto ) )
continue;
if ( isset( $_GET[$gmw['url_px'].'post'] ) && $_GET[$gmw['url_px'].'post'] == $post_type ) {
$pti_post = 'checked="checked"';
} else {
$pti_post = "";
}
$output .= '<li id="gmw-'.$gmw['ID'].'-'.$post_type.'-post-type-cb-wrapper" class="post-type-checkbox-wrapper pt-'.$post_type.'">';
$output .= '<input type="checkbox" name="'.$gmw['url_px'].'post[]" id="gmw-'.$gmw['ID'].'-'.$post_type.'-post-type-cb" class="post-type-checkbox pt-'.$post_type.'" value="'.$post_type.'" '.$pti_post.' checked="checked">';
$output .= '<label for="gmw-'.$gmw['ID'].'-'.$post_type.'-post-type-cb">'.$pto->labels->name.'</label></li>';
}
} else {
if ( !empty( $title ) ) {
$output .= '<label for="gmw-posts-dropdown-'.$gmw['ID'].'">'.$title.'</label>';
}
$output .= '<select name="'.$gmw['url_px'].'post" id="gmw-posts-dropdown-' . $gmw['ID'] . '" class="gmw-posts-dropdown gmw-posts-dropdown-'.$gmw['ID'].' '.$class.'">';
$output .= '<option value="'.implode( ' ', $gmw['search_form']['post_types'] ).'">'.$all_label.'</option>';
foreach ( $gmw['search_form']['post_types'] as $post_type ) {
$pti_post = ( isset( $_GET[$gmw['url_px'].'post'] ) && $_GET[$gmw['url_px'].'post'] == $post_type ) ? 'selected="selected"' : '';
$output .= '<option value="'.$post_type.'" '.$pti_post.'>'.get_post_type_object( $post_type )->labels->name.'</option>';
}
$output .= '</select>';
}
return apply_filters( 'gmw_form_post_types', $output, $gmw, $title, $class, $all_label );
}
function gmw_pt_form_post_types_dropdown( $gmw, $title, $class, $all ) {
echo gmw_pt_form_get_post_types_dropdown( $gmw, $title, $class, $all );
}
/**
* PT search form function - Display taxonomies/categories
* @version 1.0
* @author Eyal Fitoussi
*/
function gmw_pt_get_form_taxonomies( $gmw, $tag, $class ) {
$tag = ( !empty( $tag ) ) ? $tag : 'div';
$class = ( !empty( $class ) ) ? $class : '';
$taxonomies = apply_filters( 'gmw_search_form_taxonomies', false, $gmw, $tag, $class );
if ( $taxonomies !== false )
return;
if ( count( $gmw['search_form']['post_types'] ) != 1 || ( !isset( $gmw['search_form']['taxonomies'] ) ) )
return;
$postType = $gmw['search_form']['post_types'][0];
if ( !isset($gmw['search_form']['taxonomies'][$postType] ) || empty( $gmw['search_form']['taxonomies'][$postType] ) )
return;
$output = '';
$orgTag = $tag;
if ( $tag == 'ul' || $tag == 'ol' ) {
$subTag = 'li';
} else {
$tag = 'div';
$subTag = 'div';
}
if ( $tag != 'div' )
$output .= '<'.$tag.'>';
//output dropdown for each taxonomy
foreach ( $gmw['search_form']['taxonomies'][$postType] as $tax => $values ) :
if ( isset( $values['style'] ) && $values['style'] == 'drop' ) :
$taxonomy = get_taxonomy( $tax );
$tax_value = false;
$single_tax = '<'.$subTag.' class="gmw-single-taxonomy-wrapper gmw-dropdown-taxonomy-wrapper gmw-dropdown-' . $tax . '-wrapper '.$class.'">';
if ( apply_filters( 'gmw_pt_show_tax_label', true, $gmw, $taxonomy, $values ) ) {
//GASAP change label to h4
$single_tax .= '<h4>' . apply_filters( 'gmw_pt_' . $gmw['ID'] . '_' . $tax . '_label', $taxonomy->labels->singular_name .':', $tax, $gmw ) . '</h4><div>';
}
if ( isset( $_GET['tax_' . $tax] ) )
$tax_value = sanitize_text_field( $_GET['tax_' . $tax] );
//GASAP replace
//$args = apply_filters( 'gmw_pt_dropdown_taxonomy_args', array(
//'taxonomy' => $tax,
//'echo' => false,
//'hide_empty' => 1,
//'depth' => 10,
//'hierarchical' => 1,
//'show_count' => 0,
//'class' => 'gmw-dropdown-' . $tax . ' gmw-dropdown-taxonomy',
//'id' => $tax . '-tax',
//'name' => 'tax_' . $tax,
//'selected' => $tax_value,
//'show_option_all' => sprintf( __( 'All %s', 'GMW' ), $taxonomy->labels->name )
//), $gmw, $taxonomy, $tax, $values );
//$single_tax .= wp_dropdown_categories( $args );
//$single_tax .= '</'.$subTag.'>';
//$output .= apply_filters( 'gmw_search_form_taxonomy', $single_tax, $gmw, $args, $tag, $class, $tax, $taxonomy );
//GASAP by
$terms = get_terms(array('taxonomy' => $tax,'hide_empty' => true));
foreach($terms as $term)
{
if($term->term_id == $_GET['tax_' . $tax])
{
$cls = 'checked';
} else {
$cls = '';
}
$single_tax .= '<div class="checkbox"><label for="'.$term->slug.'">'.$term->name.'</label><input id="'.$term->slug.'" '.$cls.' class="ads" type="checkbox" name="tax_'.$term->taxonomy.'" value="'.$term->term_id.'"></div>';
}
$single_tax .= '</div></'.$subTag.'>';
$output .= $single_tax;
// GASAP replace end
endif;
endforeach;
if ( $tag != 'div' )
$output .= '</'.$tag.'>';
return $output;
}
function gmw_pt_form_taxonomies( $gmw, $tag, $class ) {
echo gmw_pt_get_form_taxonomies( $gmw, $tag, $class );
}
/**
* GMW function - Query taxonomies/categories dropdown
* @version 1.0
* @author Eyal Fitoussi
*/
function gmw_pt_query_taxonomies( $tax_args, $gmw ) {
if ( !isset( $gmw['search_form']['taxonomies'] ) || empty( $gmw['search_form']['taxonomies'] ) )
return $tax_args;
$ptc = ( isset( $_GET[$gmw['url_px'].'post'] ) ) ? count( explode( " ", $_GET[$gmw['url_px'].'post'] ) ) : count( $gmw['search_form']['post_types'] );
if ( isset( $ptc ) && $ptc > 1 )
return $tax_args;
$rr = 0;
$get_tax = false;
$args = array( 'relation' => 'AND' );
$postType = $gmw['search_form']['post_types'][0];
if ( empty( $gmw['search_form']['taxonomies'][$postType] ) )
return;
foreach ( $gmw['search_form']['taxonomies'][$postType] as $tax => $values ) {
if ( $values['style'] == 'drop' ) {
$get_tax = false;
if ( isset( $_GET['tax_' . $tax] ) )
$get_tax = sanitize_text_field( $_GET['tax_' . $tax] );
if ( $get_tax != 0 ) {
$rr++;
$args[] = array(
'taxonomy' => $tax,
'field' => 'id',
'terms' => array( $get_tax )
);
}
}
}
if ( $rr == 0 )
$args = false;
return $args;
}
add_filter( 'gmw_pt_tax_query', 'gmw_pt_query_taxonomies', 10, 2 );
/**
* PT results function - Display taxonomies per result.
* @version 1.0
* @author Eyal Fitoussi
*/
function gmw_pt_get_taxonomies( $gmw, $post ) {
if ( !isset( $gmw['search_results']['custom_taxes'] ) )
return;
$taxonomies = apply_filters( 'gmw_pt_results_taxonomies', get_object_taxonomies( $post->post_type, 'names' ), $gmw, $post );
$output ='';
foreach ( $taxonomies as $tax ) {
$terms = get_the_terms( $post->ID, $tax );
if ( $terms && !is_wp_error( $terms ) ) {
$termsArray = array();
$the_tax = get_taxonomy( $tax );
foreach ( $terms as $term ) {
$termsArray[] = $term->name;
}
$tax_output = '<div class="gmw-taxes gmw-taxonomy-' . $the_tax->rewrite['slug'] . '">';
$tax_output .= '<span class="tax-label">' . $the_tax->labels->singular_name . ': </span>';
$tax_output .= '<span class="gmw-terms-wrapper gmw-'.$the_tax->rewrite['slug'].'-terms">'.join( ", ", $termsArray ).'</span>';
$tax_output .= '</div>';
$output .= apply_filters( 'gmw_pt_results_taxonomy', $tax_output, $gmw, $post, $taxonomies, $the_tax, $terms, $termsArray );
}
}
return $output;
}
function gmw_pt_taxonomies( $gmw, $post ) {
echo gmw_pt_get_taxonomies( $gmw, $post );
}
/**
* PT results function - Day & Hours.
* @version 1.0
* @author Eyal Fitoussi
*/
function gmw_pt_get_days_hours( $post, $gmw ) {
$days_hours = get_post_meta( $post->ID, '_wppl_days_hours', true );
$output ='';
$dh_output = '';
$dc = 0;
if ( !empty( $days_hours ) && is_array( $days_hours ) ) {
foreach ( $days_hours as $day ) {
if ( array_filter( $day ) ) {
$dc++;
$dh_output .= '<li class="single-days-hours"><span class="single-day">'.esc_attr( $day['days'] ).': </span><span class="single-hour">'.esc_attr( $day['hours'] ).'</span></li>';
}
}
}
if ( $dc > 0 ) {
$output .= '<ul class="opening-hours-wrapper">';
$output .= '<h4>'. esc_attr( $gmw['labels']['search_results']['opening_hours'] ).'</h4>';
$output .= $dh_output;
$output .= '</ul>';
} elseif ( !empty( $nr_message ) && ( empty( $days_hours ) ) ) {
$output .='<p class="days-na">' . esc_attr( $nr_message ) . '</p>';
}
return $output;
}
function gmw_pt_days_hours( $post, $gmw ) {
echo gmw_pt_get_days_hours( $post, $gmw );
}
\ No newline at end of file
......@@ -63,6 +63,7 @@ jQuery( document ).ready(function()
<!-- post types dropdown -->
<?php gmw_pt_form_post_types_dropdown( $gmw, false, false, false ); ?>
</div>
<?php do_action( 'gmw_search_form_before_taxonomies', $gmw ); ?>
......
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