Changeset 2164856
- Timestamp:
- 09/28/2019 12:22:11 PM (6 years ago)
- Location:
- devotionalium/trunk
- Files:
-
- 6 added
- 12 edited
-
assets (added)
-
assets/banner-772x250.png (added)
-
assets/icon-128x128.png (added)
-
assets/icon-256x256.png (added)
-
assets/screenshot-1.jpg (added)
-
assets/screenshot-2.jpg (added)
-
devotionalium.php (modified) (1 diff)
-
readme.txt (modified) (4 diffs)
-
src/ConfigAccessor.php (modified) (3 diffs)
-
src/Devotionalium/Devotionalium.php (modified) (1 diff)
-
src/Model/Api/Communicator.php (modified) (1 diff)
-
src/Model/Api/DevotionaliumApi.php (modified) (4 diffs)
-
src/Model/Api/Verse.php (modified) (4 diffs)
-
src/Model/Widget.php (modified) (1 diff)
-
src/Plugin.php (modified) (4 diffs)
-
src/View/devotionalium-widget.phtml (modified) (3 diffs)
-
src/View/devotionalium.phtml (modified) (3 diffs)
-
src/css/devotionalium.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
devotionalium/trunk/devotionalium.php
r2080189 r2164856 3 3 Plugin Name: Devotionalium 4 4 Plugin URI: https://devotionalium.com/wordpress/ 5 Description: Include today's bibleverses from devotionalium.com, with rich support for original languages.6 Version: 1. 1.05 Description: Include today's verses from devotionalium.com, with rich support for original languages. 6 Version: 1.2.0 7 7 Author: Max Melzer 8 8 Author URI: http://moehrenzahn.de/en/about -
devotionalium/trunk/readme.txt
r2080189 r2164856 1 === Devotionalium for Wordpress ===1 === Devotionalium Daily Verses for Wordpress === 2 2 Contributors: maxmelzer 3 Tags: bible, devotion, watchword, losung, theology3 Tags: bible, quran, torah, devotion, watchword, losung, theology 4 4 Requires at least: 4.9 5 5 Tested up to: 5.1.1 … … 11 11 License URI: https://www.gnu.org/licenses/gpl-2.0.html 12 12 13 Include today's bibleverses from devotionalium.com, with rich support for original languages.13 Include today's verses from devotionalium.com, with rich support for original languages. 14 14 15 15 == Description == 16 16 17 Devotionalium for Wordpress is a plugin that utilises the [Devotionalium.com](https://devotionalium.com/api/docs) API to display today's featured bibleverses from [Devotionalium.com](https://devotionalium.com) on your Wordpress page.17 Devotionalium Daily Verses for Wordpress is a plugin that uses the [Devotionalium.com](https://devotionalium.com/api/docs) API to display today's featured verses from [Devotionalium.com](https://devotionalium.com) on your Wordpress page. 18 18 19 19 You can use it as … … 37 37 = What is Devotionalium? = 38 38 39 Devotionalium is a free service for reading daily verses from the bible. Check out devotionalium.com for more.39 Devotionalium is a free service for reading daily verses from the Torah, the New Testament, and the Quran. Check out devotionalium.com for more. 40 40 41 41 == Screenshots == … … 45 45 46 46 == Changelog == 47 = 1.2.0 = 48 * Add setting to toggle Quran display 49 * Fixes and updates for new API format 47 50 = 1.1.0 = 48 51 * Add ability to choose an API endpoint url -
devotionalium/trunk/src/ConfigAccessor.php
r2080189 r2164856 27 27 const KEY_ENDPOINT_URL = self::CONFIG_PREFIX.'endpointUrl'; 28 28 29 const KEY_SHOW_QURAN = self::CONFIG_PREFIX.'showQuran'; 30 29 31 const DEFAULTS = [ 30 32 self::KEY_IS_ORIGINAL_LANGUAGE => false, … … 32 34 self::KEY_DAY_OFFSET => 0, 33 35 self::KEY_CUSTOM_CSS => '.devotionalium {}', 34 self::KEY_ENDPOINT_URL => Communicator::DEFAULT_API_URL 36 self::KEY_ENDPOINT_URL => Communicator::DEFAULT_API_URL, 37 self::KEY_SHOW_QURAN => false, 35 38 ]; 36 39 … … 89 92 { 90 93 return $this->getConfigValue(self::KEY_ENDPOINT_URL); 94 } 95 96 /** 97 * @return bool 98 */ 99 public function isShowQuran() 100 { 101 return (bool)$this->getConfigValue(self::KEY_SHOW_QURAN); 91 102 } 92 103 -
devotionalium/trunk/src/Devotionalium/Devotionalium.php
r2080189 r2164856 94 94 $this->config->getVersion(), 95 95 $this->config->getLanguage(), 96 $date 96 $date, 97 $this->config->isShowQuran() 97 98 ); 98 99 $this->setDate($devotionalium->getDate()); -
devotionalium/trunk/src/Model/Api/Communicator.php
r2080189 r2164856 50 50 * @param string[] $parameters 51 51 * @param string $action 52 * @return string[]52 * @return mixed[] 53 53 * @throws \Exception 54 54 */ -
devotionalium/trunk/src/Model/Api/DevotionaliumApi.php
r2080189 r2164856 37 37 * @param string $language 38 38 * @param string $date 39 * @param bool $showQuran 39 40 * @return Devotionalium 40 41 */ … … 42 43 $version, 43 44 $language, 44 $date 45 $date, 46 $showQuran 45 47 ) { 46 48 $index = implode( … … 49 51 ); 50 52 if ($cached = $this->transient->load($index)) { 51 return $cached;53 //return $cached; 52 54 } 53 55 … … 60 62 $verses = []; 61 63 foreach ($response as $key => $item) { 62 if (isset($item['text'])) { 63 $verses[] = new Verse( 64 $item['biblePart'], 65 $item['book'], 66 $item['bookNumber'], 67 $item['chapter'], 68 $item['text'], 69 $item['textOriginal'], 70 $item['verses'], 71 $item['version']['name'], 72 $item['reference'], 73 $item['readingUrl'] 74 ); 64 if (!isset($item['text'])) { 65 continue; 75 66 } 67 if (isset($item['collection'])) { 68 $collection = $item['collection']; 69 } elseif (isset($item['biblePart'])) { 70 $collection = $item['biblePart']; 71 } else { 72 $collection = null; 73 } 74 if (!$showQuran && $collection === 2) { 75 continue; 76 } 77 78 $verses[] = new Verse( 79 $collection, 80 $item['book'], 81 $item['bookNumber'], 82 $item['chapter'], 83 $item['text'], 84 $item['textOriginal'], 85 $item['verses'], 86 $item['version']['name'], 87 $item['reference'], 88 $item['readingUrl'] 89 ); 76 90 } 77 91 $date = \DateTime::createFromFormat('Y-m-d', $response['date']); -
devotionalium/trunk/src/Model/Api/Verse.php
r1816706 r2164856 6 6 { 7 7 /** 8 * @var int (0|1 )8 * @var int (0|1|2) 9 9 */ 10 private $ biblePart;10 private $collection; 11 11 12 12 /** … … 58 58 * Verse constructor. 59 59 * 60 * @param $biblePart61 * @param $book62 * @param $bookNumber63 * @param $chapter64 * @param $text65 * @param $textOriginal66 * @param array$verses67 * @param $versionName68 * @param $reference69 * @param $readingUrl60 * @param int $collection 61 * @param string $book 62 * @param int $bookNumber 63 * @param int $chapter 64 * @param string $text 65 * @param string $textOriginal 66 * @param string[] $verses 67 * @param string $versionName 68 * @param string $reference 69 * @param string $readingUrl 70 70 */ 71 71 public function __construct( 72 $ biblePart,72 $collection, 73 73 $book, 74 74 $bookNumber, … … 81 81 $readingUrl 82 82 ) { 83 $this-> biblePart = $biblePart;83 $this->collection = $collection; 84 84 $this->book = $book; 85 85 $this->bookNumber = $bookNumber; … … 96 96 * @return int 97 97 */ 98 public function get BiblePart()98 public function getCollection() 99 99 { 100 return $this-> biblePart;100 return $this->collection; 101 101 } 102 102 -
devotionalium/trunk/src/Model/Widget.php
r1857973 r2164856 34 34 parent::__construct( 35 35 'devotionalium', 36 'Devotionalium', 37 ['description' => __('Displays daily bible verses from devotionalium.com', Plugin::WP_TEXTDOMAIN)] 36 'Devotionalium Daily Verses', 37 ['description' => __( 38 'Displays daily verses from the Torah, the New Testament, and the Quran from devotionalium.com', 39 Plugin::WP_TEXTDOMAIN 40 )] 38 41 ); 39 42 } -
devotionalium/trunk/src/Plugin.php
r2080189 r2164856 82 82 ConfigAccessor::KEY_IS_ORIGINAL_LANGUAGE, 83 83 __('Original languages', Plugin::WP_TEXTDOMAIN), 84 __('Display bible verses in original languages greek and hebrew as well.', Plugin::WP_TEXTDOMAIN), 84 __('Display verses from the Torah, the New Testament, and the Quran in original languages greek, hebrew, and arabic as well.', Plugin::WP_TEXTDOMAIN), 85 new \Devotionalium\Block\Setting('/View/config/setting/boolean.phtml') 86 ), 87 new Setting( 88 ConfigAccessor::KEY_SHOW_QURAN, 89 __('Display Quran verse', Plugin::WP_TEXTDOMAIN), 90 __('Display verses from the Quran.', Plugin::WP_TEXTDOMAIN), 85 91 new \Devotionalium\Block\Setting('/View/config/setting/boolean.phtml') 86 92 ), … … 88 94 ConfigAccessor::KEY_VERSION, 89 95 __('Bible Version', Plugin::WP_TEXTDOMAIN), 90 __('Choose a bible version to display the bibleverses in.', Plugin::WP_TEXTDOMAIN),96 __('Choose a bible version to display Torah and New Testament verses in.', Plugin::WP_TEXTDOMAIN), 91 97 $versionsArray, 92 98 new \Devotionalium\Block\Setting('/View/config/setting/select.phtml') … … 95 101 ConfigAccessor::KEY_OUTGOING_LINKS, 96 102 __('Outgoing links', Plugin::WP_TEXTDOMAIN), 97 __('Include hyperlinks to the full readings on devotionalium.com (recommended).', Plugin::WP_TEXTDOMAIN), 103 __( 104 'Include hyperlinks to the full readings on devotionalium.com (recommended).', 105 Plugin::WP_TEXTDOMAIN 106 ), 98 107 new \Devotionalium\Block\Setting('/View/config/setting/boolean.phtml') 99 108 ), … … 103 112 ConfigAccessor::KEY_ENDPOINT_URL, 104 113 __('Endpoint URL', Plugin::WP_TEXTDOMAIN), 105 __('Choose the API endpoint URL to request Devotionalium from. Default: "https://devotionalium.com/api"', Plugin::WP_TEXTDOMAIN), 114 __( 115 'Choose the API endpoint URL to use. Default: "https://devotionalium.com/api"', 116 Plugin::WP_TEXTDOMAIN 117 ), 106 118 new \Devotionalium\Block\Setting('/View/config/setting/text-wide.phtml') 107 119 ), -
devotionalium/trunk/src/View/devotionalium-widget.phtml
r1875729 r2164856 9 9 <div class="devotionalium"> 10 10 <?php foreach ($block->getDevotionalium()->getVerses() as $verse) : ?> 11 <div class='<?php echo $verse->getBiblePart() === 0 ? 'ot' : 'nt' ?>'> 11 <?php if ($verse->getCollection() === 0) { 12 $collection = 'ot'; 13 $language = 'hebrew'; 14 $dir = 'rtl'; 15 } elseif ($verse->getCollection() === 1) { 16 $collection = 'nt'; 17 $language = 'greek'; 18 $dir = 'ltr'; 19 } elseif ($verse->getCollection() === 2) { 20 $collection = 'quran'; 21 $language = 'arabic'; 22 $dir = 'rtl'; 23 } ?> 24 <div class='<?php echo $collection ?>'> 12 25 <?php if ($block->showOriginalLanguages()) : ?> 13 <p class="versetext original <?php echo $ verse->getBiblePart() == 0 ? 'hebrew' : 'greek'; ?>"14 <?php echo $verse->getBiblePart() === 0 ? 'dir="rtl"' : ''; ?>>26 <p class="versetext original <?php echo $language; ?>" 27 dir="<?php echo $dir; ?>"> 15 28 <?php echo $verse->getTextOriginal(); ?> 16 29 </p> … … 19 32 <?php echo $verse->getText(); ?> 20 33 </p> 21 < divclass="reference-link-container">34 <p class="reference-link-container"> 22 35 <?php if ($block->useLinks()) : ?> 23 36 <a class='reference-link' … … 25 38 <?php echo $verse->getReferenceString(); ?></a> 26 39 <?php else : ?> 27 < p class='reference-link'><?php echo $verse->getReferenceString(); ?></p>40 <span class='reference-link'><?php echo $verse->getReferenceString(); ?></span> 28 41 <?php endif; ?> 29 </ div>42 </p> 30 43 </div> 31 44 <?php endforeach; ?> -
devotionalium/trunk/src/View/devotionalium.phtml
r1875729 r2164856 8 8 </h2> 9 9 <?php foreach ($block->getDevotionalium()->getVerses() as $verse) : ?> 10 <div class='<?php echo $verse->getBiblePart() === 0 ? 'ot' : 'nt' ?>'> 10 <?php if ($verse->getCollection() === 0) { 11 $collection = 'ot'; 12 $language = 'hebrew'; 13 $dir = 'rtl'; 14 } elseif ($verse->getCollection() === 1) { 15 $collection = 'nt'; 16 $language = 'greek'; 17 $dir = 'ltr'; 18 } elseif ($verse->getCollection() === 2) { 19 $collection = 'quran'; 20 $language = 'arabic'; 21 $dir = 'rtl'; 22 } ?> 23 <div class='<?php echo $collection ?>'> 11 24 <?php if ($block->showOriginalLanguages()) : ?> 12 <p class="versetext original <?php echo $ verse->getBiblePart() == 0 ? 'hebrew' : 'greek'; ?>"13 <?php echo $verse->getBiblePart() === 0 ? 'dir="rtl"' : ''; ?>>25 <p class="versetext original <?php echo $language; ?>" 26 dir="<?php echo $dir; ?>"> 14 27 <?php echo $verse->getTextOriginal(); ?> 15 28 </p> … … 18 31 <?php echo $verse->getText(); ?> 19 32 </p> 20 < divclass="reference-link-container">33 <p class="reference-link-container"> 21 34 <?php if ($block->useLinks()) : ?> 22 35 <a class='reference-link' … … 24 37 <?php echo $verse->getReferenceString(); ?></a> 25 38 <?php else : ?> 26 < p class='reference-link'><?php echo $verse->getReferenceString(); ?></p>39 <span class='reference-link'><?php echo $verse->getReferenceString(); ?></span> 27 40 <?php endif; ?> 28 </ div>41 </p> 29 42 </div> 30 43 <?php endforeach; ?> -
devotionalium/trunk/src/css/devotionalium.css
r1857973 r2164856 1 .devotionalium h2.title {2 3 }4 1 .devotionalium .versetext 5 2 { … … 14 11 text-align: right; 15 12 } 16 .devotionalium .versetext.hebrew {13 .devotionalium .versetext.hebrew, .devotionalium .versetext.arabic { 17 14 font-family: 'Times New Roman', Times, serif; 18 15 font-size: 150%; 16 } 17 .devotionalium .versetext.hebrew { 19 18 line-height: 1.2; 20 19 }
Note: See TracChangeset
for help on using the changeset viewer.