Skip to content

Commit

Permalink
Make sure install lifecycle event fires properly
Browse files Browse the repository at this point in the history
– Set plugin flags to 2
  • Loading branch information
jools-r committed Dec 5, 2016
1 parent fd12ab8 commit 0eabee9
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 132 deletions.
4 changes: 4 additions & 0 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ The plugin cleans up after itself: deinstalling the plugin removes the extra col

h2(#changelog). Changelog

h3. Version 0.1.1 – 2016/12/05

* Remedy table not being created on install

h3. Version 0.1 – 2016/03/04

* First release
Expand Down
8 changes: 6 additions & 2 deletions jcr_file_custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// 1 = Plugin help is in raw HTML. Not recommended.
# $plugin['allow_html_help'] = 1;

$plugin['version'] = '0.1';
$plugin['version'] = '0.1.1';
$plugin['author'] = 'jcr / txpbuilders';
$plugin['author_uri'] = 'http://txp.builders';
$plugin['description'] = 'Adds a custom field to the files panel';
Expand Down Expand Up @@ -45,7 +45,7 @@
if (!defined('PLUGIN_HAS_PREFS')) define('PLUGIN_HAS_PREFS', 0x0001); // This plugin wants to receive "plugin_prefs.{$plugin['name']}" events
if (!defined('PLUGIN_LIFECYCLE_NOTIFY')) define('PLUGIN_LIFECYCLE_NOTIFY', 0x0002); // This plugin wants to receive "plugin_lifecycle.{$plugin['name']}" events

$plugin['flags'] = '';
$plugin['flags'] = '2';

// Plugin 'textpack' is optional. It provides i18n strings to be used in conjunction with gTxt().
// Syntax:
Expand Down Expand Up @@ -255,6 +255,10 @@ function jcr_file_custom($atts)

h2(#changelog). Changelog

h3. Version 0.1.1 – 2016/12/05

* Remedy table not being created on install

h3. Version 0.1 – 2016/03/04

* First release
Expand Down
132 changes: 132 additions & 0 deletions jcr_file_custom_v0.1.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Name: jcr_file_custom v0.1.1
# Type: Admin/Public plugin
# Adds a custom field to the files panel
# Author: jcr / txpbuilders
# URL: http://txp.builders
# Recommended load order: 5

# .....................................................................
# This is a plugin for Textpattern CMS - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# .....................................................................

YToxNTp7czo0OiJuYW1lIjtzOjE1OiJqY3JfZmlsZV9jdXN0b20iO3M6NzoidmVyc2lvbiI7
czo1OiIwLjEuMSI7czo4OiJyZXZpc2lvbiI7czowOiIiO3M6NjoiYXV0aG9yIjtzOjE3OiJq
Y3IgLyB0eHBidWlsZGVycyI7czoxMDoiYXV0aG9yX3VyaSI7czoxOToiaHR0cDovL3R4cC5i
dWlsZGVycyI7czoxMToiZGVzY3JpcHRpb24iO3M6Mzg6IkFkZHMgYSBjdXN0b20gZmllbGQg
dG8gdGhlIGZpbGVzIHBhbmVsIjtzOjU6Im9yZGVyIjtzOjE6IjUiO3M6NDoidHlwZSI7czox
OiIxIjtzOjU6ImZsYWdzIjtzOjE6IjIiO3M6ODoidGV4dHBhY2siO3M6OTc6IiNAYWRtaW4K
I0BsYW5ndWFnZSBlbi1nYgpqY3JfZmlsZV9jdXN0b20gPT4gSW1hZ2UgSUQKI0BsYW5ndWFn
ZSBkZS1kZQpqY3JfZmlsZV9jdXN0b20gPT4gQmlsZCBJRAoiO3M6MTA6ImxvYWRfb3JkZXIi
O3M6MToiNSI7czo0OiJoZWxwIjtzOjMxMzA6IjxoMT5qY3JfZmlsZV9jdXN0b208L2gxPgoK
PHA+QWRkcyBhIHNpbmdsZSBleHRyYSBjdXN0b20gZmllbGQgb2YgdXAgdG8gMjU1IGNoYXJh
Y3RlcnMgdG8gdGhlIDxhIGhyZWY9Imh0dHA6Ly9kb2NzLnRleHRwYXR0ZXJuLmlvL2FkbWlu
aXN0cmF0aW9uL2ZpbGVzLXBhbmVsIj5Db250ZW50IOKAuiBGaWxlczwvYT4gcGFuZWwgYW5k
IHByb3ZpZGVzIGEgY29ycmVzcG9uZGluZyB0YWcgdG8gb3V0cHV0IHRoZSBjdXN0b20gZmll
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hdHRzKSk7CgogICAgICAgIHJldHVy
biAoJGVzY2FwZSA9PSAnaHRtbCcpCiAgICAgICAgICAgID8gdHhwc3BlY2lhbGNoYXJzKCR0
aGlzZmlsZVsnamNyX2ZpbGVfY3VzdG9tJ10pCiAgICAgICAgICAgIDogJHRoaXNmaWxlWydq
Y3JfZmlsZV9jdXN0b20nXTsKICAgIH0iO3M6MzoibWQ1IjtzOjMyOiI3MzQ4MDU3YjAyZDIy
ZjgyZTNlNTZiMTEwNzQwNGJhMCI7fQ==
130 changes: 0 additions & 130 deletions jcr_file_custom_v0.1.txt

This file was deleted.

0 comments on commit 0eabee9

Please sign in to comment.