Permalink
Browse files

New system plugin for managing Square One text

  • Loading branch information...
1 parent f674a96 commit a730aa3c3cec6f6c240aca4b45804708a3529904 @gnomeontherun gnomeontherun committed Apr 3, 2012
Showing with 36 additions and 0 deletions.
  1. 0 plugins/system/squareone/index.html
  2. +36 −0 plugins/system/squareone/squareone.php
View
0 plugins/system/squareone/index.html
No changes.
View
36 plugins/system/squareone/squareone.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * @copyright Copyright (C) 2012 Square One CMS. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE.txt
+ */
+
+// no direct access
+defined('_JEXEC') or die;
+
+/**
+ * Square One Cache Plugin
+ *
+ * @package SquareOne.Plugin
+ * @subpackage System.squareone
+ */
+class plgSystemSquareone extends JPlugin
+{
+ private $buffer;
+
+ public function onAfterRender()
+ {
+ $this->buffer = JResponse::getBody();
+
+ // Change Joomla strings to Square One
+ $this->joomlaToSquareone();
+
+ JResponse::setBody($this->buffer);
+ }
+
+ private function joomlaToSquareone()
+ {
+
+ $this->buffer = preg_replace('/joomla(?:!)/i', 'Square One', $this->buffer);
+ $this->buffer = preg_replace('/_joomla_/i', 'Joomla', $this->buffer);
+ }
+}

0 comments on commit a730aa3

Please sign in to comment.