Skip to content

Commit

Permalink
Merge pull request #1075 from OpenDevelopmentMekong/master
Browse files Browse the repository at this point in the history
merging to prod for releasing v2.2.66
  • Loading branch information
Alex Corbi authored Jul 7, 2017
2 parents 4836e00 + d398f18 commit 18fae0f
Show file tree
Hide file tree
Showing 6 changed files with 285 additions and 226 deletions.
2 changes: 1 addition & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<?php
if (!is_front_page() && !is_page('map-explorer')) : ?>
<div id="main-breadcrumb">
<?php echo_the_breadcrumb(); ?>
<?php echo_the_breadcrumbs(); ?>
</div>
<?php
endif; ?>
Expand Down
438 changes: 247 additions & 191 deletions inc/utils/breadcrumbs.php

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions inc/utils/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ function echo_post_meta($the_post, $show_elements = array('date','categories','t
if (odm_language_manager()->get_current_language() == 'km') {
echo convert_date_to_kh_date(get_the_time('j.M.Y'));
} else {
echo get_the_time('Y-m-d');
echo get_the_date('j F Y');
}
?>
<?php endif; ?>
Expand Down Expand Up @@ -444,7 +444,7 @@ function echo_post_meta($the_post, $show_elements = array('date','categories','t

}

function odm_excerpt($the_post, $num = 40, $read_more = '')
function odm_excerpt($the_post, $num = 45, $read_more = '')
{
global $post;
$post = $the_post;
Expand All @@ -468,8 +468,9 @@ function odm_excerpt($the_post, $num = 40, $read_more = '')
array_splice($stripped_content_arr, $limit);
$excerpt_content = implode(' ', $stripped_content_arr);
if (odm_language_manager()->get_current_language() == "km"):
$excerpt_zeo_space = explode("", $excerpt_content, $limit); //explode by zerowidthspace​
$excerpt_content = implode("", $excerpt_zeo_space); //implode by zerowidthspace
$excerpt_zeo_space = explode("&#8203;", $excerpt_content, $num+1); //explode by zerowidthspace​
array_splice($excerpt_zeo_space, $limit);
$excerpt_content = implode("&#8203;", $excerpt_zeo_space); //implode by zerowidthspace
endif;

$excerpt_words = $excerpt_content.' ...';
Expand Down Expand Up @@ -542,23 +543,23 @@ function echo_downloaded_documents ($postID = "") {
//Get Download files
$get_document = get_post_meta($postID, 'upload_document', true);
$get_localized_document = get_post_meta($postID, 'upload_document_'.$local_lang, true);

$document_curent_lang = null;

if (!empty($get_document) || !empty($get_localized_document)):
if (!empty($get_document) && !empty($get_localized_document)):
$document_curent_lang = $current_lang == "en" ? $get_document : $get_localized_document;
else:
$document_curent_lang = !empty($get_document) ? $get_document : $get_localized_document;
endif;
endif;?>
<?php

<?php
if (isset($document_curent_lang)): ?>
<p class="download_data_buttons"><?php _e('Download:','wp-odm_solr'); ?>
<span class="meta-label pdf"><a target="_blank" href="<?php echo get_bloginfo("url") . '/pdf-viewer/?pdf=files_mf/' . $document_curent_lang ?>">pdf</a></span>
</p>
<?php
endif;
<?php
endif;
}

function available_post_types(){
Expand Down
4 changes: 2 additions & 2 deletions inc/widgets/odm-taxonomy-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ public function widget( $args, $instance ) {
$('ul', this).siblings('span').addClass("plusimage-<?php echo odm_country_manager()->get_current_country();?>");
}

//if parent is showed, child need to expend
if( $(this).children("span").hasClass('<?php echo $current_page_slug; ?>') ){
//if parent is showed, child need to expend
if( $('ul li', this).children("span").hasClass('<?php echo $current_page_slug; ?>') ){
$('span.<?php echo $current_page_slug; ?>', this).siblings("ul").show();
$('span.<?php echo $current_page_slug; ?>', this).toggleClass('minusimage-<?php echo odm_country_manager()->get_current_country();?>');
$('span.<?php echo $current_page_slug; ?>', this).toggleClass('plusimage-<?php echo odm_country_manager()->get_current_country();?>');
Expand Down
46 changes: 24 additions & 22 deletions page-dataset-detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
?>
<?php get_header(); ?>

<?php
<?php
$search_query = isset($_GET["search_query"]) ? base64_decode($_GET["search_query"]) : null; ?>

<?php if(have_posts()) : the_post(); ?>
Expand Down Expand Up @@ -45,34 +45,36 @@
<a target="_blank" class="button download" href="<?php echo wpckan_get_ckan_domain(); ?>/api/3/action/package_show?id=<?php echo $dataset_id;?>"><?php _e('JSON', 'odm')?></a>
<a target="_blank" class="button download" href="<?php echo wpckan_get_ckan_domain(); ?>/dataset/<?php echo $dataset_id;?>.rdf"><?php _e('RDF', 'odm')?></a>
</div>


<?php
if (isset($search_query)):
$result = WP_Odm_Solr_UNIFIED_Manager()->query_by_params($search_query);
if (count($result["resultset"]) > 0): ?>
<div class="sixteen columns widgets">
<div class="widget">
<h2 class="widget-title"><?php _e('Other search results', 'odm'); ?></h2>
<ul>
<?php
foreach ($result["resultset"] as $document):
$link_to_dataset = wpckan_get_link_to_dataset($document->name,$search_query);?>
<li>
<h5><a target="_blank" href="<?php echo $link_to_dataset; ?>"><?php echo $document->title; ?></a></h5>
</li>
<?php
endforeach; ?>
</ul>
</div>
</div>
<?php
if (isset($search_query)):
$result = WP_Odm_Solr_UNIFIED_Manager()->query_by_params($search_query); ?>
<div class="sixteen columns widgets">
<div class="widget">
<h2 class="widget-title"><?php _e('Other search results', 'odm'); ?></h2>
<ul>
<?php
foreach ($result["resultset"] as $document):
$link_to_dataset = wpckan_get_link_to_dataset($document->name,$search_query);?>
<li>
<h5><a target="_blank" href="<?php echo $link_to_dataset; ?>"><?php echo $document->title; ?></a></h5>
</li>
<?php
endforeach; ?>
</ul>
</div>
</div>
<?php
endif;
endif; ?>

<div class="sixteen columns">
<ul class="widgets">
<?php dynamic_sidebar('wpckan-dataset-detail-sidebar'); ?>
</ul>
</div>

</aside>
</div>
</section>
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Author: Open Development Mekong
Author URI: http://github.com/OpenDevelopmentMekong
Description: Open Development Mekong's wordpress theme. Based on JEO child theme
Template: jeo
Version: 2.2.64
Version: 2.2.66
License: GNU General Public License v3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
Expand Down

0 comments on commit 18fae0f

Please sign in to comment.