From 7e173f5db80b348d01375a1e53b8ac050c082dea Mon Sep 17 00:00:00 2001 From: Jeroen De Dauw Date: Sat, 20 Nov 2010 15:14:12 +0100 Subject: [PATCH] Added Awesomeness extension --- plugins/Awesomeness/AwesomenessPlugin.php | 111 ++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 plugins/Awesomeness/AwesomenessPlugin.php diff --git a/plugins/Awesomeness/AwesomenessPlugin.php b/plugins/Awesomeness/AwesomenessPlugin.php new file mode 100644 index 0000000000..0d7900064d --- /dev/null +++ b/plugins/Awesomeness/AwesomenessPlugin.php @@ -0,0 +1,111 @@ +. + * + * @category Plugin + * @package StatusNet + * @author Jeroen De Dauw + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://status.net/ + */ + +if (!defined('STATUSNET')) { + exit(1); +} + +/** + * Facebook plugin to add a StatusNet Facebook canvas application + * and allow registration and authentication via Facebook Connect + * + * @category Plugin + * @package StatusNet + * @author Jeroen De Dauw + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://status.net/ + */ + +class AwesomenessPlugin extends Plugin +{ + + const VERSION = '0.0.42'; + + public function onPluginVersion(&$versions) + { + $versions[] = array( + 'name' => 'Awesomeness', + 'version' => self::VERSION, + 'author' => 'Jeroen De Dauw', + 'homepage' => 'http://status.net/wiki/Plugin:Awesomeness', + 'rawdescription' => _m( + 'The Awesomeness plugin adds adittional awesomeness ' . + 'to your StatusNet install. ' + ) + ); + return true; + } + + /** + * Add the conrnify button + * + * @param Action $action the current action + * + * @return void + */ + + function onEndShowSections(Action $action) + { + $action->elementStart('div', array('id' => 'cornify_section', + 'class' => 'section')); + + $action->raw( + << + Cornify + + +EOT + ); + + $action->elementEnd('div'); + } + + /** + * Hook for new-notice form processing to take our HTML goodies; + * won't affect API posting etc. + * + * @param NewNoticeAction $action + * @param User $user + * @param string $content + * @param array $options + * @return boolean hook return + */ + function onStartSaveNewNoticeWeb($action, $user, &$content, &$options) + { + $content = htmlspecialchars($content); + $options['rendered'] = preg_replace("/(^|\s|-)(awesome|awesomeness[\?!\.\,]?)(\s|$)/i", " $2 ", $content); + } + +} \ No newline at end of file -- 2.39.5