Skip to content

Commit

Permalink
Merge pull request #1059 from OpenDevelopmentMekong/master
Browse files Browse the repository at this point in the history
merging to prod for releasing v2.2.64
  • Loading branch information
Alex Corbi authored Jul 5, 2017
2 parents 6575303 + 3ab7f14 commit 4836e00
Show file tree
Hide file tree
Showing 11 changed files with 801 additions and 807 deletions.
620 changes: 310 additions & 310 deletions i18n/km.po

Large diffs are not rendered by default.

572 changes: 304 additions & 268 deletions i18n/my.po

Large diffs are not rendered by default.

194 changes: 60 additions & 134 deletions i18n/vi.po

Large diffs are not rendered by default.

41 changes: 21 additions & 20 deletions inc/templates/post-highlighted-single-1-cols.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

<div class="sixteen columns">
<div class="post-list-item single_result_container">
<section class="content item-content section-content">

<section class="content item-content section-content">
<?php
if ($show_thumbnail):
$thumb_src = odm_get_thumbnail($post->ID, false, 'medium');
Expand All @@ -30,37 +30,38 @@
endif;
endif;
?>
<?php if ($show_excerpt || $show_source_meta): ?>
<?php if ($show_excerpt || $show_source_meta): ?>
<?php if ($show_excerpt): ?>
<div class="post-excerpt">

<?php
if ($show_meta):
echo_post_meta($post,array("date", "tags"),$order,$max_num_topics,$max_num_tags);
endif; ?>
<?php
$excerpt = odm_excerpt($post, 600);

<?php
$excerpt = odm_excerpt($post, 600);
if (isset($highlight_words_query) && function_exists('wp_odm_solr_highlight_search_words')):
$excerpt = wp_odm_solr_highlight_search_words($highlight_words_query,$excerpt);
$excerpt = wp_odm_solr_highlight_search_words($highlight_words_query,$excerpt);
endif;
echo $excerpt; ?>

</br>

<a class="button" href="<?php echo get_permalink($post->ID); ?>"><?php _e('Read more','odm'); ?></a>
</div>

<?php if( echo_downloaded_documents()):
echo_downloaded_documents();
endif; ?>
<?php endif; ?>
<?php
endif;

if ($show_source_meta):
odm_echo_extras();
endif;

<?php if ($show_source_meta): ?>
<?php odm_echo_extras(); ?>
<?php endif; ?>
<?php endif; ?>
echo_downloaded_documents();

endif;
?>
</section>

</div>
</div>
28 changes: 15 additions & 13 deletions inc/templates/post-list-single-1-cols.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<div class="sixteen columns<?php if (isset($extra_classes)): echo " ". $extra_classes; endif; ?>">
<div class="post-list-item single_result_container">
<?php
<?php
$localized_title = apply_filters('translate_text', $post->post_title, odm_language_manager()->get_current_language());
$localized_title = !empty($localized_title) ? $localized_title : strip_shortcodes($post->post_title); ?>
<?php if ($header_tag): ?>
Expand Down Expand Up @@ -68,9 +68,9 @@
endif;
endif;
?>
<?php
<?php
if ($show_excerpt || $show_source_meta): ?>
<?php
<?php
if ($show_excerpt): ?>
<div class="post-excerpt">
<?php
Expand All @@ -80,16 +80,18 @@
endif;
echo $excerpt; ?>
</div>
<?php
endif;
if ($show_source_meta):
odm_echo_extras();
endif;
endif; ?>
</section>

<section>
<?php echo_downloaded_documents(); ?>

<?php
endif;

if ($show_source_meta):
odm_echo_extras();
endif;

echo_downloaded_documents();

endif;
?>
</section>

<?php
Expand Down
22 changes: 11 additions & 11 deletions inc/templates/post-list-single-2-cols.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<div class="eight columns<?php if (isset($extra_classes)): echo " ". $extra_classes; endif; ?>">
<div class="post-list-item single_result_container">
<?php
<?php
$localized_title = apply_filters('translate_text', $post->post_title, odm_language_manager()->get_current_language());
$localized_title = !empty($localized_title) ? $localized_title : strip_shortcodes($post->post_title); ?>
<?php if ($header_tag): ?>
Expand Down Expand Up @@ -67,9 +67,9 @@
endif;
endif;
?>
<?php
<?php
if ($show_excerpt || $show_source_meta): ?>
<?php
<?php
if ($show_excerpt): ?>
<div class="post-excerpt">
<?php
Expand All @@ -79,16 +79,16 @@
endif;
echo $excerpt;?>
</div>
<?php
<?php
endif;
if ($show_source_meta):
odm_echo_extras();
endif;
endif; ?>
</section>

