Skip to content

Commit

Permalink
Initial commit of plugin template.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpinkham committed Jan 18, 2019
1 parent d5d3a53 commit 63c7050
Show file tree
Hide file tree
Showing 13 changed files with 155 additions and 0 deletions.
17 changes: 17 additions & 0 deletions about.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div style="margin:0 auto;"> <br />
<fieldset style="padding: 10px; border: 2px solid #000;">
<legend>Template Plugin Info</legend>
<div style="overflow: hidden; padding: 10px;">
<div>
<div id='credits'>
<b>Template Plugin Developed By:</b><br />
<br />
John Doe (jdoe)<br />
<br />
<a href='https://github.com/FalconChristmas/fpp-plugin-Template'>Git Repository</a><br>
<a href='https://github.com/FalconChristmas/fpp-plugin-Template/issues'>Bug Reporter</a><br>
<br />
</div>
</div>
</fieldset>
</div>
1 change: 1 addition & 0 deletions content.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Template Plugin Content Setup Page Placeholder
1 change: 1 addition & 0 deletions help.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Template Plugin Help Page Placeholder
79 changes: 79 additions & 0 deletions menu.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php

# $menuEntries is an array of menu entries for this plugin
# text - menu entry text
# type - status/content/output/help (main menu area)
# page - PHP file to display for this menu item
# wrap - 0/1 to hide or display the FPP header, menu, and footer on this page.
# This does not apply for pages which begin with http:// or https://

# Comment out sub arrays to not display an item under a menu or add your own
# entries to display additional menu items such as the 3 items under the
# help menu in this example template.

$menuEntries = Array(
Array(
'text' => 'Template - Status',
'type' => 'status',
'page' => 'status.php',
'wrap' => 1
),
# Array(
# 'text' => 'Template - Content Setup',
# 'type' => 'content',
# 'page' => 'content.php',
# 'wrap' => 1
# ),
# Array(
# 'text' => 'Template - Output',
# 'type' => 'output',
# 'page' => 'output.php',
# 'wrap' => 1
# ),
Array(
'text' => 'Template - Help',
'type' => 'help',
'page' => 'help.php',
'wrap' => 1
),
Array(
'text' => 'Template - Home',
'type' => 'help',
'page' => 'https://github.com/FalconChristmas/fpp-plugin-Template',
'wrap' => 1
),
Array(
'text' => 'Template - About',
'type' => 'help',
'page' => 'about.php',
'wrap' => 1
)
);

##############################################################################
# Display the menu entries for this plugin.
#
# It is expected that two variables are alread set:
# $plugin - contains the name of the current plugin directory/repoName
# $menu - contains the name of the menu section/type
foreach ($menuEntries as $entry)
{
if ($entry['type'] != $menu)
continue;

if (preg_match('/^http.?:\/\//', $entry['page']))
{
printf("<li><a href='%s' target='_blank'>%s</a></li>\n",
$entry['page'], $entry['text']);
}
else
{
$nopage = '';
if (isset($entry['wrap']) && ($entry['wrap'] == 0))
$nopage = '&nopage=1';

printf("<li><a href='plugin.php?plugin=%s&page=%s%s'>%s</a></li>\n",
$plugin, $entry['page'], $nopage, $entry['text']);
}
}
?>
1 change: 1 addition & 0 deletions output.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Template Plugin Outputs Page Placeholder
31 changes: 31 additions & 0 deletions pluginInfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"repoName": "fpp-plugin-Template",
"name": "Template Plugin for FPP Plugin developers",
"author": "John Doe (jdoe)",
"description": "This template plugin is designed to make it easier for plugin authors to create new FPP Plugins. You can manually clone the git repository or install the Template Plugin and then go to the plugin's config page and use the form to copy the template into a new plugin directory.",
"homeURL": "https://github.com/FalconChristmas/fpp-plugin-Template",
"srcURL": "https://github.com/FalconChristmas/fpp-plugin-Template.git",
"bugURL": "https://github.com/FalconChristmas/fpp-plugin-Template/issues",
"versions": [
{
"minFPPVersion": 2.0,
"maxFPPVersion": 0,
"branch": "master",
"sha": ""
}
],
"dependencies": {
"plugins": [
"fpp-plugin-CoolPlugin1",
"fpp-plugin-CoolPlugin2"
],
"packages": [
"system-package-name1",
"system-package-name2"
],
"scripts": [
"Control/script-repository-script1",
"PixelOverlay/script-repository-script2"
]
}
}
4 changes: 4 additions & 0 deletions scripts/fpp_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

# fpp-plugin-Template install script

4 changes: 4 additions & 0 deletions scripts/fpp_uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

# fpp-plugin-Template uninstall script

4 changes: 4 additions & 0 deletions scripts/postStart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

echo "Running fpp-plugin-Template PostStart Script"

4 changes: 4 additions & 0 deletions scripts/postStop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

#echo "Running fpp-plugin-Template PostStop Script"

4 changes: 4 additions & 0 deletions scripts/preStart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

echo "Running fpp-plugin-Template PreStart Script"

4 changes: 4 additions & 0 deletions scripts/preStop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

#echo "Running fpp-plugin-Template PreStop Script"

1 change: 1 addition & 0 deletions status.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Template Plugin Status Page Placeholder

0 comments on commit 63c7050

Please sign in to comment.