SF.net SVN: phpwiki:[11015] trunk
vargenau--- via phpwiki-checkins <[email protected]> Thu, 24 Mar 2022 13:58:55 +0000
| Newsgroups | gmane.comp.web.wiki.phpwiki.checkins |
|---|---|
| Message-ID | <[email protected]> |
Revision: 11015
http://sourceforge.net/p/phpwiki/code/11015
Author: vargenau
Date: 2022-03-24 13:58:54 +0000 (Thu, 24 Mar 2022)
Log Message:
-----------
run php-cs-fixer
Modified Paths:
--------------
trunk/RPC2.php
trunk/SOAP.php
trunk/configurator.php
trunk/getimg.php
trunk/index.php
trunk/passencrypt.php
trunk/themes/Crao/themeinfo.php
trunk/themes/Hawaiian/lib/random.php
trunk/themes/Hawaiian/themeinfo.php
trunk/themes/MacOSX/buttons/index.php
trunk/themes/MacOSX/lib/RecentChanges.php
trunk/themes/MacOSX/themeinfo.php
trunk/themes/MonoBook/themeinfo.php
trunk/themes/Portland/lib/RecentChanges.php
trunk/themes/Portland/themeinfo.php
trunk/themes/Sidebar/hyperapplet.php
trunk/themes/Sidebar/themeinfo.php
trunk/themes/SpaceWiki/lib/RecentChanges.php
trunk/themes/SpaceWiki/themeinfo.php
trunk/themes/Wordpress/lib/RecentChanges.php
trunk/themes/Wordpress/themeinfo.php
trunk/themes/alphatest.php
trunk/themes/blog/jscalendar/calendar.php
trunk/themes/blog/jscalendar/test.php
trunk/themes/blog/lib/RecentChanges.php
trunk/themes/blog/themeinfo.php
trunk/themes/fusionforge/themeinfo.php
trunk/themes/shamino_com/themeinfo.php
trunk/themes/smaller/themeinfo.php
trunk/themes/wikilens/themeinfo.php
trunk/uploads/index.php
Modified: trunk/RPC2.php
===================================================================
--- trunk/RPC2.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/RPC2.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -34,8 +34,9 @@
*/
// Intercept GET requests from confused users. Only POST is allowed here!
-if (empty($GLOBALS['HTTP_SERVER_VARS']))
+if (empty($GLOBALS['HTTP_SERVER_VARS'])) {
$GLOBALS['HTTP_SERVER_VARS'] =& $_SERVER;
+}
if ($_SERVER['REQUEST_METHOD'] != "POST") {
die('This is the address of the XML-RPC interface.' .
' You must use XML-RPC calls to access information here.');
@@ -42,7 +43,7 @@
}
// Constant defined to indicate to phpwiki that it is being accessed via XML-RPC
-define ("WIKI_XMLRPC", true);
+define("WIKI_XMLRPC", true);
// Start up the main code
include_once 'index.php';
Modified: trunk/SOAP.php
===================================================================
--- trunk/SOAP.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/SOAP.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -40,8 +40,8 @@
* @author: Marc-Etienne Vargenau
* Rewrite with native PHP 5 SOAP
*/
-define ("WIKI_SOAP", true);
-define ("PHPWIKI_NOMAIN", true);
+define("WIKI_SOAP", true);
+define("PHPWIKI_NOMAIN", true);
require_once 'lib/prepend.php';
require_once 'lib/IniConfig.php';
@@ -57,20 +57,23 @@
} elseif ($credentials && is_string($credentials) && base64_decode($credentials, true)) {
list($username, $password) = explode(':', base64_decode($credentials));
} else {
- if (!isset($_SERVER))
+ if (!isset($_SERVER)) {
$_SERVER =& $GLOBALS['HTTP_SERVER_VARS'];
- // TODO: where in the header is the client IP
- if (!isset($username)) {
- if (isset($_SERVER['REMOTE_ADDR']))
- $username = $_SERVER['REMOTE_ADDR'];
- elseif (isset($GLOBALS['REMOTE_ADDR']))
- $username = $GLOBALS['REMOTE_ADDR'];
- else
- $username = $server->host;
+ }
+ // TODO: where in the header is the client IP
+ if (!isset($username)) {
+ if (isset($_SERVER['REMOTE_ADDR'])) {
+ $username = $_SERVER['REMOTE_ADDR'];
+ } elseif (isset($GLOBALS['REMOTE_ADDR'])) {
+ $username = $GLOBALS['REMOTE_ADDR'];
+ } else {
+ $username = $server->host;
}
+ }
}
- if (!isset($password))
+ if (!isset($password)) {
$password = '';
+ }
global $request;
$request->_user = WikiUser($username);
@@ -77,11 +80,13 @@
$request->_user->AuthCheck(array('userid' => $username, 'passwd' => $password));
if (!mayAccessPage($access, $pagename)) {
- $server->fault(401, "no permission, "
+ $server->fault(
+ 401,
+ "no permission, "
. "access=$access, "
. "pagename=$pagename, "
. "username=$username"
- );
+ );
}
$credentials = array('username' => $username, 'password' => $password);
}
@@ -91,7 +96,7 @@
//todo: check and set credentials
// requiredAuthorityForPage($action);
// require 'edit' access
- function doSavePage($pagename, $content, $credentials = false)
+ public function doSavePage($pagename, $content, $credentials = false)
{
global $server;
checkCredentials($server, $credentials, 'edit', $pagename);
@@ -116,7 +121,7 @@
}
// require 'view' access
- function getPageContent($pagename, $credentials = false)
+ public function getPageContent($pagename, $credentials = false)
{
global $server;
checkCredentials($server, $credentials, 'view', $pagename);
@@ -128,7 +133,7 @@
}
// require 'view' access
- function getPageRevision($pagename, $revision, $credentials = false)
+ public function getPageRevision($pagename, $revision, $credentials = false)
{
global $server;
checkCredentials($server, $credentials, 'view', $pagename);
@@ -140,7 +145,7 @@
}
// require 'view' access
- function getCurrentRevision($pagename, $credentials = false)
+ public function getCurrentRevision($pagename, $credentials = false)
{
global $server;
checkCredentials($server, $credentials, 'view', $pagename);
@@ -147,11 +152,11 @@
$dbi = WikiDB::open($GLOBALS['DBParams']);
$page = $dbi->getPage($pagename);
$version = $page->getVersion();
- return (double)$version;
+ return (float)$version;
}
// require 'change' or 'view' access ?
- function getPageMeta($pagename, $credentials = false)
+ public function getPageMeta($pagename, $credentials = false)
{
global $server;
checkCredentials($server, $credentials, 'view', $pagename);
@@ -161,7 +166,7 @@
}
// require 'view' access to AllPages
- function getAllPagenames($credentials = false)
+ public function getAllPagenames($credentials = false)
{
global $server;
checkCredentials($server, $credentials, 'view', _("AllPages"));
@@ -176,7 +181,7 @@
}
// require 'view' access
- function getBacklinks($pagename, $credentials = false)
+ public function getBacklinks($pagename, $credentials = false)
{
global $server;
checkCredentials($server, $credentials, 'view', $pagename);
@@ -192,7 +197,7 @@
}
// require 'view' access to TitleSearch
- function doTitleSearch($s, $credentials = false)
+ public function doTitleSearch($s, $credentials = false)
{
require_once 'lib/TextSearchQuery.php';
@@ -209,7 +214,7 @@
}
// require 'view' access to FullTextSearch
- function doFullTextSearch($s, $credentials = false)
+ public function doFullTextSearch($s, $credentials = false)
{
require_once 'lib/TextSearchQuery.php';
@@ -226,7 +231,7 @@
}
// require 'view' access to RecentChanges
- function getRecentChanges($limit = false, $since = false, $include_minor = false, $credentials = false)
+ public function getRecentChanges($limit = false, $since = false, $include_minor = false, $credentials = false)
{
global $server;
checkCredentials($server, $credentials, 'view', _("RecentChanges"));
@@ -247,7 +252,7 @@
}
// require 'view' access
- function listLinks($pagename, $credentials = false)
+ public function listLinks($pagename, $credentials = false)
{
global $server;
checkCredentials($server, $credentials, 'view', $pagename);
@@ -256,19 +261,21 @@
$linkiterator = $page->getPageLinks();
$links = array();
while ($currentpage = $linkiterator->next()) {
- if ($currentpage->exists())
+ if ($currentpage->exists()) {
$links[] = array('pagename' => $currentpage->getName());
+ }
}
return $links;
}
- function listPlugins($credentials = false)
+ public function listPlugins($credentials = false)
{
global $server;
checkCredentials($server, $credentials, 'change', _("HomePage"));
$plugin_dir = 'lib/plugin';
- if (defined('PHPWIKI_DIR'))
+ if (defined('PHPWIKI_DIR')) {
$plugin_dir = PHPWIKI_DIR . "/$plugin_dir";
+ }
$pd = new FileSet($plugin_dir, '*.php');
$plugins = $pd->getFiles();
unset($pd);
@@ -289,7 +296,7 @@
return $RetArray;
}
- function getPluginSynopsis($pluginname, $credentials = false)
+ public function getPluginSynopsis($pluginname, $credentials = false)
{
global $server;
checkCredentials($server, $credentials, 'change', "Help/" . $pluginname . "Plugin");
@@ -302,8 +309,9 @@
$plugin_args = '';
$desc = $p->getArgumentsDescription();
$desc = str_replace("<br />", ' ', $desc->asXML());
- if ($desc)
+ if ($desc) {
$plugin_args = ' ' . $desc;
+ }
$synopsis = "<<" . $pluginname . $plugin_args . ">>";
}
return $synopsis;
@@ -310,7 +318,7 @@
}
// only plugins returning pagelists will return something useful. so omit the html output
- function callPlugin($pluginname, $plugin_args, $credentials = false)
+ public function callPlugin($pluginname, $plugin_args, $credentials = false)
{
global $request;
global $server;
@@ -324,8 +332,9 @@
$pagelist = $p->run($dbi, $plugin_args, $request, $basepage);
$pages = array();
if (is_object($pagelist) and is_a($pagelist, 'PageList')) {
- foreach ($pagelist->pageNames() as $name)
+ foreach ($pagelist->pageNames() as $name) {
$pages[] = array('pagename' => $name);
+ }
}
return $pages;
}
@@ -342,7 +351,7 @@
*
* @author: Reini Urban
*/
- function listRelations($option = 1, $credentials = false)
+ public function listRelations($option = 1, $credentials = false)
{
global $server;
checkCredentials($server, $credentials, 'view', _("HomePage"));
@@ -350,14 +359,16 @@
$also_attributes = $option & 2;
$only_attributes = $option & 2 and !($option & 1);
$sorted = !($option & 4);
- $relations = $dbi->listRelations($also_attributes,
+ $relations = $dbi->listRelations(
+ $also_attributes,
$only_attributes,
- $sorted);
+ $sorted
+ );
return array_keys(array_flip($relations)); // Remove duplicates
}
// some basic semantic search
- function linkSearch($linktype, $search, $pages = "*", $relation = "*", $credentials = false)
+ public function linkSearch($linktype, $search, $pages = "*", $relation = "*", $credentials = false)
{
global $server;
checkCredentials($server, $credentials, 'view', _("HomePage"));
Modified: trunk/configurator.php
===================================================================
--- trunk/configurator.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/configurator.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -57,26 +57,39 @@
*/
global $HTTP_POST_VARS;
-if (empty($_SERVER)) $_SERVER =& $GLOBALS['HTTP_SERVER_VARS'];
-if (empty($_GET)) $_GET =& $GLOBALS['HTTP_GET_VARS'];
-if (empty($_ENV)) $_ENV =& $GLOBALS['HTTP_ENV_VARS'];
-if (empty($_POST)) $_POST =& $GLOBALS['HTTP_POST_VARS'];
+if (empty($_SERVER)) {
+ $_SERVER =& $GLOBALS['HTTP_SERVER_VARS'];
+}
+if (empty($_GET)) {
+ $_GET =& $GLOBALS['HTTP_GET_VARS'];
+}
+if (empty($_ENV)) {
+ $_ENV =& $GLOBALS['HTTP_ENV_VARS'];
+}
+if (empty($_POST)) {
+ $_POST =& $GLOBALS['HTTP_POST_VARS'];
+}
-if (empty($configurator))
+if (empty($configurator)) {
$configurator = "configurator.php";
-if (!strstr($_SERVER["SCRIPT_NAME"], $configurator) and defined('DATA_PATH'))
+}
+if (!strstr($_SERVER["SCRIPT_NAME"], $configurator) and defined('DATA_PATH')) {
$configurator = DATA_PATH . "/" . $configurator;
+}
$scriptname = str_replace('configurator.php', 'index.php', $_SERVER["SCRIPT_NAME"]);
if (strstr($_SERVER["SCRIPT_NAME"], "/php")) { // cgi got this different
- if (defined('DATA_PATH'))
+ if (defined('DATA_PATH')) {
$scriptname = DATA_PATH . "/index.php";
- else
+ } else {
$scriptname = str_replace('configurator.php', 'index.php', $_SERVER["PHP_SELF"]);
+ }
}
$config_file = 'config/config.ini';
$fs_config_file = dirname(__FILE__) . '/' . $config_file;
-if (isset($_POST['create'])) header('Location: ' . $configurator . '?show=_part1&create=1#create');
+if (isset($_POST['create'])) {
+ header('Location: ' . $configurator . '?show=_part1&create=1#create');
+}
if (!function_exists('dba_handlers')) {
function dba_handlers()
@@ -89,17 +102,22 @@
if (!function_exists('_http_user')) {
function _http_user()
{
- if (!isset($_SERVER))
+ if (!isset($_SERVER)) {
$_SERVER = $GLOBALS['HTTP_SERVER_VARS'];
- if (!empty($_SERVER['PHP_AUTH_USER']))
+ }
+ if (!empty($_SERVER['PHP_AUTH_USER'])) {
return array($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
- if (!empty($_SERVER['REMOTE_USER']))
+ }
+ if (!empty($_SERVER['REMOTE_USER'])) {
return array($_SERVER['REMOTE_USER'], $_SERVER['PHP_AUTH_PW']);
- if (!empty($GLOBALS['HTTP_ENV_VARS']['REMOTE_USER']))
+ }
+ if (!empty($GLOBALS['HTTP_ENV_VARS']['REMOTE_USER'])) {
return array($GLOBALS['HTTP_ENV_VARS']['REMOTE_USER'],
$GLOBALS['HTTP_ENV_VARS']['PHP_AUTH_PW']);
- if (!empty($GLOBALS['REMOTE_USER']))
+ }
+ if (!empty($GLOBALS['REMOTE_USER'])) {
return array($GLOBALS['REMOTE_USER'], $GLOBALS['PHP_AUTH_PW']);
+ }
// MsWindows IIS:
if (!empty($_SERVER['HTTP_AUTHORIZATION'])) {
@@ -111,14 +129,16 @@
function _http_logout()
{
- if (!isset($_SERVER))
+ if (!isset($_SERVER)) {
$_SERVER =& $GLOBALS['HTTP_SERVER_VARS'];
+ }
// maybe we should random the realm to really force a logout. but the next login will fail.
header('WWW-Authenticate: Basic realm="' . WIKI_NAME . '"');
- if (strstr(php_sapi_name(), 'apache'))
+ if (strstr(php_sapi_name(), 'apache')) {
header('HTTP/1.0 401 Unauthorized');
- else
- header("Status: 401 Access Denied"); //IIS and CGI need that
+ } else {
+ header("Status: 401 Access Denied");
+ } //IIS and CGI need that
unset($GLOBALS['REMOTE_USER']);
unset($_SERVER['PHP_AUTH_USER']);
unset($_SERVER['PHP_AUTH_PW']);
@@ -152,8 +172,9 @@
}
// check password
if (ENCRYPTED_PASSWD) {
- if (crypt($admin_pw, ADMIN_PASSWD) != ADMIN_PASSWD)
+ if (crypt($admin_pw, ADMIN_PASSWD) != ADMIN_PASSWD) {
_http_logout();
+ }
} elseif ($admin_pw != ADMIN_PASSWD) {
_http_logout();
}
@@ -398,13 +419,14 @@
new part('_part0', $SEPARATOR . "\n", "
Part Zero: Latest Development and Tricky Options");
-if (defined('INCLUDE_PATH'))
+if (defined('INCLUDE_PATH')) {
$include_path = INCLUDE_PATH;
-else {
+} else {
if (substr(PHP_OS, 0, 3) == 'WIN') {
$include_path = dirname(__FILE__) . ';' . ini_get('include_path');
- if (strchr(ini_get('include_path'), '/'))
+ if (strchr(ini_get('include_path'), '/')) {
$include_path = strtr($include_path, '\\', '/');
+ }
} else {
$include_path = dirname(__FILE__) . ':' . ini_get('include_path');
}
@@ -439,7 +461,8 @@
'spaw' => 'spaw',
'htmlarea3' => 'htmlarea3',
'htmlarea2' => 'htmlarea2',
- ));
+ )
+ );
$properties["WYSIWYG_DEFAULT_PAGETYPE_HTML"] =
new boolean_define_commented_optional('WYSIWYG_DEFAULT_PAGETYPE_HTML');
@@ -509,12 +532,19 @@
new _define_optional('WIKI_NAME', WIKI_NAME);
$properties["Admin Username"] =
- new _define_notempty('ADMIN_USER', ADMIN_USER, "
+ new _define_notempty(
+ 'ADMIN_USER',
+ ADMIN_USER,
+ "
You must set this! Username and password of the administrator.",
- "onchange=\"validate_ereg('Sorry, ADMIN_USER cannot be empty.', '^.+$', 'ADMIN_USER', this);\"");
+ "onchange=\"validate_ereg('Sorry, ADMIN_USER cannot be empty.', '^.+$', 'ADMIN_USER', this);\""
+ );
$properties["Admin Password"] =
- new _define_password('ADMIN_PASSWD', ADMIN_PASSWD, "
+ new _define_password(
+ 'ADMIN_PASSWD',
+ ADMIN_PASSWD,
+ "
You must set this!
For heaven's sake pick a good password.
@@ -523,27 +553,32 @@
Use the \"Create Random Password\" button to create a good (random) password.
ADMIN_PASSWD is ignored on HttpAuth",
- "onchange=\"validate_ereg('Sorry, ADMIN_PASSWD must be at least 4 chars long.', '^....+$', 'ADMIN_PASSWD', this);\"");
+ "onchange=\"validate_ereg('Sorry, ADMIN_PASSWD must be at least 4 chars long.', '^....+$', 'ADMIN_PASSWD', this);\""
+ );
$properties["Encrypted Passwords"] =
- new boolean_define
- ('ENCRYPTED_PASSWD',
+ new boolean_define(
+ 'ENCRYPTED_PASSWD',
array('true' => "true. use crypt for all passwords",
- 'false' => "false. use plaintest passwords (not recommended)"));
+ 'false' => "false. use plaintest passwords (not recommended)")
+ );
$properties["MAX_PAGENAME_LENGTH"] =
new numeric_define_optional('MAX_PAGENAME_LENGTH');
$properties["Reverse DNS"] =
- new boolean_define_optional
- ('ENABLE_REVERSE_DNS',
+ new boolean_define_optional(
+ 'ENABLE_REVERSE_DNS',
array('true' => "true. perform additional reverse dns lookups",
- 'false' => "false. just record the address as given by the httpd server"));
+ 'false' => "false. just record the address as given by the httpd server")
+ );
$properties["ZIP Dump Authentication"] =
- new boolean_define_optional('ZIPDUMP_AUTH',
+ new boolean_define_optional(
+ 'ZIPDUMP_AUTH',
array('false' => "false. Everyone may download zip dumps",
- 'true' => "true. Only admin may download zip dumps"));
+ 'true' => "true. Only admin may download zip dumps")
+ );
$properties["Enable RawHtml Plugin"] =
new boolean_define_commented_optional('ENABLE_RAW_HTML');
@@ -583,18 +618,20 @@
'ACCESS_LOG_SQL',
array('0' => 'disabled',
'1' => 'read only',
- '2' => 'read + write'));
+ '2' => 'read + write')
+ );
$properties["Compress Output"] =
- new boolean_define_commented_optional
- ('COMPRESS_OUTPUT',
+ new boolean_define_commented_optional(
+ 'COMPRESS_OUTPUT',
array('' => 'undefined - GZIP compress when appropriate.',
'false' => 'Never compress output.',
- 'true' => 'Always try to compress output.'));
+ 'true' => 'Always try to compress output.')
+ );
$properties["HTTP Cache Control"] =
- new _define_selection_optional
- ('CACHE_CONTROL',
+ new _define_selection_optional(
+ 'CACHE_CONTROL',
array('LOOSE' => 'LOOSE',
'STRICT' => 'STRICT',
'NO_CACHE' => 'NO_CACHE',
@@ -635,16 +672,18 @@
and few edits by knowledgeable people who won't freak over the quirks.)</p>
</dd>
</dl>
-The default is currently LOOSE.");
+The default is currently LOOSE."
+ );
$properties["HTTP Cache Control Max Age"] =
new numeric_define_optional('CACHE_CONTROL_MAX_AGE', CACHE_CONTROL_MAX_AGE);
$properties["Markup Caching"] =
- new boolean_define_commented_optional
- ('WIKIDB_NOCACHE_MARKUP',
+ new boolean_define_commented_optional(
+ 'WIKIDB_NOCACHE_MARKUP',
array('false' => 'Enable HTML cache',
- 'true' => 'Disable HTML cache'));
+ 'true' => 'Disable HTML cache')
+ );
$properties["COOKIE_EXPIRATION_DAYS"] =
new numeric_define_optional('COOKIE_EXPIRATION_DAYS', COOKIE_EXPIRATION_DAYS);
@@ -656,10 +695,11 @@
new _define_optional('SESSION_SAVE_PATH', defined('SESSION_SAVE_PATH') ? SESSION_SAVE_PATH : ini_get('session.save_path'));
$properties["Force PHP Database Sessions"] =
- new boolean_define_commented_optional
- ('USE_DB_SESSION',
+ new boolean_define_commented_optional(
+ 'USE_DB_SESSION',
array('false' => 'Disable database sessions, use files',
- 'true' => 'Enable database sessions'));
+ 'true' => 'Enable database sessions')
+ );
///////// database selection
@@ -671,7 +711,8 @@
");
$properties["Database Type"] =
- new _define_selection("DATABASE_TYPE",
+ new _define_selection(
+ "DATABASE_TYPE",
array('dba' => "dba",
'SQL' => "SQL PEAR",
'PDO' => "PDO",
@@ -681,7 +722,8 @@
Choose SQL to use an SQL database with PEAR.
Choose PDO to use an SQL database.
flatfile is simple and slow.
-Recommended is dba or SQL: PEAR."*/);
+Recommended is dba or SQL: PEAR."*/
+ );
$properties["SQL DSN Setup"] =
new unchangeable_variable('_sqldsnstuff', "", "
@@ -708,7 +750,8 @@
// Choose dba to use one of the standard UNIX dbm libraries.
$properties["SQL Type"] =
- new _variable_selection('_dsn_sqltype',
+ new _variable_selection(
+ '_dsn_sqltype',
array('mysql' => "MySQL",
'pgsql' => "PostgreSQL",
'mssql' => "Microsoft SQL Server",
@@ -719,8 +762,10 @@
'ODBC' => "ODBC (only PDO)",
'firebird' => "Firebird (only PDO)",
'oracle' => "Oracle (only PDO)",
- ), "
-SQL DB types. The DSN hosttype.");
+ ),
+ "
+SQL DB types. The DSN hosttype."
+ );
$properties["SQL User"] =
new _variable('_dsn_sqluser', "wikiuser", "
@@ -753,9 +798,12 @@
$dsn_sqlstring = $dsn_sqltype . "://".$dsn_sqluser.":".$dsn_sqlpass."@".$dsn_sqlhostorsock."/".$dsn_sqldbname;
$properties["SQL dsn"] =
- new unchangeable_define("DATABASE_DSN",
- $dsn_sqlstring, "
-Calculated from the settings above:");
+ new unchangeable_define(
+ "DATABASE_DSN",
+ $dsn_sqlstring,
+ "
+Calculated from the settings above:"
+ );
$properties["Filename / Table name Prefix"] =
new _define_commented('DATABASE_PREFIX', DATABASE_PREFIX, "
@@ -772,10 +820,11 @@
");
$properties["DATABASE_PERSISTENT"] =
- new boolean_define_commented_optional
- ('DATABASE_PERSISTENT',
+ new boolean_define_commented_optional(
+ 'DATABASE_PERSISTENT',
array('false' => "Disabled",
- 'true' => "Enabled"));
+ 'true' => "Enabled")
+ );
$properties["DB Session table"] =
new _define_optional("DATABASE_SESSION_TABLE", DATABASE_SESSION_TABLE, "
@@ -791,15 +840,18 @@
// TODO: list the available methods
$properties["dba handler"] =
- new _define_selection('DATABASE_DBA_HANDLER',
+ new _define_selection(
+ 'DATABASE_DBA_HANDLER',
array('gdbm' => "gdbm - GNU database manager (not recommended anymore)",
'dbm' => "DBM - Redhat default.",
'db2' => "DB2 - BerkeleyDB (Sleepycat) DB2",
'db3' => "DB3 - BerkeleyDB (Sleepycat) DB3. Default on Windows but not on every Linux",
- 'db4' => "DB4 - BerkeleyDB (Sleepycat) DB4. Default."), "
+ 'db4' => "DB4 - BerkeleyDB (Sleepycat) DB4. Default."),
+ "
Use 'gdbm', 'dbm', 'db2', 'db3' or 'db4' depending on your DBA handler methods supported: <br /> "
. join(", ", dba_handlers())
- . "\n\nBetter not use other hacks such as inifile, flatfile or cdb");
+ . "\n\nBetter not use other hacks such as inifile, flatfile or cdb"
+ );
$properties["dba timeout"] =
new numeric_define("DATABASE_TIMEOUT", DATABASE_TIMEOUT, "
@@ -818,30 +870,42 @@
");
$properties["Publicly viewable"] =
- new boolean_define_optional('ALLOW_ANON_USER',
+ new boolean_define_optional(
+ 'ALLOW_ANON_USER',
array('true' => "true. Permit anonymous view. (Default)",
- 'false' => "false. Force login even on view (strictly private)"), "
-If ALLOW_ANON_USER is false, you have to login before viewing any page or doing any other action on a page.");
+ 'false' => "false. Force login even on view (strictly private)"),
+ "
+If ALLOW_ANON_USER is false, you have to login before viewing any page or doing any other action on a page."
+ );
$properties["Allow anonymous edit"] =
- new boolean_define_optional('ALLOW_ANON_EDIT',
+ new boolean_define_optional(
+ 'ALLOW_ANON_EDIT',
array('true' => "true. Permit anonymous users to edit. (Default)",
- 'false' => "false. Force login on edit (moderately locked)"), "
-If ALLOW_ANON_EDIT is false, you have to login before editing or changing any page. See below.");
+ 'false' => "false. Force login on edit (moderately locked)"),
+ "
+If ALLOW_ANON_EDIT is false, you have to login before editing or changing any page. See below."
+ );
$properties["Allow Bogo Login"] =
- new boolean_define_optional('ALLOW_BOGO_LOGIN',
+ new boolean_define_optional(
+ 'ALLOW_BOGO_LOGIN',
array('true' => "true. Users may Sign In with any WikiWord, without password. (Default)",
- 'false' => "false. Require stricter authentication."), "
+ 'false' => "false. Require stricter authentication."),
+ "
If ALLOW_BOGO_LOGIN is false, you may not login with any wikiword username and empty password.
-If true, users are allowed to create themselves with any WikiWord username. See below.");
+If true, users are allowed to create themselves with any WikiWord username. See below."
+ );
$properties["Allow User Passwords"] =
- new boolean_define_optional('ALLOW_USER_PASSWORDS',
+ new boolean_define_optional(
+ 'ALLOW_USER_PASSWORDS',
array('true' => "True user authentication with password checking. (Default)",
- 'false' => "false. Ignore authentication settings below."), "
+ 'false' => "false. Ignore authentication settings below."),
+ "
If ALLOW_USER_PASSWORDS is true, the authentication settings below define where and how to
-check against given username/passwords. For completely security disable BOGO_LOGIN and ANON_EDIT above.");
+check against given username/passwords. For completely security disable BOGO_LOGIN and ANON_EDIT above."
+ );
$properties["User Authentication Methods"] =
new array_define('USER_AUTH_ORDER', array("PersonalPage", "Db"), "
@@ -887,11 +951,13 @@
new numeric_define('PASSWORD_LENGTH_MINIMUM', PASSWORD_LENGTH_MINIMUM);
$properties["USER_AUTH_POLICY"] =
- new _define_selection('USER_AUTH_POLICY',
+ new _define_selection(
+ 'USER_AUTH_POLICY',
array('first-only' => "first-only - use only the first method in USER_AUTH_ORDER",
'old' => "old - ignore USER_AUTH_ORDER (legacy)",
'strict' => "strict - check all methods for userid + password (recommended)",
- 'stacked' => "stacked - check all methods for userid, and if found for password"), "
+ 'stacked' => "stacked - check all methods for userid, and if found for password"),
+ "
The following policies are available for user authentication:
<dl>
<dt>first-only</dt>
@@ -905,7 +971,8 @@
dont try the other methods on failure then</dd>
<dt>stacked</dt>
<dd>check the given user - password combination for all
- methods and return true on the first success.</dd></dl>");
+ methods and return true on the first success.</dd></dl>"
+ );
$properties["ENABLE_PAGEPERM"] =
new boolean_define_commented_optional('ENABLE_PAGEPERM');
@@ -919,12 +986,14 @@
Group Membership");
$properties["Group membership"] =
- new _define_selection("GROUP_METHOD",
+ new _define_selection(
+ "GROUP_METHOD",
array('WIKIPAGE' => "WIKIPAGE - List at \"CategoryGroup\". (Slowest, but easiest to maintain)",
'NONE' => "NONE - Disable group membership (Fastest)",
'DB' => "DB - SQL Database, Optionally external. See USERS/GROUPS queries",
'FILE' => "Flatfile. See AUTH_GROUP_FILE below.",
- 'LDAP' => "LDAP - See \"LDAP authentication options\" above. (Experimental)"), "
+ 'LDAP' => "LDAP - See \"LDAP authentication options\" above. (Experimental)"),
+ "
Group membership. PhpWiki supports defining permissions for a group as
well as for individual users. This defines how group membership information
is obtained. Supported values are:
@@ -939,7 +1008,8 @@
<dd>Flatfile. See AUTH_GROUP_FILE below.</dd>
<dt>LDAP</dt>
<dd>LDAP groups. See \"LDAP authentication options\" above and
- lib/WikiGroup.php. (experimental)</dd></dl>");
+ lib/WikiGroup.php. (experimental)</dd></dl>"
+ );
$properties["CATEGORY_GROUP_PAGE"] =
new _define_optional('CATEGORY_GROUP_PAGE', _("CategoryGroup"), "
@@ -985,16 +1055,18 @@
; DBAUTH_AUTH_CHECK = \"SELECT IF(passwd=PASSWORD('\$password'),1,0) AS ok FROM user WHERE userid='\$userid'\"");
$properties["Crypt Method"] =
- new _define_selection_optional
- ('DBAUTH_AUTH_CRYPT_METHOD',
+ new _define_selection_optional(
+ 'DBAUTH_AUTH_CRYPT_METHOD',
array('plain' => 'plain',
- 'crypt' => 'crypt'), "
+ 'crypt' => 'crypt'),
+ "
If you want to use Unix crypt()ed passwords, you can use DBAUTH_AUTH_CHECK
to get the password out of the database with a simple SELECT query, and
specify DBAUTH_AUTH_USER_EXISTS and DBAUTH_AUTH_CRYPT_METHOD:
; DBAUTH_AUTH_CHECK = \"SELECT passwd FROM user where userid='\$userid'\" <br />
-; DBAUTH_AUTH_CRYPT_METHOD = crypt");
+; DBAUTH_AUTH_CRYPT_METHOD = crypt"
+ );
$properties["Update the user's authentication credential"] =
new _define('DBAUTH_AUTH_UPDATE', "UPDATE user SET passwd='\$password' WHERE userid='\$userid'", "
@@ -1156,7 +1228,8 @@
Page appearance and layout");
$properties["Theme"] =
- new _define_selection_optional('THEME',
+ new _define_selection_optional(
+ 'THEME',
array('default' => "default",
'MacOSX' => "MacOSX",
'smaller' => 'smaller',
@@ -1170,7 +1243,8 @@
'Hawaiian' => "Hawaiian",
'MonoBook' => 'MonoBook [experimental]',
'blog' => 'blog [experimental]',
- ), "
+ ),
+ "
THEME
Most of the page appearance is controlled by files in the theme
@@ -1192,10 +1266,12 @@
THEME = SpaceWiki
THEME = Hawaiian
THEME = blog (Kubrick) [experimental]
-</pre>");
+</pre>"
+ );
$properties["Language"] =
- new _define_selection_optional('DEFAULT_LANGUAGE',
+ new _define_selection_optional(
+ 'DEFAULT_LANGUAGE',
array('en' => "English",
'' => "<empty> (user-specific)",
'fr' => "Français",
@@ -1205,7 +1281,8 @@
'sv' => "Svenska",
'it' => "Italiano",
'ja' => "Japanese",
- 'zh' => "Chinese"), "
+ 'zh' => "Chinese"),
+ "
Select your language/locale - default language is \"en\" for English.
Other languages available:<pre>
English \"en\" (English - HomePage)
@@ -1220,7 +1297,8 @@
</pre>
If you set DEFAULT_LANGUAGE to the empty string, your systems default language
(as determined by the applicable environment variables) will be
-used.");
+used."
+ );
$properties["Wiki Page Source"] =
new _define_optional('WIKI_PGSRC', 'pgsrc', "
@@ -1351,14 +1429,20 @@
Canonical name of the server on which this PhpWiki resides.");
$properties["Server Port"] =
- new numeric_define_commented('SERVER_PORT', $_SERVER['SERVER_PORT'], "
+ new numeric_define_commented(
+ 'SERVER_PORT',
+ $_SERVER['SERVER_PORT'],
+ "
Canonical httpd port of the server on which this PhpWiki resides.",
- "onchange=\"validate_ereg('Sorry, \'%s\' is no valid port number.', '^[0-9]+$', 'SERVER_PORT', this);\"");
+ "onchange=\"validate_ereg('Sorry, \'%s\' is no valid port number.', '^[0-9]+$', 'SERVER_PORT', this);\""
+ );
$properties["Server Protocol"] =
- new _define_selection_optional_commented('SERVER_PROTOCOL',
+ new _define_selection_optional_commented(
+ 'SERVER_PROTOCOL',
array('http' => 'http',
- 'https' => 'https'));
+ 'https' => 'https')
+ );
$properties["Script Name"] =
new _define_commented_optional('SCRIPT_NAME', $scriptname);
@@ -1370,10 +1454,12 @@
new _define_commented_optional('PHPWIKI_DIR', dirname(__FILE__));
$properties["Use PATH_INFO"] =
- new _define_selection_optional_commented('USE_PATH_INFO',
+ new _define_selection_optional_commented(
+ 'USE_PATH_INFO',
array('' => 'automatic',
'true' => 'use PATH_INFO',
- 'false' => 'do not use PATH_INFO'), "
+ 'false' => 'do not use PATH_INFO'),
+ "
PhpWiki will try to use short urls to pages, eg
http://www.example.com/index.php/HomePage
If you want to use urls like
@@ -1386,7 +1472,8 @@
Default: PhpWiki will try to divine whether use of PATH_INFO
is supported in by your webserver/PHP configuration, and will
-use PATH_INFO if it thinks that is possible.");
+use PATH_INFO if it thinks that is possible."
+ );
$properties["Virtual Path"] =
new _define_commented_optional('VIRTUAL_PATH', '/SomeWiki', "
@@ -1424,8 +1511,11 @@
new _define_optional('TEMP_DIR', $temp);
$properties["Allowed Load"] =
- new _define_commented_optional('ALLOWED_LOAD', '/tmp',
- 'List of directories from which it is allowed to load pages. Directories are separated with ":"');
+ new _define_commented_optional(
+ 'ALLOWED_LOAD',
+ '/tmp',
+ 'List of directories from which it is allowed to load pages. Directories are separated with ":"'
+ );
///////////////////
@@ -1438,9 +1528,11 @@
");
$properties["Strict Mailable Pagedumps"] =
- new boolean_define_optional('STRICT_MAILABLE_PAGEDUMPS',
+ new boolean_define_optional(
+ 'STRICT_MAILABLE_PAGEDUMPS',
array('false' => "binary",
- 'true' => "quoted-printable"));
+ 'true' => "quoted-printable")
+ );
$properties["Default local Dump Directory"] =
new _define_optional('DEFAULT_DUMP_DIR');
@@ -1488,9 +1580,9 @@
$properties["GRAPHVIZ_EXE"] =
new _define_commented_optional('GRAPHVIZ_EXE', "/usr/bin/dot");
-if (PHP_OS == "Darwin") // Mac OS X
+if (PHP_OS == "Darwin") { // Mac OS X
$ttfont = "/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/lib/fonts/LucidaSansRegular.ttf";
-elseif (isWindows()) {
+} elseif (isWindows()) {
$ttfont = $_ENV['windir'] . '\Fonts\Arial.ttf';
} else {
$ttfont = 'luximr'; // This is the only what sourceforge offered.
@@ -1518,15 +1610,21 @@
");
$properties["pear Cache USECACHE"] =
- new boolean_define_optional('PLUGIN_CACHED_USECACHE',
+ new boolean_define_optional(
+ 'PLUGIN_CACHED_USECACHE',
array('true' => 'Enabled',
- 'false' => 'Disabled'), "
-Enable or disable pear caching of plugins.");
+ 'false' => 'Disabled'),
+ "
+Enable or disable pear caching of plugins."
+ );
$properties["pear Cache Database Container"] =
- new _define_selection_optional('PLUGIN_CACHED_DATABASE',
- array('file' => 'file'), "
+ new _define_selection_optional(
+ 'PLUGIN_CACHED_DATABASE',
+ array('file' => 'file'),
+ "
Curently only file is supported.
-db, trifile and imgfile might be supported, but you must hack that by yourself.");
+db, trifile and imgfile might be supported, but you must hack that by yourself."
+ );
$properties["pear Cache cache directory"] =
new _define_commented_optional('PLUGIN_CACHED_CACHE_DIR', "/tmp/cache", "
@@ -1546,9 +1644,12 @@
new numeric_define_optional('PLUGIN_CACHED_MAXARGLEN', "1000", "
max. generated url length.");
$properties["pear Cache FORCE_SYNCMAP"] =
- new boolean_define_optional('PLUGIN_CACHED_FORCE_SYNCMAP',
+ new boolean_define_optional(
+ 'PLUGIN_CACHED_FORCE_SYNCMAP',
array('true' => 'Enabled',
- 'false' => 'Disabled'), "");
+ 'false' => 'Disabled'),
+ ""
+ );
$properties["pear Cache IMGTYPES"] =
new list_define('PLUGIN_CACHED_IMGTYPES', "png|gif|gd|gd2|jpeg|wbmp|xbm|xpm", "
Handle those image types via GD handles. Check your GD supported image types.");
@@ -1572,97 +1673,106 @@
*/
class _variable
{
- var $config_item_name;
- var $default_value;
- var $description;
- var $prefix;
- var $jscheck;
- var $values;
+ public $config_item_name;
+ public $default_value;
+ public $description;
+ public $prefix;
+ public $jscheck;
+ public $values;
- function __construct($config_item_name, $default_value = '', $description = '', $jscheck = '')
+ public function __construct($config_item_name, $default_value = '', $description = '', $jscheck = '')
{
$this->config_item_name = $config_item_name;
- if (!$description)
+ if (!$description) {
$description = text_from_dist($config_item_name);
+ }
$this->description = $description;
if (defined($config_item_name)
and !preg_match("/(selection|boolean)/", get_class($this))
and !preg_match("/^(SCRIPT_NAME|VIRTUAL_PATH|TEMP_DIR)$/", $config_item_name)
- )
- $this->default_value = constant($config_item_name); // ignore given default value
- elseif ($config_item_name == $default_value)
- $this->default_value = ''; else
+ ) {
+ $this->default_value = constant($config_item_name);
+ } // ignore given default value
+ elseif ($config_item_name == $default_value) {
+ $this->default_value = '';
+ } else {
$this->default_value = $default_value;
+ }
$this->jscheck = $jscheck;
- if (preg_match("/variable/i", get_class($this)))
+ if (preg_match("/variable/i", get_class($this))) {
$this->prefix = "\$";
- elseif (preg_match("/ini_set/i", get_class($this)))
- $this->prefix = "ini_get: "; else
+ } elseif (preg_match("/ini_set/i", get_class($this))) {
+ $this->prefix = "ini_get: ";
+ } else {
$this->prefix = "";
+ }
}
- function _define($config_item_name, $default_value = '', $description = '', $jscheck = '')
+ public function _define($config_item_name, $default_value = '', $description = '', $jscheck = '')
{
_variable::__construct($config_item_name, $default_value, $description, $jscheck);
}
- function value()
+ public function value()
{
global $HTTP_POST_VARS;
- if (isset($HTTP_POST_VARS[$this->config_item_name]))
+ if (isset($HTTP_POST_VARS[$this->config_item_name])) {
return $HTTP_POST_VARS[$this->config_item_name];
- else
+ } else {
return $this->default_value;
+ }
}
- function _config_format($value)
+ public function _config_format($value)
{
return '';
}
- function get_config_item_name()
+ public function get_config_item_name()
{
return $this->config_item_name;
}
- function get_config_item_id()
+ public function get_config_item_id()
{
return str_replace('|', '-', $this->config_item_name);
}
- function get_config_item_header()
+ public function get_config_item_header()
{
if (strchr($this->config_item_name, '|')) {
list($var, $param) = explode('|', $this->config_item_name);
return "<b>" . $this->prefix . $var . "['" . $param . "']</b><br />";
- } elseif ($this->config_item_name[0] != '_')
- return "<b>" . $this->prefix . $this->config_item_name . "</b><br />"; else
+ } elseif ($this->config_item_name[0] != '_') {
+ return "<b>" . $this->prefix . $this->config_item_name . "</b><br />";
+ } else {
return '';
+ }
}
- function _get_description()
+ public function _get_description()
{
return $this->description;
}
- function _get_config_line($posted_value)
+ public function _get_config_line($posted_value)
{
return "\n" . $this->_config_format($posted_value);
}
- function get_config($posted_value)
+ public function get_config($posted_value)
{
$d = stripHtml($this->_get_description());
return str_replace("\n", "\n; ", $d) . $this->_get_config_line($posted_value) . "\n";
}
- function get_instructions($title)
+ public function get_instructions($title)
{
$i = "<h3>" . $title . "</h3>\n " . nl2p($this->_get_description()) . "\n";
return "<tr>\n<td class=\"instructions\">\n" . $i . "</td>\n";
}
- function get_html()
+ public function get_html()
{
$size = strlen($this->default_value) > 45 ? 90 : 50;
return $this->get_config_item_header() .
@@ -1672,15 +1782,14 @@
}
}
-class unchangeable_variable
- extends _variable
+class unchangeable_variable extends _variable
{
- function _config_format($value)
+ public function _config_format($value)
{
return "";
}
- function get_html()
+ public function get_html()
{
return $this->get_config_item_header() .
"<em>Not editable.</em>" .
@@ -1687,15 +1796,16 @@
"<pre>" . $this->default_value . "</pre>";
}
- function _get_config_line($posted_value)
+ public function _get_config_line($posted_value)
{
$n = "";
- if ($this->description)
+ if ($this->description) {
$n = "\n";
+ }
return "$n" . $this->default_value;
}
- function get_instructions($title)
+ public function get_instructions($title)
{
$i = "<h3>" . $title . "</h3>\n " . nl2p($this->_get_description()) . "\n";
// $i .= "<em>Not editable.</em><br />\n<pre>" . $this->default_value."</pre>";
@@ -1704,29 +1814,29 @@
}
}
-class unchangeable_define
- extends unchangeable_variable
+class unchangeable_define extends unchangeable_variable
{
- function _get_config_line($posted_value)
+ public function _get_config_line($posted_value)
{
$n = "";
- if ($this->description)
+ if ($this->description) {
$n = "\n";
- if (!$posted_value)
+ }
+ if (!$posted_value) {
$posted_value = $this->default_value;
+ }
return "$n" . $this->_config_format($posted_value);
}
- function _config_format($value)
+ public function _config_format($value)
{
return sprintf("%s = \"%s\"", $this->get_config_item_name(), $value);
}
}
-class _variable_selection
- extends _variable
+class _variable_selection extends _variable
{
- function value()
+ public function value()
{
global $HTTP_POST_VARS;
if (!empty($HTTP_POST_VARS[$this->config_item_name])) {
@@ -1742,22 +1852,24 @@
}
}
- function get_html()
+ public function get_html()
{
$output = $this->get_config_item_header();
$output .= '<select name="' . $this->get_config_item_name() . "\">\n";
/* The first option is the default */
$values = $this->default_value;
- if (defined($this->get_config_item_name()))
+ if (defined($this->get_config_item_name())) {
$this->default_value = constant($this->get_config_item_name());
- else
+ } else {
$this->default_value = null;
+ }
foreach ($values as $option => $label) {
- if (!is_null($this->default_value) && $this->default_value === $option)
+ if (!is_null($this->default_value) && $this->default_value === $option) {
$output .= " <option value=\"$option\" selected=\"selected\">$label</option>\n";
- else
+ } else {
$output .= " <option value=\"$option\">$label</option>\n";
+ }
}
$output .= "</select>\n";
return $output;
@@ -1764,26 +1876,27 @@
}
}
-class _define
- extends _variable
+class _define extends _variable
{
- function _config_format($value)
+ public function _config_format($value)
{
return sprintf("%s = \"%s\"", $this->get_config_item_name(), $value);
}
- function _get_config_line($posted_value)
+ public function _get_config_line($posted_value)
{
$n = "";
- if ($this->description)
+ if ($this->description) {
$n = "\n";
- if ($posted_value == '')
+ }
+ if ($posted_value == '') {
return "$n;" . $this->_config_format("");
- else
+ } else {
return "$n" . $this->_config_format($posted_value);
+ }
}
- function get_html()
+ public function get_html()
{
$size = strlen($this->default_value) > 45 ? 90 : 50;
return $this->get_config_item_header()
@@ -1793,20 +1906,21 @@
}
}
-class _define_commented
- extends _define
+class _define_commented extends _define
{
- function _get_config_line($posted_value)
+ public function _get_config_line($posted_value)
{
$n = "";
- if ($this->description)
+ if ($this->description) {
$n = "\n";
- if ($posted_value == $this->default_value)
+ }
+ if ($posted_value == $this->default_value) {
return "$n;" . $this->_config_format($posted_value);
- elseif ($posted_value == '')
+ } elseif ($posted_value == '') {
return "$n;" . $this->_config_format("");
- else
+ } else {
return "$n" . $this->_config_format($posted_value);
+ }
}
}
@@ -1815,130 +1929,130 @@
* IniConfig.php does the optional logic now.
* But we use _optional for config-default.ini options
*/
-class _define_commented_optional
- extends _define_commented
+class _define_commented_optional extends _define_commented
{
}
-class _define_optional
- extends _define
+class _define_optional extends _define
{
}
-class _define_notempty
- extends _define
+class _define_notempty extends _define
{
- function get_html()
+ public function get_html()
{
$s = $this->get_config_item_header()
. "<input type=\"text\" size=\"50\" name=\"" . $this->get_config_item_name()
. '" value="' . $this->default_value . '" ' . $this->jscheck . " />";
- if (empty($this->default_value))
+ if (empty($this->default_value)) {
return $s . "<p id=\"" . $this->get_config_item_id() . "\" class=\"red\">Cannot be empty.</p>";
- else
+ } else {
return $s . "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>";
+ }
}
}
-class numeric_define
- extends _define
+class numeric_define extends _define
{
-
- function __construct($config_item_name, $default_value = '', $description = '', $jscheck = '')
+ public function __construct($config_item_name, $default_value = '', $description = '', $jscheck = '')
{
parent::__construct($config_item_name, $default_value, $description, $jscheck);
- if (!$jscheck)
+ if (!$jscheck) {
$this->jscheck = "onchange=\"validate_ereg('Sorry, \'%s\' is not an integer.', '^[-+]?[0-9]+$', '" . $this->get_config_item_name() . "', this);\"";
+ }
}
- function _config_format($value)
+ public function _config_format($value)
{
return sprintf("%s = %s", $this->get_config_item_name(), $value);
}
- function _get_config_line($posted_value)
+ public function _get_config_line($posted_value)
{
$n = "";
- if ($this->description)
+ if ($this->description) {
$n = "\n";
- if ($posted_value == '')
+ }
+ if ($posted_value == '') {
return "$n;" . $this->_config_format('0');
- else
+ } else {
return "$n" . $this->_config_format($posted_value);
+ }
}
}
-class numeric_define_optional
- extends numeric_define
+class numeric_define_optional extends numeric_define
{
}
-class numeric_define_commented
- extends numeric_define
+class numeric_define_commented extends numeric_define
{
- function _get_config_line($posted_value)
+ public function _get_config_line($posted_value)
{
$n = "";
- if ($this->description)
+ if ($this->description) {
$n = "\n";
- if ($posted_value == $this->default_value)
+ }
+ if ($posted_value == $this->default_value) {
return "$n;" . $this->_config_format($posted_value);
- elseif ($posted_value == '')
+ } elseif ($posted_value == '') {
return "$n;" . $this->_config_format('0');
- else
+ } else {
return "$n" . $this->_config_format($posted_value);
+ }
}
}
-class _define_selection
- extends _variable_selection
+class _define_selection extends _variable_selection
{
- function _config_format($value)
+ public function _config_format($value)
{
return sprintf("%s = %s", $this->get_config_item_name(), $value);
}
-
}
-class _define_selection_optional
- extends _define_selection
+class _define_selection_optional extends _define_selection
{
}
-class _define_selection_optional_commented
- extends _define_selection_optional
+class _define_selection_optional_commented extends _define_selection_optional
{
- function _get_config_line($posted_value)
+ public function _get_config_line($posted_value)
{
$n = "";
- if ($this->description)
+ if ($this->description) {
$n = "\n";
- if ($posted_value == $this->default_value)
+ }
+ if ($posted_value == $this->default_value) {
return "$n;" . $this->_config_format($posted_value);
- elseif ($posted_value == '')
+ } elseif ($posted_value == '') {
return "$n;" . $this->_config_format("");
- else
+ } else {
return "$n" . $this->_config_format($posted_value);
+ }
}
}
-class _define_password
- extends _define
+class _define_password extends _define
{
- function __construct($config_item_name, $default_value = '', $description = '', $jscheck = '')
+ public function __construct($config_item_name, $default_value = '', $description = '', $jscheck = '')
{
- if ($config_item_name == $default_value) $default_value = '';
+ if ($config_item_name == $default_value) {
+ $default_value = '';
+ }
parent::__construct($config_item_name, $default_value, $description, $jscheck);
- if (!$jscheck)
+ if (!$jscheck) {
$this->jscheck = "onchange=\"validate_ereg('Sorry, \'%s\' cannot be empty.', '^.+$', '"
. $this->get_config_item_name() . "', this);\"";
+ }
}
- function _get_config_line($posted_value)
+ public function _get_config_line($posted_value)
{
$n = "";
- if ($this->description)
+ if ($this->description) {
$n = "\n";
+ }
if ($posted_value == '') {
$p = "$n;" . $this->_config_format("");
$p .= "\n; If you used the passencrypt.php utility to encode the password";
@@ -1946,11 +2060,13 @@
$p .= "\n;ENCRYPTED_PASSWD = true";
return $p;
} else {
- $salt_length = max(CRYPT_SALT_LENGTH,
+ $salt_length = max(
+ CRYPT_SALT_LENGTH,
2 * CRYPT_STD_DES,
9 * CRYPT_EXT_DES,
12 * CRYPT_MD5,
- 16 * CRYPT_BLOWFISH);
+ 16 * CRYPT_BLOWFISH
+ );
// generate an encrypted password
$crypt_pass = crypt($posted_value, rand_ascii($salt_length));
$p = "$n" . $this->_config_format($crypt_pass);
@@ -1957,25 +2073,27 @@
return $p . "\nENCRYPTED_PASSWD = true";
}
}
-
}
-class _define_password_optional
- extends _define_password
+class _define_password_optional extends _define_password
{
-
- function __construct($config_item_name, $default_value = '', $description = '', $jscheck = '')
+ public function __construct($config_item_name, $default_value = '', $description = '', $jscheck = '')
{
- if ($config_item_name == $default_value) $default_value = '';
- if (!$jscheck) $this->jscheck = " ";
+ if ($config_item_name == $default_value) {
+ $default_value = '';
+ }
+ if (!$jscheck) {
+ $this->jscheck = " ";
+ }
parent::__construct($config_item_name, $default_value, $description, $jscheck);
}
- function _get_config_line($posted_value)
+ public function _get_config_line($posted_value)
{
$n = "";
- if ($this->description)
+ if ($this->description) {
$n = "\n";
+ }
if ($posted_value == '') {
return "$n;" . $this->_config_format("");
} else {
@@ -1983,7 +2101,7 @@
}
}
- function get_html()
+ public function get_html()
{
$s = $this->get_config_item_header();
// dont re-encrypt already encrypted passwords
@@ -1990,8 +2108,9 @@
$value = $this->value();
$encrypted = !empty($GLOBALS['properties']["Encrypted Passwords"]) and
$GLOBALS['properties']["Encrypted Passwords"]->value();
- if (empty($value))
+ if (empty($value)) {
$encrypted = false;
+ }
$s .= '<input type="' . ($encrypted ? "text" : "password") . '" name="' . $this->get_config_item_name()
. '" value="' . $value . '" ' . $this->jscheck . " />";
return $s;
@@ -1998,18 +2117,20 @@
}
}
-class _variable_password
- extends _variable
+class _variable_password extends _variable
{
- function __construct($config_item_name, $default_value = '', $description = '', $jscheck = '')
+ public function __construct($config_item_name, $default_value = '', $description = '', $jscheck = '')
{
- if ($config_item_name == $default_value) $default_value = '';
+ if ($config_item_name == $default_value) {
+ $default_value = '';
+ }
parent::__construct($config_item_name, $default_value, $description, $jscheck);
- if (!$jscheck)
+ if (!$jscheck) {
$this->jscheck = "onchange=\"validate_ereg('Sorry, \'%s\' cannot be empty.', '^.+$', '" . $this->get_config_item_name() . "', this);\"";
+ }
}
- function get_html()
+ public function get_html()
{
global $HTTP_POST_VARS, $HTTP_GET_VARS;
$s = $this->get_config_item_header();
@@ -2022,38 +2143,41 @@
$value = $this->value();
$encrypted = !empty($GLOBALS['properties']["Encrypted Passwords"]) and
$GLOBALS['properties']["Encrypted Passwords"]->value();
- if (empty($value))
+ if (empty($value)) {
$encrypted = false;
+ }
$s .= '<input type="' . ($encrypted ? "text" : "password") . '" name="' . $this->get_config_item_name()
. '" value="' . $value . '" ' . $this->jscheck . " />"
. " <input type=\"submit\" name=\"create\" value=\"Create Random Password\" />";
- if (empty($value))
+ if (empty($value)) {
$s .= "<p id=\"" . $this->get_config_item_id() . "\" class=\"red\">Cannot be empty.</p>";
- elseif (strlen($this->default_value) < 4)
+ } elseif (strlen($this->default_value) < 4) {
$s .= "<p id=\"" . $this->get_config_item_id() . "\" class=\"red\">Must be longer than 4 chars.</p>";
- else
+ } else {
$s .= "<p id=\"" . $this->get_config_item_id() . "\" class=\"green\">Input accepted.</p>";
+ }
return $s;
}
}
-class list_define
- extends _define
+class list_define extends _define
{
- function _get_config_line($posted_value)
+ public function _get_config_line($posted_value)
{
$list_values = preg_split("/[\s,]+/", $posted_value, -1, PREG_SPLIT_NO_EMPTY);
- if ($list_values)
+ if ($list_values) {
$list_values = join("|", $list_values);
+ }
return _variable::_get_config_line($list_values);
}
- function get_html()
+ public function get_html()
{
$list_values = explode("|", $this->default_value);
$rows = max(3, count($list_values) + 1);
- if ($list_values)
+ if ($list_values) {
$list_values = join("\n", $list_values);
+ }
$ta = $this->get_config_item_header();
$ta .= '<textarea cols="18" rows="' . $rows . '" name="';
$ta .= $this->get_config_item_name() . '" ' . $this->jscheck . '>';
@@ -2063,16 +2187,18 @@
}
}
-class array_variable
- extends _variable
+class array_variable extends _variable
{
- function _config_format($value)
+ public function _config_format($value)
{
- return sprintf("%s = \"%s\"", $this->get_config_item_name(),
- is_array($value) ? join(':', $value) : $value);
+ return sprintf(
+ "%s = \"%s\"",
+ $this->get_config_item_name(),
+ is_array($value) ? join(':', $value) : $value
+ );
}
- function _get_config_line($posted_value)
+ public function _get_config_line($posted_value)
{
// split the phrase by any number of commas or space characters,
// which include " ", \r, \t, \n and \f
@@ -2080,11 +2206,12 @@
if (!empty($list_values)) {
$list_values = "'" . join("', '", $list_values) . "'";
return "\n" . $this->_config_format($list_values);
- } else
+ } else {
return "\n;" . $this->_config_format('');
+ }
}
- function get_html()
+ public function get_html()
{
if (is_array($this->default_value)) {
$list_values = join("\n", $this->default_value);
@@ -2103,16 +2230,18 @@
}
}
-class array_define
- extends _define
+class array_define extends _define
{
- function _config_format($value)
+ public function _config_format($value)
{
- return sprintf("%s = \"%s\"", $this->get_config_item_name(),
- is_array($value) ? join(' : ', $value) : $value);
+ return sprintf(
+ "%s = \"%s\"",
+ $this->get_config_item_name(),
+ is_array($value) ? join(' : ', $value) : $value
+ );
}
- function _get_config_line($posted_value)
+ public function _get_config_line($posted_value)
{
// split the phrase by any number of commas or space characters,
// which include " ", \r, \t, \n and \f
@@ -2120,16 +2249,18 @@
if (!empty($list_values)) {
$list_values = join(" : ", $list_values);
return "\n" . $this->_config_format($list_values);
- } else
+ } else {
return "\n;" . $this->_config_format('');
+ }
}
- function get_html()
+ public function get_html()
{
- if (!$this->default_value)
+ if (!$this->default_value) {
$this->default_value = array();
- elseif (is_string($this->default_value))
+ } elseif (is_string($this->default_value)) {
$this->default_value = preg_split("/[\s,:]+/", $this->default_value, -1, PREG_SPLIT_NO_EMPTY);
+ }
$list_values = join(" : \n", $this->default_value);
$rows = max(3, count($this->default_value) + 1);
$ta = $this->get_config_item_header();
@@ -2141,11 +2272,10 @@
}
}
-class boolean_define
- extends _define
+class boolean_define extends _define
{
// adds ->values property, instead of ->default_value
- function __construct($config_item_name, $values = false, $description = '', $jscheck = '')
+ public function __construct($config_item_name, $values = false, $description = '', $jscheck = '')
{
$this->config_item_name = $config_item_name;
if (!$description) {
@@ -2166,24 +2296,29 @@
$this->prefix = "";
}
- function _get_config_line($posted_value)
+ public function _get_config_line($posted_value)
{
$n = "";
- if ($this->description)
+ if ($this->description) {
$n = "\n";
+ }
return "$n" . $this->_config_format($posted_value);
}
- function _config_format($value)
+ public function _config_format($value)
{
- if (strtolower(trim($value)) == 'false')
+ if (strtolower(trim($value)) == 'false') {
$value = false;
- return sprintf("%s = %s", $this->get_config_item_name(),
- $value ? 'true' : 'false');
+ }
+ return sprintf(
+ "%s = %s",
+ $this->get_config_item_name(),
+ $value ? 'true' : 'false'
+ );
}
//TODO: radiobuttons, no list
- function get_html()
+ public function get_html()
{
$output = $this->get_config_item_header();
$name = $this->get_config_item_name();
@@ -2193,10 +2328,11 @@
/* There can usually only be two options, there can be
* three options in the case of a boolean_define_commented_optional */
foreach ($values as $option => $label) {
- if (!is_null($this->default_value) and $option === $default_value)
+ if (!is_null($this->default_value) and $option === $default_value) {
$output .= " <option value=\"$option\" selected=\"selected\">$label</option>\n";
- else
+ } else {
$output .= " <option value=\"$option\">$label</option>\n";
+ }
}
$output .= "</select>\n";
return $output;
@@ -2203,19 +2339,18 @@
}
}
-class boolean_define_optional
- extends boolean_define
+class boolean_define_optional extends boolean_define
{
}
-class boolean_define_commented
- extends boolean_define
+class boolean_define_commented extends boolean_define
{
- function _get_config_line($posted_value)
+ public function _get_config_line($posted_value)
{
$n = "";
- if ($this->description)
+ if ($this->description) {
$n = "\n";
+ }
if (is_array($this->default_value)) {
$default_value = key($this->default_value);
next($this->default_value);
@@ -2222,29 +2357,28 @@
} else {
$default_value = $this->default_value;
}
- if ($posted_value == $default_value)
+ if ($posted_value == $default_value) {
return "$n;" . $this->_config_format($posted_value);
- elseif ($posted_value == '')
+ } elseif ($posted_value == '') {
return "$n;" . $this->_config_format('false');
- else
+ } else {
return "$n" . $this->_config_format($posted_value);
+ }
}
}
-class boolean_define_commented_optional
- extends boolean_define_commented
+class boolean_define_commented_optional extends boolean_define_commented
{
}
-class part
- extends _variable
+class part extends _variable
{
- function value()
+ public function value()
{
return "";
}
- function get_config($posted_value)
+ public function get_config($posted_value)
{
$d = stripHtml($this->_get_description());
global $SEPARATOR;
@@ -2251,7 +2385,7 @@
return "\n" . $SEPARATOR . str_replace("\n", "\n; ", $d) . "\n" . $this->default_value;
}
- function get_instructions($title)
+ public function get_instructions($title)
{
$id = preg_replace("/\W/", "", $this->config_item_name);
$i = '<tr class="header" id="'.$id.'">'."\n";
@@ -2261,7 +2395,7 @@
return $i . "</td>\n";
}
- function get_html()
+ public function get_html()
{
return "";
}
@@ -2270,15 +2404,20 @@
// HTML utility functions
function nl2p($text)
{
- preg_match_all("@\s*(<pre>.*?</pre>|<dl>.*?</dl>|.*?(?=\n\n|<pre>|<dl>|$))@s",
- $text, $m);
+ preg_match_all(
+ "@\s*(<pre>.*?</pre>|<dl>.*?</dl>|.*?(?=\n\n|<pre>|<dl>|$))@s",
+ $text,
+ $m
+ );
$text = '';
foreach ($m[1] as $par) {
- if (!($par = trim($par)))
+ if (!($par = trim($par))) {
continue;
- if (!preg_match('/^<(pre|dl)>/', $par))
+ }
+ if (!preg_match('/^<(pre|dl)>/', $par)) {
$par = "<p>$par</p>";
+ }
$text .= $par;
}
return $text;
@@ -2307,10 +2446,12 @@
} elseif (preg_match("/^;\s*$/", $s)) {
$par .= "\n\n";
}
- if (preg_match("/^;?" . preg_quote($var) . "\s*=/", $s))
+ if (preg_match("/^;?" . preg_quote($var) . "\s*=/", $s)) {
return $par;
- if (preg_match("/^\s*$/", $s)) // new paragraph
+ }
+ if (preg_match("/^\s*$/", $s)) { // new paragraph
$par = "\n";
+ }
}
return '';
}
@@ -2351,7 +2492,9 @@
$length = mt_rand($minlength, $maxlength);
while ($length > 0) {
$newchar = mt_rand($start, $end);
- if (!strrpos($valid_chars, $newchar)) continue; // skip holes
+ if (!strrpos($valid_chars, $newchar)) {
+ continue;
+ } // skip holes
$newpass .= sprintf("%c", $newchar);
$length--;
}
@@ -2367,7 +2510,6 @@
and !empty($HTTP_POST_VARS['ADMIN_USER'])
and !empty($HTTP_POST_VARS['ADMIN_PASSWD'])
) {
-
$timestamp = date('dS \of F, Y H:i:s');
$config = "; This is a local configuration file for PhpWiki.\n"
@@ -2420,13 +2562,13 @@
echo "<hr />\n";
echo "<p>To make any corrections, <a href=\"configurator.php\">edit the settings again</a>.</p>\n";
-
} else { // first time or create password
$posted = $GLOBALS['HTTP_POST_VARS'];
// No action has been specified - we make a form.
- if (!empty($GLOBALS['HTTP_GET_VARS']['start_debug']))
+ if (!empty($GLOBALS['HTTP_GET_VARS']['start_debug'])) {
$configurator .= ("?start_debug=" . $GLOBALS['HTTP_GET_VARS']['start_debug']);
+ }
echo '
<form action="', $configurator, '" method="post">
<input type="hidden" name="action" value="make_config" />
Modified: trunk/getimg.php
===================================================================
--- trunk/getimg.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/getimg.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -1,3 +1,4 @@
<?php
+
include 'index.php';
include 'lib/imagecache.php';
Modified: trunk/index.php
===================================================================
--- trunk/index.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/index.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -31,7 +31,7 @@
*
*/
-require_once (dirname(__FILE__) . '/lib/prepend.php');
+require_once(dirname(__FILE__) . '/lib/prepend.php');
require_once(dirname(__FILE__) . '/lib/IniConfig.php');
IniConfig(dirname(__FILE__) . "/config/config.ini");
@@ -56,5 +56,6 @@
// If every page is just empty, comment the if (@is_dir line out,
// to force include "lib/main.php".
// Without the dir check it might fail for index.php via DirectoryIndex
-if (@is_dir(SCRIPT_FILENAME) or realpath(SCRIPT_FILENAME) == realpath(__FILE__))
+if (@is_dir(SCRIPT_FILENAME) or realpath(SCRIPT_FILENAME) == realpath(__FILE__)) {
include(dirname(__FILE__) . "/lib/main.php");
+}
Modified: trunk/passencrypt.php
===================================================================
--- trunk/passencrypt.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/passencrypt.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -54,8 +54,9 @@
$length = mt_rand($minlength, $maxlength);
while ($length > 0) {
$newchar = mt_rand($start, $end);
- if (!strrpos($valid_chars, $newchar))
- continue; // skip holes
+ if (!strrpos($valid_chars, $newchar)) {
+ continue;
+ } // skip holes
$newpass .= sprintf("%c", $newchar);
$length--;
}
@@ -68,8 +69,9 @@
* for easier coding.
*/
foreach (array('SERVER', 'GET', 'POST', 'ENV') as $k) {
- if (!isset($GLOBALS['HTTP_' . $k . '_VARS']) and isset($GLOBALS['_' . $k]))
+ if (!isset($GLOBALS['HTTP_' . $k . '_VARS']) and isset($GLOBALS['_' . $k])) {
$GLOBALS['HTTP_' . $k . '_VARS'] =& $GLOBALS['_' . $k];
+ }
}
unset($k);
@@ -90,16 +92,19 @@
* https://www.php.net/manual/en/function.crypt.php
*/
// Use the maximum salt length the system can handle.
- $salt_length = max(CRYPT_SALT_LENGTH,
+ $salt_length = max(
+ CRYPT_SALT_LENGTH,
2 * CRYPT_STD_DES,
9 * CRYPT_EXT_DES,
12 * CRYPT_MD5,
- 16 * CRYPT_BLOWFISH);
+ 16 * CRYPT_BLOWFISH
+ );
// Generate the encrypted password.
$encrypted_password = crypt($password, rand_ascii($salt_length));
$debug = $HTTP_GET_VARS['debug'];
- if ($debug)
+ if ($debug) {
echo "The password was encrypted using a salt length of: $salt_length<br />\n";
+ }
echo "<p>The encrypted password is:<br />\n<br /> \n<samp><strong>",
htmlentities($encrypted_password), "</strong></samp></p>\n";
echo "<hr />\n";
@@ -106,10 +111,12 @@
} elseif ($posted['password'] != "") {
echo "The passwords did not match. Please try again.<br />\n";
}
-if (empty($REQUEST_URI))
+if (empty($REQUEST_URI)) {
$REQUEST_URI = $HTTP_ENV_VARS['REQUEST_URI'];
-if (empty($REQUEST_URI))
+}
+if (empty($REQUEST_URI)) {
$REQUEST_URI = $_SERVER['REQUEST_URI'];
+}
?>
<form action="<?php echo $REQUEST_URI ?>" method="post">
Modified: trunk/themes/Crao/themeinfo.php
===================================================================
--- trunk/themes/Crao/themeinfo.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/themes/Crao/themeinfo.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -38,8 +38,7 @@
class WikiTheme_Crao extends WikiTheme
{
-
- function load()
+ public function load()
{
// CSS file defines fonts, colors and background images for this
// style. The companion '*-heavy.css' file isn't defined, it's just
@@ -97,7 +96,6 @@
//$this->setDateFormat("%x"); // must not contain time
$this->setTimeFormat("%H:%M:%S");
//$this->setTimeFormat("%X");
-
}
}
Modified: trunk/themes/Hawaiian/lib/random.php
===================================================================
--- trunk/themes/Hawaiian/lib/random.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/themes/Hawaiian/lib/random.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -30,9 +30,8 @@
* $imgSet = new randomImage($WikiTheme->file("images/pictures"));
* $imgFile = "pictures/" . $imgSet->filename;
*/
- function __construct($dirname)
+ public function __construct($dirname)
{
-
$this->filename = ""; // Pick up your filename here.
$_imageSet = new ImageSet($dirname);
@@ -40,14 +39,16 @@
unset($_imageSet);
if (empty($this->imageList)) {
- trigger_error(sprintf(_("%s is empty."), $dirname),
- E_USER_NOTICE);
+ trigger_error(
+ sprintf(_("%s is empty."), $dirname),
+ E_USER_NOTICE
+ );
} else {
$dummy = $this->pickRandom();
}
}
- function pickRandom()
+ public function pickRandom()
{
$this->filename = $this->imageList[array_rand($this->imageList)];
return $this->filename;
Modified: trunk/themes/Hawaiian/themeinfo.php
===================================================================
--- trunk/themes/Hawaiian/themeinfo.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/themes/Hawaiian/themeinfo.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -38,18 +38,22 @@
class WikiTheme_Hawaiian extends WikiTheme
{
- function getCSS()
+ public function getCSS()
{
// FIXME: this is a hack which will not be needed once
// we have dynamic CSS.
$css = WikiTheme::getCSS();
- $css->pushContent(HTML::style(array('type' => 'text/css'),
- new RawXml(sprintf("<!--\nbody {background-image: url(%s);}\n-->",
- $this->getImageURL('uhhbackground.jpg')))));
+ $css->pushContent(HTML::style(
+ array('type' => 'text/css'),
+ new RawXml(sprintf(
+ "<!--\nbody {background-image: url(%s);}\n-->",
+ $this->getImageURL('uhhbackground.jpg')
+ ))
+ ));
return $css;
}
- function load()
+ public function load()
{
// CSS file defines fonts, colors and background images for this
// style. The companion '*-heavy.css' file isn't defined, it's just
@@ -111,7 +115,6 @@
* user's time zone.
*/
//$this->setDateFormat("%d %B %Y"); // must not contain time
-
}
}
Modified: trunk/themes/MacOSX/buttons/index.php
===================================================================
--- trunk/themes/MacOSX/buttons/index.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/themes/MacOSX/buttons/index.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -1,2 +1,3 @@
<?php
+
include '../images/index.php';
Modified: trunk/themes/MacOSX/lib/RecentChanges.php
===================================================================
--- trunk/themes/MacOSX/lib/RecentChanges.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/themes/MacOSX/lib/RecentChanges.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -34,14 +34,18 @@
{
$class = 'rc-' . $fmt->importance($rev);
- return HTML::li(array('class' => $class),
- $fmt->diffLink($rev), ' ',
- $fmt->pageLink($rev), ' ',
+ return HTML::li(
+ array('class' => $class),
+ $fmt->diffLink($rev),
+ ' ',
+ $fmt->pageLink($rev),
+ ' ',
$rev->get('is_minor_edit') ? $fmt->time($rev) : HTML::strong($fmt->time($rev)),
' . . . ',
$fmt->summaryAsHTML($rev),
' -- ',
- $fmt->authorLink($rev));
+ $fmt->authorLink($rev)
+ );
}
function MacOSX_PH_revision_formatter(&$fmt, &$rev)
@@ -48,30 +52,32 @@
{
$class = 'rc-' . $fmt->importance($rev);
- return HTML::li(array('class' => $class),
- $fmt->diffLink($rev), ' ',
- $fmt->pageLink($rev), ' ',
+ return HTML::li(
+ array('class' => $class),
+ $fmt->diffLink($rev),
+ ' ',
+ $fmt->pageLink($rev),
+ ' ',
$rev->get('is_minor_edit') ? $fmt->time($rev) : HTML::strong($fmt->time($rev)),
' . . . ',
$fmt->summaryAsHTML($rev),
' -- ',
$fmt->authorLink($rev),
- $rev->get('is_minor_edit') ? HTML::em(" (" . _("minor edit") . ")") : '');
+ $rev->get('is_minor_edit') ? HTML::em(" (" . _("minor edit") . ")") : ''
+ );
}
-class _MacOSX_RecentChanges_Formatter
- extends _RecentChanges_HtmlFormatter
+class _MacOSX_RecentChanges_Formatter extends _RecentChanges_HtmlFormatter
{
- function format_revision($rev)
+ public function format_revision($rev)
{
return MacOSX_RC_revision_formatter($this, $rev);
}
}
-class _MacOSX_PageHistory_Formatter
- extends _PageHistory_HtmlFormatter
+class _MacOSX_PageHistory_Formatter extends _PageHistory_HtmlFormatter
{
- function format_revision($rev)
+ public function format_revision($rev)
{
return MacOSX_PH_revision_formatter($this, $rev);
}
Modified: trunk/themes/MacOSX/themeinfo.php
===================================================================
--- trunk/themes/MacOSX/themeinfo.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/themes/MacOSX/themeinfo.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -57,23 +57,25 @@
class WikiTheme_MacOSX extends WikiTheme
{
- function getRecentChangesFormatter($format)
+ public function getRecentChangesFormatter($format)
{
include_once($this->file('lib/RecentChanges.php'));
- if (preg_match('/^rss|^sidebar/', $format))
- return false; // use default
+ if (preg_match('/^rss|^sidebar/', $format)) {
+ return false;
+ } // use default
return '_MacOSX_RecentChanges_Formatter';
}
- function getPageHistoryFormatter($format)
+ public function getPageHistoryFormatter($format)
{
include_once($this->file('lib/RecentChanges.php'));
- if (preg_match('/^rss|^sidebar/', $format))
- return false; // use default
+ if (preg_match('/^rss|^sidebar/', $format)) {
+ return false;
+ } // use default
return '_MacOSX_PageHistory_Formatter';
}
- function linkUnknownWikiWord($wikiword, $linktext = '')
+ public function linkUnknownWikiWord($wikiword, $linktext = '')
{
// Get rid of anchors on unknown wikiwords
if (is_a($wikiword, 'WikiPageName')) {
@@ -101,7 +103,7 @@
return $link;
}
- function load()
+ public function load()
{
// CSS file defines fonts, colors and background images for this
// style. The companion '*-heavy.css' file isn't defined, it's just
Modified: trunk/themes/MonoBook/themeinfo.php
===================================================================
--- trunk/themes/MonoBook/themeinfo.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/themes/MonoBook/themeinfo.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -41,8 +41,12 @@
class WikiTheme_MonoBook extends WikiTheme_Wikilens
{
/* this adds selected to the class */
- function makeActionButton($action, $label = '',
- $page_or_rev = false, $options = array())
+ public function makeActionButton(
+ $action,
+ $label = '',
+ $page_or_rev = false,
+ $options = array()
+ )
{
extract($this->_get_name_and_rev($page_or_rev));
@@ -49,31 +53,37 @@
if (is_array($action)) {
$attr = $action;
$action = isset($attr['action']) ? $attr['action'] : 'browse';
- } else
+ } else {
$attr['action'] = $action;
+ }
$class = is_safe_action($action) ? /*'named-wiki'*/
'new' : 'wikiadmin';
/* if selected action is current then prepend selected */
global $request;
- if ($request->getArg("action") == $action)
+ if ($request->getArg("action") == $action) {
$class = "selected $class";
+ }
//$class = "selected";
- if (!empty($options['class']))
+ if (!empty($options['class'])) {
$class = $options['class'];
- if (!$label)
+ }
+ if (!$label) {
$label = $this->_labelForAction($action);
+ }
- if ($version)
+ if ($version) {
$attr['version'] = $version;
+ }
- if ($action == 'browse')
+ if ($action == 'browse') {
unset($attr['action']);
+ }
return $this->makeButton($label, WikiURL($pagename, $attr), $class, $options);
}
- function load()
+ public function load()
{
$this->addMoreHeaders(JavaScript("var ta;\nvar skin = '" . $this->_name . "';\n"));
$this->addMoreHeaders(JavaScript('', array('src' => $this->_findData("wikibits.js"))));
@@ -85,9 +95,11 @@
// This should result in phpwiki-printer.css being used when
// printing or print-previewing with style "PhpWiki" or "MacOSX" selected.
- $this->setDefaultCSS('PhpWiki',
+ $this->setDefaultCSS(
+ 'PhpWiki',
array('' => 'monobook.css',
- 'print' => 'commonPrint.css'));
+ 'print' => 'commonPrint.css')
+ );
// This allows one to manually select "Printer" style (when browsing page)
// to see what the printer style looks like.
Modified: trunk/themes/Portland/lib/RecentChanges.php
===================================================================
--- trunk/themes/Portland/lib/RecentChanges.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/themes/Portland/lib/RecentChanges.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -40,51 +40,62 @@
$minor_flag = '';
}
- return HTML::li(array('class' => $class),
- $fmt->diffLink($rev), ' ',
- $fmt->pageLink($rev), ' ',
- $time, ' ',
- $minor_flag, ' ',
- " . . . ", $fmt->summaryAsHTML($rev), ' ',
+ return HTML::li(
+ array('class' => $class),
+ $fmt->diffLink($rev),
+ ' ',
+ $fmt->pageLink($rev),
+ ' ',
+ $time,
+ ' ',
+ $minor_flag,
+ ' ',
" . . . ",
+ $fmt->summaryAsHTML($rev),
+ ' ',
+ " . . . ",
$fmt->authorLink($rev)
);
}
-class _Portland_RecentChanges_Formatter
- extends _RecentChanges_HtmlFormatter
+class _Portland_RecentChanges_Formatter extends _RecentChanges_HtmlFormatter
{
- function format_revision($rev)
+ public function format_revision($rev)
{
return Portland_RC_revision_formatter($this, $rev);
}
- function summaryAsHTML($rev)
+ public function summaryAsHTML($rev)
{
- if (!($summary = $this->summary($rev)))
+ if (!($summary = $this->summary($rev))) {
return '';
- return HTML::strong(array('class' => 'wiki-summary'),
+ }
+ return HTML::strong(
+ array('class' => 'wiki-summary'),
"(",
TransformLinks($summary, $rev->getPageName()),
- ")");
+ ")"
+ );
}
}
-class _Portland_PageHistory_Formatter
- extends _PageHistory_HtmlFormatter
+class _Portland_PageHistory_Formatter extends _PageHistory_HtmlFormatter
{
- function format_revision($rev)
+ public function format_revision($rev)
{
return Portland_RC_revision_formatter($this, $rev);
}
- function summaryAsHTML($rev)
+ public function summaryAsHTML($rev)
{
- if (!($summary = $this->summary($rev)))
+ if (!($summary = $this->summary($rev))) {
return '';
- return HTML::strong(array('class' => 'wiki-summary'),
+ }
+ return HTML::strong(
+ array('class' => 'wiki-summary'),
"(",
TransformLinks($summary, $rev->getPageName()),
- ")");
+ ")"
+ );
}
}
Modified: trunk/themes/Portland/themeinfo.php
===================================================================
--- trunk/themes/Portland/themeinfo.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/themes/Portland/themeinfo.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -39,8 +39,7 @@
class WikiTheme_Portland extends WikiTheme
{
-
- function linkUnknownWikiWord($wikiword, $linktext = '')
+ public function linkUnknownWikiWord($wikiword, $linktext = '')
{
if (is_a($wikiword, 'WikiPageName')) {
$default_text = $wikiword->shortName;
@@ -63,23 +62,25 @@
return $link;
}
- function getRecentChangesFormatter($format)
+ public function getRecentChangesFormatter($format)
{
include_once($this->file('lib/RecentChanges.php'));
- if (preg_match('/^rss|^sidebar/', $format))
- return false; // use default
+ if (preg_match('/^rss|^sidebar/', $format)) {
+ return false;
+ } // use default
return '_Portland_RecentChanges_Formatter';
}
- function getPageHistoryFormatter($format)
+ public function getPageHistoryFormatter($format)
{
include_once($this->file('lib/RecentChanges.php'));
- if (preg_match('/^rss|^sidebar/', $format))
- return false; // use default
+ if (preg_match('/^rss|^sidebar/', $format)) {
+ return false;
+ } // use default
return '_Portland_PageHistory_Formatter';
}
- function load()
+ public function load()
{
// CSS file defines fonts, colors and background images for this
// style. The companion '*-heavy.css' file isn't defined, it's just
@@ -125,7 +126,6 @@
* user's time zone.
*/
$this->setDateFormat("%d %B %Y", false);
-
}
}
Modified: trunk/themes/Sidebar/hyperapplet.php
===================================================================
--- trunk/themes/Sidebar/hyperapplet.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/themes/Sidebar/hyperapplet.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -35,9 +35,9 @@
<applet code="hypergraph.applications.hexplorer.HExplorerApplet.class" align="baseline"
archive="<?php echo $WikiTheme->_findData("hyperapplet.jar") ?>"
width="160" height="360">
- <?php // the dynamic version: ?>
+ <?php // the dynamic version:?>
<!--param name="file" value="<?php echo WikiURL("LinkDatabase", array('format' => 'xml')) ?>" /-->
- <?php // The faster static version: dump it periodically ?>
+ <?php // The faster static version: dump it periodically?>
<param name="file" value="<?php echo $WikiTheme->_findData("LinkDatabase.xml") ?>"/>
<!--param name="properties" value="<?php echo $WikiTheme->_findData("hwiki.prop") ?>" /-->
<param name="center" value="<?php echo $page->getName() ?>"/>
Modified: trunk/themes/Sidebar/themeinfo.php
===================================================================
--- trunk/themes/Sidebar/themeinfo.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/themes/Sidebar/themeinfo.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -45,10 +45,12 @@
* CbUpload - uploads are virus checked
*/
-if (!defined("CLAMDSCAN_PATH"))
+if (!defined("CLAMDSCAN_PATH")) {
define("CLAMDSCAN_PATH", "/usr/local/bin/clamdscan");
-if (!defined("CLAMDSCAN_VIRUS"))
+}
+if (!defined("CLAMDSCAN_VIRUS")) {
define("CLAMDSCAN_VIRUS", "/var/www/virus-found");
+}
require_once 'lib/WikiTheme.php';
require_once 'lib/WikiPlugin.php';
@@ -56,8 +58,7 @@
class WikiTheme_Sidebar extends WikiTheme_MonoBook
{
-
- function __construct($theme_name = 'Sidebar')
+ public function __construct($theme_name = 'Sidebar')
{
parent::__construct($theme_name);
}
@@ -64,16 +65,17 @@
/* Display up/down button with persistent state */
/* persistent state per block in cookie for 30 days */
- function folderArrow($id, $init = 'Open')
+ public function folderArrow($id, $init = 'Open')
{
global $request;
if ($cookie = $request->cookies->get("folder_" . $id)) {
$init = $cookie;
}
- if ($init == 'Open' or $init == 'Closed')
+ if ($init == 'Open' or $init == 'Closed') {
$png = $this->_findData('images/folderArrow' . $init . '.png');
- else
+ } else {
$png = $this->_findData('images/folderArrowOpen.png');
+ }
return HTML::img(array('id' => $id . '-img',
'src' => $png,
//'align' => 'right',
@@ -83,7 +85,7 @@
}
/* Callback when a new user creates or edits a page */
- function CbNewUserEdit(&$request, $userid)
+ public function CbNewUserEdit(&$request, $userid)
{
$content = "{{Template/UserPage}}";
$dbi =& $request->_dbi;
@@ -103,7 +105,7 @@
* if (!$WikiTheme->CbUpload($request, $file_dir . $userfile_name))
* unlink($file_dir . $userfile_name);
*/
- function CbUpload(&$request, $pathname)
+ public function CbUpload(&$request, $pathname)
{
$cmdline = CLAMDSCAN_PATH . " --nosummary --move=" . CLAMDSCAN_VIRUS;
$report = `$cmdline "$pathname"`;
@@ -120,7 +122,7 @@
}
}
- function findTemplate($name)
+ public function findTemplate($name)
{
// hack for navbar.tmpl to hide the button separator
if ($name == "navbar") {
@@ -132,9 +134,8 @@
return parent::findTemplate($name);
}
- function load()
+ public function load()
{
-
$this->initGlobals();
// CSS file defines fonts, colors and background images for this
@@ -218,7 +219,6 @@
* See themes/wikilens/themeinfo.php
*/
//$this->addPageListColumn();
-
}
}
Modified: trunk/themes/SpaceWiki/lib/RecentChanges.php
===================================================================
--- trunk/themes/SpaceWiki/lib/RecentChanges.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/themes/SpaceWiki/lib/RecentChanges.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -33,15 +33,20 @@
{
$class = 'rc-' . $fmt->importance($rev);
- return HTML::li(array('class' => $class),
- $fmt->diffLink($rev), ' ',
- $fmt->pageLink($rev), ' ',
+ return HTML::li(
+ array('class' => $class),
+ $fmt->diffLink($rev),
+ ' ',
+ $fmt->pageLink($rev),
+ ' ',
' . ',
- $rev->get('is_minor_edit') ? $fmt->time($rev) : HTML::strong($fmt->time($rev)), ' ',
+ $rev->get('is_minor_edit') ? $fmt->time($rev) : HTML::strong($fmt->time($rev)),
+ ' ',
' . . . ',
$fmt->summaryAsHTML($rev),
' . . . ',
- $fmt->authorLink($rev));
+ $fmt->authorLink($rev)
+ );
}
function SpaceWiki_PH_revision_formatter(&$fmt, &$rev)
@@ -48,58 +53,66 @@
{
$class = 'rc-' . $fmt->importance($rev);
- return HTML::li(array('class' => $class),
- $fmt->diffLink($rev), ' ',
- $fmt->pageLink($rev), ' ',
- $rev->get('is_minor_edit') ? $fmt->time($rev) : HTML::strong($fmt->time($rev)), ' ',
+ return HTML::li(
+ array('class' => $class),
+ $fmt->diffLink($rev),
+ ' ',
+ $fmt->pageLink($rev),
+ ' ',
+ $rev->get('is_minor_edit') ? $fmt->time($rev) : HTML::strong($fmt->time($rev)),
+ ' ',
' . . . ',
$fmt->summaryAsHTML($rev),
' . . . ',
$fmt->authorLink($rev),
- ($fmt->importance($rev) == 'minor') ? HTML::small(" (" . _("minor edit") . ")") : '');
+ ($fmt->importance($rev) == 'minor') ? HTML::small(" (" . _("minor edit") . ")") : ''
+ );
}
-class _SpaceWiki_RecentChanges_Formatter
- extends _RecentChanges_HtmlFormatter
+class _SpaceWiki_RecentChanges_Formatter extends _RecentChanges_HtmlFormatter
{
- function format_revision($rev)
+ public function format_revision($rev)
{
return SpaceWiki_RC_revision_formatter($this, $rev);
}
- function summaryAsHTML($rev)
+ public function summaryAsHTML($rev)
{
- if (!($summary = $this->summary($rev)))
+ if (!($summary = $this->summary($rev))) {
return '';
- return HTML::strong(array('class' => 'wiki-summary'),
+ }
+ return HTML::strong(
+ array('class' => 'wiki-summary'),
" ",
TransformLinks($summary, $rev->getPageName()),
- " ");
+ " "
+ );
}
- function diffLink($rev)
+ public function diffLink($rev)
{
global $WikiTheme;
return $WikiTheme->makeButton(_("diff"), $this->diffURL($rev), 'wiki-rc-action');
}
-
}
-class _SpaceWiki_PageHistory_Formatter
- extends _PageHistory_HtmlFormatter
+class _SpaceWiki_PageHistory_Formatter extends _PageHistory_HtmlFormatter
{
- function format_revision($rev)
+ public function format_revision($rev)
{
return SpaceWiki_PH_revision_formatter($this, $rev);
}
- function summaryAsHTML($rev)
+ public function summaryAsHTML($rev)
{
- if (!($summary = $this->summary($rev)))
+ if (!($summary = $this->summary($rev))) {
return '';
- return HTML::strong(array('class' => 'wiki-summary'),
+ }
+ return HTML::strong(
+ array('class' => 'wiki-summary'),
" ",
TransformLinks($summary, $rev->getPageName()),
- " ");
+ " "
+ );
}
}
Modified: trunk/themes/SpaceWiki/themeinfo.php
===================================================================
--- trunk/themes/SpaceWiki/themeinfo.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/themes/SpaceWiki/themeinfo.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -45,24 +45,25 @@
class WikiTheme_SpaceWiki extends WikiTheme
{
-
- function getRecentChangesFormatter($format)
+ public function getRecentChangesFormatter($format)
{
include_once($this->file('lib/RecentChanges.php'));
- if (preg_match('/^rss|^sidebar/', $format))
- return false; // use default
+ if (preg_match('/^rss|^sidebar/', $format)) {
+ return false;
+ } // use default
return '_SpaceWiki_RecentChanges_Formatter';
}
- function getPageHistoryFormatter($format)
+ public function getPageHistoryFormatter($format)
{
include_once($this->file('lib/RecentChanges.php'));
- if (preg_match('/^rss|^sidebar/', $format))
- return false; // use default
+ if (preg_match('/^rss|^sidebar/', $format)) {
+ return false;
+ } // use default
return '_SpaceWiki_PageHistory_Formatter';
}
- function load()
+ public function load()
{
// CSS file defines fonts, colors and background images for this
// style. The companion '*-heavy.css' file isn't defined, it's just
@@ -107,7 +108,6 @@
*/
$this->setTimeFormat("%H%M%S");
$this->setDateFormat("%Y%m%d"); // must not contain time
-
}
}
Modified: trunk/themes/Wordpress/lib/RecentChanges.php
===================================================================
--- trunk/themes/Wordpress/lib/RecentChanges.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/themes/Wordpress/lib/RecentChanges.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -40,51 +40,62 @@
$minor_flag = '';
}
- return HTML::li(array('class' => $class),
- $fmt->diffLink($rev), ' ',
- $fmt->pageLink($rev), ' ',
- $time, ' ',
- $minor_flag, ' ',
- " . . . ", $fmt->summaryAsHTML($rev), ' ',
+ return HTML::li(
+ array('class' => $class),
+ $fmt->diffLink($rev),
+ ' ',
+ $fmt->pageLink($rev),
+ ' ',
+ $time,
+ ' ',
+ $minor_flag,
+ ' ',
" . . . ",
+ $fmt->summaryAsHTML($rev),
+ ' ',
+ " . . . ",
$fmt->authorLink($rev)
);
}
-class _Wordpress_RecentChanges_Formatter
- extends _RecentChanges_HtmlFormatter
+class _Wordpress_RecentChanges_Formatter extends _RecentChanges_HtmlFormatter
{
- function format_revision($rev)
+ public function format_revision($rev)
{
return Wordpress_RC_revision_formatter($this, $rev);
}
- function summaryAsHTML($rev)
+ public function summaryAsHTML($rev)
{
- if (!($summary = $this->summary($rev)))
+ if (!($summary = $this->summary($rev))) {
return '';
- return HTML::strong(array('class' => 'wiki-summary'),
+ }
+ return HTML::strong(
+ array('class' => 'wiki-summary'),
"(",
TransformLinks($summary, $rev->getPageName()),
- ")");
+ ")"
+ );
}
}
-class _Wordpress_PageHistory_Formatter
- extends _PageHistory_HtmlFormatter
+class _Wordpress_PageHistory_Formatter extends _PageHistory_HtmlFormatter
{
- function format_revision($rev)
+ public function format_revision($rev)
{
return Wordpress_RC_revision_formatter($this, $rev);
}
- function summaryAsHTML($rev)
+ public function summaryAsHTML($rev)
{
- if (!($summary = $this->summary($rev)))
+ if (!($summary = $this->summary($rev))) {
return '';
- return HTML::strong(array('class' => 'wiki-summary'),
+ }
+ return HTML::strong(
+ array('class' => 'wiki-summary'),
"(",
TransformLinks($summary, $rev->getPageName()),
- ")");
+ ")"
+ );
}
}
Modified: trunk/themes/Wordpress/themeinfo.php
===================================================================
--- trunk/themes/Wordpress/themeinfo.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/themes/Wordpress/themeinfo.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -39,8 +39,7 @@
class WikiTheme_Wordpress extends WikiTheme
{
-
- function linkUnknownWikiWord($wikiword, $linktext = '')
+ public function linkUnknownWikiWord($wikiword, $linktext = '')
{
if (is_a($wikiword, 'WikiPageName')) {
$default_text = $wikiword->shortName;
@@ -63,23 +62,25 @@
return $link;
}
- function getRecentChangesFormatter($format)
+ public function getRecentChangesFormatter($format)
{
include_once($this->file('lib/RecentChanges.php'));
- if (preg_match('/^rss|^sidebar/', $format))
- return false; // use default
+ if (preg_match('/^rss|^sidebar/', $format)) {
+ return false;
+ } // use default
return '_Wordpress_RecentChanges_Formatter';
}
- function getPageHistoryFormatter($format)
+ public function getPageHistoryFormatter($format)
{
include_once($this->file('lib/RecentChanges.php'));
- if (preg_match('/^rss|^sidebar/', $format))
- return false; // use default
+ if (preg_match('/^rss|^sidebar/', $format)) {
+ return false;
+ } // use default
return '_Wordpress_PageHistory_Formatter';
}
- function load()
+ public function load()
{
// CSS file defines fonts, colors and background images for this
// style. The companion '*-heavy.css' file isn't defined, it's just
Modified: trunk/themes/alphatest.php
===================================================================
--- trunk/themes/alphatest.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/themes/alphatest.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -37,7 +37,7 @@
$pngs = false;
if ($dh = opendir($current_dir)) {
while (($file = readdir($dh)) !== false) {
- if ($file !== '.' AND $file !== '..') {
+ if ($file !== '.' and $file !== '..') {
$current_file = "{$current_dir}/{$file}";
if (is_file($current_file)) {
if (!(strcmp(substr($file, -4), ".png"))) {
Modified: trunk/themes/blog/jscalendar/calendar.php
===================================================================
--- trunk/themes/blog/jscalendar/calendar.php 2022-03-24 13:49:51 UTC (rev 11014)
+++ trunk/themes/blog/jscalendar/calendar.php 2022-03-24 13:58:54 UTC (rev 11015)
@@ -12,19 +12,23 @@
define('NEWLINE', "\n");
-class DHTML_Calendar {
- var $calendar_lib_path;
+class DHTML_Calendar
+{
+ public $calendar_lib_path;
- var $calendar_file;
- var $calendar_lang_file;
- var $calendar_setup_file;
- var $calendar_theme_file;
- var $calendar_options;
+ public $calendar_file;
+ public $calendar_lang_file;
+ public $calendar_setup_file;
+ public $calendar_theme_file;
+ public $calendar_options;
- function __construct($calendar_lib_path = '/calendar/',
- $lang = 'en',
- $theme = 'calendar-win2k-1',
- $stripped = true) {
+ public function __construct(
+ $calendar_lib_path = '/calendar/',
+ $lang = 'en',
+ $theme = 'calendar-win2k-1',
+ $stripped = true
+ )
+ {
if ($stripped) {
$this->calendar_file = 'calendar_stripped.js';
$this->calendar_setup_file = 'calendar-setup_stripped.js';
@@ -39,74 +43,98 @@
'daFormat' => '%Y/%m/%d');
}
- function set_option($name, $value) {
+ public function set_option($name, $value)
+ {
$this->calendar_options[$name] = $value;
}
- function load_files() {
+ public function load_files()
+ {
echo $this->get_load_files_code();
}
- function get_load_files_code() {
- $code = ( '<link rel="stylesheet" type="text/css" media="all" href="' .
+ public function get_load_files_code()
+ {
+ $code = ('<link rel="stylesheet" type="text/css" media="all" href="' .
$this->calendar_lib_path . $this->calendar_theme_file .
- '" />' . NEWLINE );
- $code .= ( '<script type="text/javascript" src="' .
+ '" />' . NEWLINE);
+ $code .= ('<script type="text/javascript" src="' .
$this->calendar_lib_path . $this->calendar_file .
- '"></script>' . NEWLINE );
- $code .= ( '<script type="text/javascript" src="' .
+ '"></script>' . NEWLINE);
+ $code .= ('<script type="text/javascript" src="' .
$this->calendar_lib_path . $this->calendar_lang_file .
- '"></script>' . NEWLINE );
- $code .= ( '<script type="text/javascript" src="' .
+ '"></script>' . NEWLINE);
+ $code .= ('<script type="text/javascript" src="' .
$this->calendar_lib_path . $this->calendar_setup_file .
- '"></script>' );
+ '"></script>');
return $code;
}
- function _make_calendar($other_options = array()) {
+ public function _make_calendar($other_options = array())
+ {
$js_options = $this->_make_js_hash(array_merge($this->calendar_options, $other_options));
- $code = ( '<script type="text/javascript">Calendar.setup({' .
+ $code = ('<script type="text/javascript">Calendar.setup({' .
$js_options .
- '});</script>' );
+ '});</script>');
return $code;
}
- function make_input_field($cal_options = array(), $field_attributes = array()) {
+ public function make_input_field($cal_options = array(), $field_attributes = array())
+ {
$id = $this->_gen_id();
- $attrstr = $this->_make_html_attr(array_merge($field_attributes,
- array('id' => $this->_field_id($id),
- 'type' => 'text')));
+ $attrstr = $this->_make_html_attr(array_merge(
+ $field_attributes,
+ array('id' => $this->_field_id($id),
+ 'type' => 'text')
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
_______________________________________________
phpwiki-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/phpwiki-checkins