<?php
-
+/*
+License:
+This software is published under the same license as NucleusCMS, namely
+the GNU General Public License. See http://www.gnu.org/licenses/gpl.html for
+details about the conditions of this license.
+
+In general, this program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option) any
+later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+* @version $Id: NP_Text.php 1678 2012-02-26 07:31:36Z sakamocchi $
+*/
class NP_Text extends NucleusPlugin
{
public $incModePref = array();
public $errorLogged = false;
public $constantPrefix = "SL_";
- public function getName() { return 'Text'; }
- public function getAuthor() { return 'Armon Toubman'; }
- public function getURL() { return 'http://forum.nucleuscms.org/viewtopic.php?t=14904'; }
- public function getVersion() { return '0.53'; }
- public function getDescription() { return 'Display constants from translation files: <%Text(CONSTANT)%>'; }
- public function getEventList() { return array('PreSkinParse'); }
- public function supportsFeature($feature) { return ( $feature == 'SqlTablePrefix' ); }
- public function install() { return; }
- public function uninstall() { return; }
+ public function getName()
+ {
+ return 'Text';
+ }
+ public function getAuthor()
+ {
+ return 'Armon Toubman';
+ }
+
+ public function getURL()
+ {
+ return 'http://forum.nucleuscms.org/viewtopic.php?t=14904';
+ }
+
+ public function getVersion()
+ {
+ return '0.53';
+ }
+
+ public function getDescription()
+ {
+ return 'Display constants from translation files: <%Text(CONSTANT)%>';
+ }
+
+ public function getEventList()
+ {
+ return array('PreSkinParse');
+ }
+
+ public function supportsFeature($feature)
+ {
+ return ( $feature == 'SqlTablePrefix' );
+ }
+
+ public function install()
+ {
+ return;
+ }
+
+ public function uninstall()
+ {
+ return;
+ }
+
public function init()
{
$this->incModePref = $this->skin_incmodepref();
$filename = $filename.".php";
}
- if( is_file($filename) ) {
+ if ( is_file($filename) )
+ {
include($filename);
}
else
addToLog(1, "NP_Text cannot find ".$filename);
}
- if( defined($this->constantPrefix.$constant) )
+ if ( defined($this->constantPrefix.$constant) )
{
echo constant($this->constantPrefix.$constant);
}
private function skin_incmodepref()
{
global $currentSkinName;
- $sql = "SELECT * FROM ".sql_table("skin_desc")." WHERE sdname = '".$currentSkinName."'";
+ $sql = "SELECT * FROM " . sql_table("skin_desc") . " WHERE sdname = '" . $currentSkinName . "'";
$result = sql_query($sql);
$row = sql_fetch_array($result, MYSQL_ASSOC);
return array($row['sdincmode'], $row['sdincpref']);