diff --git a/CHANGELOG.md b/CHANGELOG.md index 09d2800..62963fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +# v3.0.4 +## 10/04/2021 + +1. [](#new) + +2. [](#improved) + * Issue #44 Series and Episode author information is prepopulated based on info in the currently signed in Grav user. + +3. [](#bugfix) + + # v3.0.3 ## 10/02/2021 diff --git a/blueprints.yaml b/blueprints.yaml index e372f54..aa296ae 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,5 +1,5 @@ name: Podcast -version: 3.0.3 +version: 3.0.4 description: Creates Podcast page types and related podcast RSS feeds icon: microphone author: diff --git a/blueprints/podcast-channel.yaml b/blueprints/podcast-channel.yaml index 3f55108..75e05e5 100644 --- a/blueprints/podcast-channel.yaml +++ b/blueprints/podcast-channel.yaml @@ -80,10 +80,12 @@ form: type: text label: PLUGIN_PODCAST.ADMIN.CHANNEL.ITUNES_META.ITUNES_OWNER_LABEL help: PLUGIN_PODCAST.ADMIN.CHANNEL.ITUNES_META.ITUNES_OWNER_HELPTEXT + data-default@: ['\Grav\Plugin\PodcastPlugin::getCurrentUserInfo', 'fullname'] header.podcast.itunes.owner.email: type: email label: PLUGIN_PODCAST.ADMIN.CHANNEL.ITUNES_META.ITUNES_OWNER_EMAIL_LABEL help: PLUGIN_PODCAST.ADMIN.CHANNEL.ITUNES_META.ITUNES_OWNER_EMAIL_HELPTEXT + data-default@: ['\Grav\Plugin\PodcastPlugin::getCurrentUserInfo', 'email'] header.podcast.itunes.image: type: filepicker label: PLUGIN_PODCAST.ADMIN.CHANNEL.ITUNES_META.ITUNES_IMAGE_LABEL diff --git a/blueprints/podcast-episode.yaml b/blueprints/podcast-episode.yaml index a9df5f4..72bebf6 100644 --- a/blueprints/podcast-episode.yaml +++ b/blueprints/podcast-episode.yaml @@ -63,6 +63,7 @@ form: type: text label: PLUGIN_PODCAST.ADMIN.EPISODE.ITUNES_META.AUTHOR_LABEL help: PLUGIN_PODCAST.ADMIN.EPISODE.ITUNES_META.AUTHOR_HELPTEXT + data-default@: ['\Grav\Plugin\PodcastPlugin::getCurrentUserInfo', 'fullname'] header.podcast.itunes.image: type: filepicker label: PLUGIN_PODCAST.ADMIN.EPISODE.ITUNES_META.IMAGE_LABEL diff --git a/podcast.php b/podcast.php index bf592bb..7c92390 100644 --- a/podcast.php +++ b/podcast.php @@ -327,4 +327,19 @@ public static function getLanguageOptions() } return $options; } + + /** + * Returns property of current user for admin blueprints. + * + * @return string + * Property of the currently signed in user. + */ + public static function getCurrentUserInfo($property) + { + if (!$property) { + return ""; + } + $grav = Grav::instance(); + return $grav['user']->get($property); + } }