Plugin Directory

Changeset 3453573


Ignore:
Timestamp:
02/04/2026 07:38:24 AM (2 weeks ago)
Author:
investi
Message:

add 'locale' attribute support to announcement widgets

Location:
investi/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • investi/trunk/includes/widgets.php

    r3420912 r3453573  
    102102
    103103function investi_announcements_summary_v2_func( $atts ) {
    104     $color = $atts['color'] ?? '';;   
     104    $color = $atts['color'] ?? '';;
    105105    $dateFormat = $atts['date-format'] ?? '';
    106106    if(empty($dateFormat)){
    107107      $dateFormat = "dd MMM yyyy";
    108108    }
     109    $locale = $atts['locale'] ?? '';
     110    if(!empty($locale)){
     111      $locale = 'data-investi-locale="' . htmlspecialchars($locale, ENT_QUOTES, 'UTF-8') . '"';
     112    }
    109113    $numAnnouncements = $atts['num-announcements'] ?? '';
    110    
     114
    111115    $filterRegex = $atts['filter-regex'] ?? '';
    112116    $header = investi_announcement_header($atts);
    113117    $searchBox = investi_is_flag('searchbox', $atts ) ? 'data-investi-searchbox' : '';
    114118    return "
    115    
     119
    116120    <style>
    117    
     121
    118122    .investi-announcement-headline a:hover {
    119123      color: $color;
    120124    }
    121      
     125
    122126    </style>
    123    
     127
    124128    $header
    125    
     129
    126130    <div class=\"investi-announcements-summary-v2\"
    127131    data-investi-num-announcements=\"$numAnnouncements\"
    128132    data-investi-date-format=\"$dateFormat\"
     133    $locale
    129134    data-investi-filter-regex=\"$filterRegex\"
    130135    data-investi-no-data-message=\"No announcements\"
     
    193198function investi_announcements_tab_func( $atts ) {
    194199  $color = $atts['color'] ?? '';
    195   $lightColor = $atts['light-color'] ?? ''; 
    196   $startYear = $atts['start-year'] ?? ''; 
     200  $lightColor = $atts['light-color'] ?? '';
     201  $startYear = $atts['start-year'] ?? '';
    197202
    198203  $dateFormat = $atts['date-format'] ?? '';
     
    200205      $dateFormat = "dd MMM yyyy";
    201206    }
    202  
     207
     208  $locale = $atts['locale'] ?? '';
     209  if(!empty($locale)){
     210    $locale = 'data-investi-locale="' . htmlspecialchars($locale, ENT_QUOTES, 'UTF-8') . '"';
     211  }
     212
    203213  if(empty($color)){
    204214    $color = "#505050";
     
    213223  $maximumNumYears = $atts['maximum-num-years'] ?? '';
    214224  $searchBox = investi_is_flag('searchbox', $atts ) ? 'data-investi-searchbox' : '';
    215  
     225
    216226  $includeSelectForAdditionalYears = get_investi_attr('include-select-for-additional-years', $atts);
    217227
     
    259269  <div class=\"investi-announcements-tab\"
    260270  data-investi-date-format=\"$dateFormat\"
     271  $locale
    261272  data-investi-filter-regex=\"$filterRegex\"
    262273  data-investi-maximum-num-years=\"$maximumNumYears\"
     
    374385
    375386function investi_interactive_announcements_func( $atts ) {
    376  
     387
    377388  $dateFormat = $atts['date-format'] ?? '';;
    378389  if(empty($dateFormat)){
    379390    $dateFormat = "dd MMM yyyy";
    380391  }
     392  $locale = $atts['locale'] ?? '';
     393  if(!empty($locale)){
     394    $locale = 'data-investi-locale="' . htmlspecialchars($locale, ENT_QUOTES, 'UTF-8') . '"';
     395  }
    381396  $announcementsPerPage = $atts['announcements-per-page'] ?? '';
    382397  $headerTitle = $atts['announcement-header-title'] ?? ' ';
    383398  $commentsWording = $atts['comments-wording'] ?? '';
    384  
     399
    385400  $filterRegex = $atts['filter-regex'] ?? '';
    386  
     401
    387402  $searchBox = investi_is_flag('searchbox', $atts ) ? 'data-investi-searchbox' : '';
    388403  $noComments = investi_is_flag('no-comments', $atts ) ? 'data-investi-no-comments' : '';
    389  
     404
    390405  return "
    391  
    392  
     406
     407
    393408  <div class=\"investi-interactive-announcements\"
    394409  data-investi-announcements-per-page=\"$announcementsPerPage\"
     
    397412  data-investi-filter-regex=\"$filterRegex\"
    398413  data-investi-announcement-date-format=\"$dateFormat\"
     414  $locale
    399415  $searchBox
    400416  $noComments
     
    418434
    419435function investi_announcements_thumbnail_internal( $atts, $widgetName) {
    420  
    421  
     436
     437
    422438  $dateFormat = $atts['date-format'] ?? '';
    423439  if(empty($dateFormat)){
    424440    $dateFormat = "dd MMM yyyy";
    425441  }
     442  $locale = $atts['locale'] ?? '';
     443  if(!empty($locale)){
     444    $locale = 'data-investi-locale="' . htmlspecialchars($locale, ENT_QUOTES, 'UTF-8') . '"';
     445  }
    426446  $announcementsPerPage = $atts['announcements-per-page'] ?? '';
    427447  $headerTitle = $atts['announcement-header-title'] ?? ' ';
    428448  $commentsWording = $atts['comments-wording'] ?? '';
    429  
     449
    430450  $filterRegex = $atts['filter-regex'] ?? '';
    431  
     451
    432452  // echo 'foo'.$atts['image-width'];
    433453
     
    441461    $imageHeight = 'data-investi-thumbnail-image-height='.$imageHeight;
    442462  }
    443    
     463
    444464  $numAnnouncements = $atts['num-announcements'] ?? '';
    445465  if(!empty($numAnnouncements)){
     
    448468
    449469  return "
    450  
    451  
     470
     471
    452472  <div class=\"$widgetName\"
    453  
     473
    454474  data-investi-filter-regex=\"$filterRegex\"
    455475  data-investi-announcement-date-format=\"$dateFormat\"
     476  $locale
    456477  $imageWidth
    457478  $imageHeight
  • investi/trunk/investi.php

    r3420912 r3453573  
    77* Plugin URI: https://web.investi.com.au/wordpress-plugin
    88* Description: Share Price Charts and Widgets. Our comprehensive and timely data quickly summarises your current and historical share price performance,displaying charts and widgets to enhance engagement with your investor audience.
    9 * Version: 1.0.22
     9* Version: 1.0.23
    1010* Author: Investi Services Pty Ltd
    1111* Author URI: https://web.investi.com.au
  • investi/trunk/readme.txt

    r3420912 r3453573  
    66Requires PHP:      7.2
    77Tested up to: 6.8
    8 Stable tag: 1.0.22
    9 Version: 1.0.22
     8Stable tag: 1.0.23
     9Version: 1.0.23
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4848
    4949== Changelog ==
     50
     51= 1.0.23 =
     52* add 'locale' attribute support to announcement widgets
    5053
    5154= 1.0.22 =
Note: See TracChangeset for help on using the changeset viewer.