<section>
<?php echo_downloaded_documents(); ?>
odm_echo_extras();
endif;

echo_downloaded_documents();
endif;
?>
</section>

<?php
Expand Down
23 changes: 12 additions & 11 deletions inc/templates/post-list-single-4-cols.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<div class="four columns<?php if (isset($extra_classes)): echo " ". $extra_classes; endif; ?>">
<div class="post-list-item single_result_container">
<?php
<?php
$localized_title = apply_filters('translate_text', $post->post_title, odm_language_manager()->get_current_language());
$localized_title = !empty($localized_title) ? $localized_title : strip_shortcodes($post->post_title); ?>
<?php if ($header_tag): ?>
Expand Down Expand Up @@ -68,9 +68,9 @@
endif;
endif;
?>
<?php
<?php
if ($show_excerpt || $show_source_meta): ?>
<?php
<?php
if ($show_excerpt): ?>
<div class="post-excerpt">
<?php
Expand All @@ -80,16 +80,17 @@
endif;
echo $excerpt; ?>
</div>
<?php
<?php
endif;

if ($show_source_meta):
odm_echo_extras();
endif;
endif; ?>
</section>

<section>
<?php echo_downloaded_documents(); ?>
odm_echo_extras();
endif;

echo_downloaded_documents();
endif;
?>
</section>

<?php
Expand Down
41 changes: 23 additions & 18 deletions inc/utils/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -538,22 +538,27 @@ function echo_downloaded_documents ($postID = "") {
$postID = $postID ? $postID : get_the_ID();
$local_lang = odm_language_manager()->get_the_language_code_by_site();
$current_lang = odm_language_manager()->get_current_language();

//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;
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;?>
<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;
endif;
endif;?>

<?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;
}

function available_post_types(){
Expand Down Expand Up @@ -666,7 +671,7 @@ function get_top_level_category_english_name($cat_id) {
function odm_echo_extras($postID = "") {
$postID = $postID ? $postID : get_the_ID();
$news_source_info = null;
if (function_exists('get_post_meta')) :
if (function_exists('get_post_meta')):
$get_author = get_post_meta($postID, 'author', true);
$get_localized_author = get_post_meta($postID, 'author_'.odm_language_manager()->get_current_language(), true);
if ($get_author != '' || $get_localized_author != ''):
Expand All @@ -689,13 +694,13 @@ function odm_echo_extras($postID = "") {
endif;
endif;

if (isset($source) && $source != '') {
if (false === strpos($source, '://')) {
$news_source_info .= '<a href="http://'.$source.'" target="_blank">http://'.$source.'</a>';
} else {
$news_source_info .= '<a href="'.$source.'" target="_blank">'.$source.'</a>';
}
}
if (isset($source) && $source != ''):
if (false === strpos($source, '://')):
$news_source_info .= '<a href="http://'.$source.'" target="_blank">http://'.$source.'</a>';
else:
$news_source_info .= '<a href="'.$source.'" target="_blank">'.$source.'</a>';
endif;
endif;

endif;

Expand Down
46 changes: 35 additions & 11 deletions page-dataset-detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
?>
<?php get_header(); ?>

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

<?php if(have_posts()) : the_post(); ?>
<section id="content" class="container single-post">
<div class="row">
Expand Down Expand Up @@ -42,22 +45,43 @@
<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>
</div>

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

</aside>

<?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; ?>

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

</aside>
</div>
</section>
<?php endif; ?>

<?php get_footer(); ?>

<script type="text/javascript">
jQuery(document).ready(function($) {
$('.download').prepend($('<i class="fa fa-download"></i> '));
})
</script>

<?php get_footer(); ?>
19 changes: 9 additions & 10 deletions single.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,16 @@
else:
echo_documents_cover();
endif;

if(get_the_content()):
echo "<p>".get_the_content()."</p>";
endif;

odm_echo_extras();

echo_downloaded_documents();

?>
<p>
<?php echo get_the_content(); ?>
</p>
<p>
<?php echo_downloaded_documents(); ?>
</p>
</br>
<p>
<?php odm_echo_extras(); ?>
</p>
</div>
</section>
<?php
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.62
Version: 2.2.64
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 4836e00

Please sign in to comment.