diff --git a/.gitignore b/.gitignore index 9e6463f..b7ddfd8 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ # Include the custom theme !/www/themes/jason-williamsca/** + +# Include custom plugins +!/www/plugins/jasonwilliams/** diff --git a/www/plugins/jasonwilliams/calgaryconditions/Plugin.php b/www/plugins/jasonwilliams/calgaryconditions/Plugin.php new file mode 100644 index 0000000..b67812e --- /dev/null +++ b/www/plugins/jasonwilliams/calgaryconditions/Plugin.php @@ -0,0 +1,28 @@ + 'Calgary Conditions', + 'description' => 'Provides local time and weather information for Calgary, AB, Canada', + 'author' => 'Jason Williams', + 'icon' => 'oc-icon-cloud' + ]; + } + + public function registerComponents() + { + return [ + '\JasonWilliams\CalgaryConditions\Components\CurrentInfo' => 'CurrentInfo' + ]; + } +} diff --git a/www/plugins/jasonwilliams/calgaryconditions/components/CurrentInfo.php b/www/plugins/jasonwilliams/calgaryconditions/components/CurrentInfo.php new file mode 100644 index 0000000..51882d3 --- /dev/null +++ b/www/plugins/jasonwilliams/calgaryconditions/components/CurrentInfo.php @@ -0,0 +1,23 @@ + 'Current Info', + 'description' => 'Displays the current weather and time in Calgary, AB, Canada' + ]; + } + + public function onRun() + { + date_default_timezone_set('America/Edmonton'); + $this->fields['time'] = date('g:ia'); + } +} diff --git a/www/plugins/jasonwilliams/calgaryconditions/components/currentinfo/default.htm b/www/plugins/jasonwilliams/calgaryconditions/components/currentinfo/default.htm new file mode 100644 index 0000000..70c8283 --- /dev/null +++ b/www/plugins/jasonwilliams/calgaryconditions/components/currentinfo/default.htm @@ -0,0 +1,3 @@ +{% set conditions = __SELF__.fields %} + +

Right now in Calgary the time is {{ conditions.time }}

diff --git a/www/plugins/jasonwilliams/calgaryconditions/lang/en-ca/lang.php b/www/plugins/jasonwilliams/calgaryconditions/lang/en-ca/lang.php new file mode 100644 index 0000000..4b89674 --- /dev/null +++ b/www/plugins/jasonwilliams/calgaryconditions/lang/en-ca/lang.php @@ -0,0 +1,6 @@ + [ + 'name' => 'Calgary Conditions', + 'description' => 'Provides local time and weather information for Calgary, AB, Canada' + ] +]; diff --git a/www/plugins/jasonwilliams/calgaryconditions/plugin.yaml b/www/plugins/jasonwilliams/calgaryconditions/plugin.yaml new file mode 100644 index 0000000..ced5a83 --- /dev/null +++ b/www/plugins/jasonwilliams/calgaryconditions/plugin.yaml @@ -0,0 +1,6 @@ +plugin: + name: 'jasonwilliams.calgaryconditions::lang.plugin.name' + description: 'jasonwilliams.calgaryconditions::lang.plugin.description' + author: 'Jason Williams' + icon: oc-icon-cloud + homepage: 'https://ja.son-williams.ca/' diff --git a/www/plugins/jasonwilliams/calgaryconditions/updates/version.yaml b/www/plugins/jasonwilliams/calgaryconditions/updates/version.yaml new file mode 100644 index 0000000..13703f5 --- /dev/null +++ b/www/plugins/jasonwilliams/calgaryconditions/updates/version.yaml @@ -0,0 +1 @@ +0.0.1: Initial version