X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FTemplatePlugin.php;h=5f3ad81f526a238ad7fadd5b930d09469d88de54;hb=d9cde0ef80ee838a99035d44f0286b3cc902e332;hp=03daf6219c8960e5239b00adeae534a00e393ab1;hpb=003c63e587128c6d095386c563c2615c2ac245c2;p=quix0rs-gnu-social.git diff --git a/plugins/TemplatePlugin.php b/plugins/TemplatePlugin.php index 03daf6219c..5f3ad81f52 100644 --- a/plugins/TemplatePlugin.php +++ b/plugins/TemplatePlugin.php @@ -8,14 +8,14 @@ * The method is disabled unless the user is #1, the first user of the system * * @category Plugin - * @package Laconica + * @package StatusNet * @author Brian Hendrickson * @copyright 2009 Megapump, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://megapump.com/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET')) { exit(1); } @@ -32,7 +32,7 @@ class TemplatePlugin extends Plugin { // capture the RouterInitialized event // and connect a new API method // for updating the template - function onRouterInitialized( &$m ) { + function onRouterInitialized( $m ) { $m->connect( 'template/update', array( 'action' => 'template', )); @@ -195,16 +195,16 @@ class TemplatePlugin extends Plugin { ); // use the PHP template - // unless laconica config: + // unless statusnet config: // $config['template']['mode'] = 'html'; if (!(common_config('template', 'mode') == 'html')) { - $tpl_file = 'tpl/index.php'; + $tpl_file = $this->templateFolder() . '/index.php'; $tags = array_merge($vars,$this->blocks); include $tpl_file; return; } - $tpl_file = 'tpl/index.html'; + $tpl_file = $this->templateFolder() . '/index.html'; // read the static template $output = file_get_contents( $tpl_file ); @@ -236,6 +236,9 @@ class TemplatePlugin extends Plugin { return true; } + function templateFolder() { + return 'tpl'; + } // catching the StartShowHTML event to halt the rendering function onStartShowHTML( &$act ) { @@ -258,7 +261,7 @@ class TemplatePlugin extends Plugin { * parameter "template", containing the new template code * * @category Plugin - * @package Laconica + * @package StatusNet * @author Brian Hendrickson * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://megapump.com/ @@ -280,7 +283,7 @@ class TemplateAction extends Action if (!isset($_SERVER['PHP_AUTH_USER'])) { // not authenticated, show login form - header('WWW-Authenticate: Basic realm="Laconica API"'); + header('WWW-Authenticate: Basic realm="StatusNet API"'); // cancelled the browser login form $this->clientError(_('Authentication error!'), $code = 401); @@ -300,7 +303,7 @@ class TemplateAction extends Action $this->clientError(_('only User #1 can update the template'), $code = 401); // open the old template - $tpl_file = 'tpl/index.html'; + $tpl_file = $this->templateFolder() . '/index.html'; $fp = fopen( $tpl_file, 'w+' ); // overwrite with the new template @@ -323,13 +326,13 @@ class TemplateAction extends Action } /** - * Function for retrieving a laconica display section + * Function for retrieving a statusnet display section * * requires one parameter, the name of the section * section names are listed in the comments of the TemplatePlugin class * * @category Plugin - * @package Laconica + * @package StatusNet * @author Brian Hendrickson * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://megapump.com/