Skip to content
Commits on Source (184)
Drupal x.x.x, xxxx-xx-xx
Drupal 4.4.2, 2004-07-04
------------------------
- fixed bugs: no critical bugs were identified.
Drupal 4.4.1, 2004-05-01
------------------------
- fixed bugs: no critical bugs were identified.
Drupal 4.4.0, 2004-04-01
------------------------
- added support for the MetaWeblog API and MovableType extensions.
......@@ -20,7 +32,9 @@ Drupal x.x.x, xxxx-xx-xx
* made all theme functions return their output.
* migrated away from using the BaseTheme class.
* added many new theme functions and refactored existing theme functions.
* replaced theme "UnConeD" by "Chameleon".
* added avatar support to 'Xtemplate'.
* replaced theme 'UnConeD' by 'Chameleon'.
* replaced theme 'Marvin' by 'Pushbutton'.
- usability:
* added breadcrumb navigation to all pages.
* made it possible to add context-sensitive help to all pages.
......@@ -34,6 +48,8 @@ Drupal x.x.x, xxxx-xx-xx
- refactored 404 (file not found) handling to support custom 404 pages.
- documentation:
* added PHPDoc/Doxygen comments.
- improved the filter system to prevent conflicts between filters:
* made it possible to change the order in which filters are applied.
Drupal 4.3.2, 2004-01-01
------------------------
......
......@@ -32,10 +32,6 @@ LOCALE MODULE
M: Gabor Hojtsy <goba@php.net>
S: maintained
MSSQL PORT
M: Moshe Weitzman <weitzman@tejasa.com>
S: maintained
POSTGRES PORT
M: Adrian Rossouw <adrian@obsidian.co.za>
S: maintained
......@@ -49,8 +45,8 @@ M: Moshe Weitzman <weitzman@tejasa.com>
S: maintained
DEBIAN PACKAGE
M: Hugo Espuny <hec@debian.org>
S: orphan
M: Hilko Bengen <bengen@debian.org>
S: maintained
THE REST:
M: Dries <dries@drupal.org>
---
--- Table definitions
---
CREATE TABLE [dbo].[access] (
[aid] [smallint] NULL ,
[mask] [varchar] (255) NOT NULL ,
[type] [varchar] (255) NOT NULL ,
[status] [smallint] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[accesslog] (
[nid] [numeric](11, 0) NULL ,
[url] [varchar] (255) NULL ,
[hostname] [varchar] (128) NULL ,
[uid] [numeric](10, 0) NULL ,
[timestamp] [numeric](11, 0) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[authmap] (
[aid] [numeric](10, 0) IDENTITY NULL ,
[uid] [int] NOT NULL ,
[authname] [varchar] (128) NOT NULL ,
[module] [varchar] (128) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[blocks] (
[module] [varchar] (64) NOT NULL ,
[delta] [varchar] (32) NOT NULL ,
[status] [smallint] NOT NULL ,
[weight] [smallint] NOT NULL ,
[region] [smallint] NOT NULL ,
[path] [varchar] (255) NOT NULL ,
[custom] [smallint] NOT NULL,
[throttle] [smallint] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[book] (
[nid] [numeric](4, 0) NOT NULL ,
[parent] [int] NOT NULL ,
[weight] [smallint] NOT NULL ,
[format] [smallint] NULL ,
[log] [text] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[boxes] (
[bid] [smallint] NULL ,
[title] [varchar] (64) NOT NULL ,
[body] [text] NULL ,
[info] [varchar] (128) NOT NULL ,
[type] [smallint] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[bundle] (
[bid] [int] NULL ,
[title] [varchar] (255) NOT NULL ,
[attributes] [varchar] (255) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[cache] (
[cid] [varchar] (255) NOT NULL ,
[data] [text] NULL ,
[expire] [int] NOT NULL ,
[created] [int] NOT NULL ,
[headers] [text] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[comments] (
[cid] [int] NULL ,
[pid] [int] NOT NULL ,
[nid] [int] NOT NULL ,
[uid] [int] NOT NULL ,
[subject] [varchar] (64) NOT NULL ,
[comment] [varchar] (8000) NOT NULL ,
[hostname] [varchar] (128) NOT NULL ,
[timestamp] [int] NOT NULL ,
[link] [varchar] (16) NULL ,
[score] [int] NOT NULL ,
[status] [tinyint] NOT NULL ,
[thread] [varchar] (255) NOT NULL ,
[users] [varchar] (8000) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[directory] (
[link] [varchar] (255) NOT NULL ,
[name] [varchar] (128) NOT NULL ,
[mail] [varchar] (128) NOT NULL ,
[slogan] [text] NOT NULL ,
[mission] [text] NOT NULL ,
[timestamp] [int] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[feed] (
[fid] [int] NULL ,
[title] [varchar] (255) NOT NULL ,
[url] [varchar] (255) NOT NULL ,
[refresh] [int] NOT NULL ,
[checked] [int] MOT NULL ,
[attributes] [varchar] (255) NULL ,
[link] [varchar] (255) NULL ,
[description] [varchar] (8000) NULL ,
[image] [varchar] (512) NULL ,
[etag] [varchar] (255) NULL ,
[modified] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[forum] (
[nid] [numeric](10, 0) NOT NULL ,
[tid] [numeric](10, 0) NOT NULL ,
[icon] [varchar] (255) NULL ,
[shadow] [numeric](10, 0) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[history] (
[uid] [int] NOT NULL ,
[nid] [int] NOT NULL ,
[timestamp] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[item] (
[iid] [int] NULL ,
[fid] [int] NOT NULL ,
[title] [varchar] (255) NOT NULL ,
[link] [varchar] (255) NOT NULL ,
[author] [varchar] (255) NOT NULL ,
[description] [text] NOT NULL ,
[timestamp] [int] NULL ,
[attributes] [varchar] (255) NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[locales] (
[lid] [int] NULL ,
[location] [varchar] (128) NOT NULL ,
[string] [nvarchar] (4000) NOT NULL ,
[da] [text] NULL ,
[fi] [text] NULL ,
[fr] [text] NULL ,
[en] [text] NULL ,
[es] [text] NULL ,
[nl] [text] NULL ,
[no] [text] NULL ,
[sw] [text] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[menu] (
[name] [varchar] (255) NOT NULL ,
[link] [varchar] (255) NOT NULL ,
[help] [text] NULL ,
[title] [varchar] (255) NOT NULL ,
[parent] [varchar] (255) NOT NULL ,
[weight] [smallint] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[moderation_filters] (
[fid] [numeric](10, 0) NULL ,
[filter] [varchar] (255) NOT NULL ,
[minimum] [smallint] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[moderation_roles] (
[rid] [numeric](4, 0) NOT NULL ,
[mid] [numeric](4, 0) NOT NULL ,
[value] [smallint] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[moderation_votes] (
[mid] [numeric](10, 0) NULL ,
[vote] [varchar] (255) NULL ,
[weight] [smallint] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[node] (
[nid] [numeric](10, 0) NULL ,
[type] [varchar] (16) NOT NULL ,
[title] [varchar] (128) NOT NULL ,
[path] [varchar] (250) NULL ,
[score] [int] NOT NULL ,
[votes] [int] NOT NULL ,
[uid] [int] NOT NULL ,
[status] [int] NOT NULL ,
[created] [int] NOT NULL ,
[comment] [int] NOT NULL ,
[promote] [int] NOT NULL ,
[moderate] [int] NOT NULL ,
[users] [text] NULL ,
[attributes] [varchar] (255) NULL ,
[teaser] [text] NOT NULL ,
[body] [text] NOT NULL ,
[changed] [int] NOT NULL ,
[revisions] [text] NULL ,
[static] [int] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[page] (
[nid] [numeric](10, 0) NOT NULL ,
[link] [varchar] (128) NOT NULL ,
[format] [smallint] NOT NULL ,
[description] [varchar] (128) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[url_alias] (
[pid] numeric (10, 0) NOT NULL,
[dst] [varchar] (128) NOT NULL,
[src] [varchar] (128) NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[url_alias] WITH NOCHECK ADD
CONSTRAINT [DF_[url_alias_pid] DEFAULT (0) FOR [pid],
CONSTRAINT [DF_url_alias_dst] DEFAULT ('') FOR [dst],
CONSTRAINT [DF_url_alias_src] DEFAULT ('') FOR [src]
GO
CREATE INDEX [url_alias_src_idx] ON [dbo].[url_alias]([src]) ON [PRIMARY]
CREATE INDEX url_alias_dst_idx ON url_alias(dst);
GO
CREATE TABLE [dbo].[permission] (
[rid] [numeric](4, 0) NOT NULL ,
[perm] [text] NULL ,
[tid] [numeric](4, 0) NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[poll] (
[nid] [numeric](4, 0) NOT NULL ,
[runtime] [int] NOT NULL ,
[voters] [text] NOT NULL ,
[active] [numeric](4, 0) NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[poll_choices] (
[chid] [numeric](10, 0) NULL ,
[nid] [numeric](10, 0) NOT NULL ,
[chtext] [varchar] (128) NOT NULL ,
[chvotes] [int] NOT NULL ,
[chorder] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[role] (
[rid] [numeric](10, 0) IDENTITY (1, 1) NOT NULL ,
[name] [varchar] (32) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[search_index] (
[word] [varchar] (50) NOT NULL ,
[lno] [numeric](10, 0) NOT NULL ,
[type] [varchar] (16) NULL ,
[count] [numeric](10, 0) NULL
) ON [PRIMARY]
GO
CREATE TABLE sessions (
[sid] [varchar] (32) NOT NULL,
[uid] [int] NOT NULL,
[hostname] [varchar] (128) NOT NULL,
[timestamp] [integer] NOT NULL,
[session] [text],
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[sequences] (
[name] [varchar] (255) NOT NULL ,
[id] [numeric](10, 0) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[node_counter] (
[nid] [int] NOT NULL ,
[totalcount] [numeric](20, 0) NOT NULL ,
[daycount] [numeric](4, 0) NOT NULL ,
[timestamp] [numeric](4, 0) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[system] (
[filename] [varchar] (255) NOT NULL ,
[name] [varchar] (255) NOT NULL ,
[type] [varchar] (255) NOT NULL ,
[description] [varchar] (255) NOT NULL ,
[status] [int] NOT NULL ,
[throttle] [smallint] NOT NULL ,
[bootstrap] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[term_data] (
[tid] [numeric](10, 0) NOT NULL ,
[vid] [numeric](10, 0) NOT NULL ,
[name] [varchar] (255) NOT NULL ,
[description] [text] NULL ,
[weight] [smallint] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[term_hierarchy] (
[tid] [numeric](4, 0) NOT NULL ,
[parent] [numeric](4, 0) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[term_node] (
[nid] [numeric](4, 0) NOT NULL ,
[tid] [numeric](4, 0) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[term_relation] (
[tid1] [numeric](4, 0) NOT NULL ,
[tid2] [numeric](4, 0) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[term_synonym] (
[tid] [numeric](10, 0) NOT NULL ,
[name] [varchar] (255) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[users] (
[uid] [numeric](10, 0) NULL ,
[name] [varchar] (60) NOT NULL ,
[pass] [varchar] (32) NOT NULL ,
[mail] [varchar] (64) NULL ,
[mode] [smallint] NOT NULL ,
[sort] [smallint] NULL ,
[threshold] [smallint] NULL ,
[theme] [varchar] (255) NULL ,
[signature] [varchar] (255) NULL ,
[timestamp] [float] NOT NULL ,
[status] [smallint] NOT NULL ,
[timezone] [varchar] (8) NULL ,
[language] [char] (2) NULL ,
[init] [varchar] (128) NULL ,
[data] [varchar] (8000) NULL ,
[rid] [int] NOT NULL
)
--ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[users_uid_seq] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[vapor] [int] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[variable] (
[name] [varchar] (48) NOT NULL ,
[value] [varchar] (8000) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[vocabulary] (
[vid] [numeric](10, 0) NULL ,
[name] [varchar] (255) NOT NULL ,
[description] [text] NULL ,
[relations] [tinyint] NOT NULL ,
[hierarchy] [tinyint] NOT NULL ,
[multiple] [tinyint] NOT NULL ,
[required] [tinyint] NOT NULL ,
[nodes] [text] NULL ,
[weight] [smallint] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[watchdog] (
[wid] [int] IDENTITY (1, 1) NOT NULL ,
[uid] [int] NOT NULL ,
[type] [varchar] (16) NOT NULL ,
[message] [text] NOT NULL ,
[link] [varchar] (255) NOT NULL ,
[location] [varchar] (128) NOT NULL ,
[hostname] [varchar] (128) NOT NULL ,
[timestamp] [int] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[role] WITH NOCHECK ADD
CONSTRAINT [PK_role] PRIMARY KEY CLUSTERED
(
[rid]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[watchdog] WITH NOCHECK ADD
PRIMARY KEY CLUSTERED
(
[wid]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[cache] WITH NOCHECK ADD
CONSTRAINT [DF_cache_created] DEFAULT (0) FOR [created]
GO
CREATE INDEX [forum_tid_idx] ON [dbo].[forum]([tid]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[node] WITH NOCHECK ADD
CONSTRAINT [DF_node_score] DEFAULT (0) FOR [score],
CONSTRAINT [DF_node_votes] DEFAULT (0) FOR [votes],
CONSTRAINT [DF_node_uid] DEFAULT (0) FOR [uid],
CONSTRAINT [DF_node_status] DEFAULT (1) FOR [status],
CONSTRAINT [DF_node_created] DEFAULT (0) FOR [created],
CONSTRAINT [DF_node_comment] DEFAULT (2) FOR [comment],
CONSTRAINT [DF_node_promote] DEFAULT (0) FOR [promote],
CONSTRAINT [DF_node_moderate] DEFAULT (0) FOR [moderate],
CONSTRAINT [DF_node_changed] DEFAULT (0) FOR [changed],
CONSTRAINT [DF_node_static] DEFAULT (0) FOR [static]
GO
CREATE INDEX [IX_role] ON [dbo].[role]([rid]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[term_data] WITH NOCHECK ADD
CONSTRAINT [DF_term_data_vid] DEFAULT (0) FOR [vid]
GO
ALTER TABLE [dbo].[users] WITH NOCHECK ADD
CONSTRAINT [DF_users_mode] DEFAULT (0) FOR [mode],
CONSTRAINT [DF_users_sort] DEFAULT (0) FOR [sort],
CONSTRAINT [DF_users_threshold] DEFAULT (0) FOR [threshold],
CONSTRAINT [DF_users_status] DEFAULT (0) FOR [status],
CONSTRAINT [DF_users_timestamp] DEFAULT (0) FOR [timestamp],
CONSTRAINT [DF_users_rid] DEFAULT (0) FOR [rid],
CONSTRAINT [DF_users_pass] DEFAULT ('') FOR [pass],
CONSTRAINT [DF_users_homepage] DEFAULT ('') FOR [homepage],
CONSTRAINT [DF_users_theme] DEFAULT ('') FOR [theme],
CONSTRAINT [DF_users_signature] DEFAULT ('') FOR [signature],
CONSTRAINT [DF_users_language] DEFAULT ('') FOR [language]
GO
CREATE INDEX [IX_sid] ON [dbo].[sessions]([sid]) ON [PRIMARY]
GO
CREATE INDEX [IX_users] ON [dbo].[users]([uid]) ON [PRIMARY]
GO
CREATE INDEX [IX_timestamp] ON [dbo].[users]([timestamp]) ON [PRIMARY]
GO
CREATE INDEX [sessions_sid_idx] ON [dbo].[sessions]([sid]) ON [PRIMARY]
GO
CREATE INDEX [users_timestamp_idx] ON [dbo].[users]([timestamp]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[watchdog] WITH NOCHECK ADD
CONSTRAINT [DF__watchdog__uid__41EDCAC5] DEFAULT ('0') FOR [uid],
CONSTRAINT [DF__watchdog__type__42E1EEFE] DEFAULT ('') FOR [type],
CONSTRAINT [DF__watchdog__messag__43D61337] DEFAULT ('') FOR [message],
CONSTRAINT [DF__watchdog__link__44CA3770] DEFAULT ('') FOR [link],
CONSTRAINT [DF__watchdog__locati__45BE5BA9] DEFAULT ('') FOR [location],
CONSTRAINT [DF__watchdog__hostna__46B27FE2] DEFAULT ('') FOR [hostname],
CONSTRAINT [DF__watchdog__timest__47A6A41B] DEFAULT ('0') FOR [timestamp]
GO
--
-- Insert some default values
--
INSERT INTO system VALUES ('modules/admin.module','admin','module','',1,0,0);
INSERT INTO system VALUES ('modules/block.module','block','module','',1,0,0);
INSERT INTO system VALUES ('modules/comment.module','comment','module','',1,0,0);
INSERT INTO system VALUES ('modules/help.module','help','module','',1,0,0);
INSERT INTO system VALUES ('modules/node.module','node','module','',1,0,0);
INSERT INTO system VALUES ('modules/page.module','page','module','',1,0,0);
INSERT INTO system VALUES ('modules/story.module','story','module','',1,0,0);
INSERT INTO system VALUES ('modules/taxonomy.module','taxonomy','module','',1,0,0);
INSERT INTO system VALUES ('themes/xtemplate/xtemplate.theme','xtemplate','theme','Internet explorer, Netscape, Opera',1,0,0);
INSERT INTO variable(name,value) VALUES('update_start', 's:10:"2003-10-27";');
INSERT INTO variable(name,value) VALUES('theme_default','s:9:"xtemplate";');
INSERT INTO users(uid,name,mail,rid) VALUES(0,'','','1');
INSERT INTO blocks(module,delta,status,custom,region,weight,path) VALUES('user', 0, 1, 0, 1, 0, '');
INSERT INTO blocks(module,delta,status,custom,region,weight,path) VALUES('user', 1, 1, 0, 1, 0, '');
---
--- Functions. Functions first available in SQL Server 2000. GREATEST() used by forum.module, tracker.module at the moment.
---
GO
CREATE FUNCTION GREATEST (@a int, @b int)
RETURNS int AS
BEGIN
IF (@a > @b)
BEGIN
RETURN @a;
END
RETURN @b;
END
......@@ -68,7 +68,6 @@ CREATE TABLE book (
format tinyint(2) default '0',
log longtext,
PRIMARY KEY (nid),
KEY nid (nid),
KEY parent (parent)
) TYPE=MyISAM;
......@@ -125,7 +124,6 @@ CREATE TABLE comments (
comment longtext NOT NULL,
hostname varchar(128) NOT NULL default '',
timestamp int(11) NOT NULL default '0',
link varchar(16) NOT NULL default '',
score mediumint(9) NOT NULL default '0',
status tinyint(3) unsigned NOT NULL default '0',
thread varchar(255) NOT NULL,
......@@ -186,9 +184,9 @@ CREATE TABLE filters (
CREATE TABLE forum (
nid int(10) unsigned NOT NULL default '0',
tid int(10) unsigned NOT NULL default '0',
icon varchar(255) NOT NULL default '',
shadow int(10) unsigned NOT NULL default '0',
PRIMARY KEY (nid)
PRIMARY KEY (nid),
KEY tid (tid)
) TYPE=MyISAM;
--
......@@ -288,7 +286,6 @@ CREATE TABLE node (
promote int(2) NOT NULL default '0',
moderate int(2) NOT NULL default '0',
users longtext NOT NULL,
attributes varchar(255) NOT NULL default '',
teaser longtext NOT NULL,
body longtext NOT NULL,
changed int(11) NOT NULL default '0',
......@@ -312,8 +309,7 @@ CREATE TABLE page (
link varchar(128) NOT NULL default '',
format tinyint(2) NOT NULL default '0',
description varchar(128) NOT NULL default '',
PRIMARY KEY (nid),
KEY nid (nid)
PRIMARY KEY (nid)
) TYPE=MyISAM;
--
......@@ -594,7 +590,7 @@ INSERT INTO permission VALUES (1,'access content',0);
INSERT INTO role (rid, name) VALUES (2, 'authenticated user');
INSERT INTO permission VALUES (2,'access comments, access content, post comments, post comments without approval',0);
REPLACE variable SET name='update_start', value='s:10:"2003-10-27;"';
REPLACE variable SET name='update_start', value='s:10:"2004-02-21;"';
REPLACE variable SET name='theme_default', value='s:9:"xtemplate";';
REPLACE blocks SET module = 'user', delta = '0', status = '1';
......
......@@ -123,7 +123,6 @@ CREATE TABLE comments (
comment text NOT NULL default '',
hostname varchar(128) NOT NULL default '',
timestamp integer NOT NULL default '0',
link varchar(16) NOT NULL default '',
score integer NOT NULL default '0',
status smallint NOT NULL default '0',
thread varchar(255) default '',
......@@ -167,6 +166,16 @@ CREATE TABLE feed (
UNIQUE (url)
);
--
-- Table structure for table 'filters'
--
CREATE TABLE filters (
module varchar(64) NOT NULL default '',
weight smallint DEFAULT '0' NOT NULL,
PRIMARY KEY (weight)
);
--
-- Table structure for table 'forum'
--
......@@ -174,7 +183,6 @@ CREATE TABLE feed (
CREATE TABLE forum (
nid integer NOT NULL default '0',
tid integer NOT NULL default '0',
icon varchar(255) NOT NULL default '',
shadow integer NOT NULL default '0',
PRIMARY KEY (nid)
);
......@@ -277,7 +285,6 @@ CREATE TABLE node (
promote integer NOT NULL default '0',
moderate integer NOT NULL default '0',
users text NOT NULL default '',
attributes varchar(255) NOT NULL default '',
teaser text NOT NULL default '',
body text NOT NULL default '',
changed integer NOT NULL default '0',
......@@ -575,7 +582,7 @@ INSERT INTO system VALUES ('modules/story.module','story','module','',1,0,0);
INSERT INTO system VALUES ('modules/taxonomy.module','taxonomy','module','',1,0,0);
INSERT INTO system VALUES ('themes/xtemplate/xtemplate.theme','xtemplate','theme','Internet explorer, Netscape, Opera',1,0,0);
INSERT INTO variable(name,value) VALUES('update_start', 's:10:"2003-10-27";');
INSERT INTO variable(name,value) VALUES('update_start', 's:10:"2004-02-21";');
INSERT INTO variable(name,value) VALUES('theme_default','s:9:"xtemplate";');
INSERT INTO users(uid,name,mail,rid) VALUES(0,'','', '1');
......
This diff is collapsed.
......@@ -137,7 +137,18 @@ function drupal_page_header() {
// Send appropriate response:
header("Last-Modified: $date");
header("ETag: $etag");
header($cache->headers);
/*
** Send the original request's headers. We send them one after
** another so PHP's header() function can deal with duplicate
** headers.
*/
$headers = explode("\n", $cache->headers);
foreach ($headers as $header) {
header($header);
}
print $cache->data;
/*
......
......@@ -118,10 +118,10 @@ function drupal_get_html_head() {
/* @} */
/**
* @name URL path
* @name URL path alias
* @ingroup common
*
* Function to handle path aliases.
* Functions to handle path aliases.
*/
function drupal_get_path_map($action = "") {
static $map = NULL;
......@@ -144,15 +144,34 @@ function drupal_get_path_map($action = "") {
function drupal_rebuild_path_map() {
drupal_get_path_map("rebuild");
}
/* @} */
/**
* @name HTTP handling
* @ingroup common
*
* Functions to properly handle HTTP responses.
* @{
* Given an old url, return the alias.
*/
function drupal_get_path_alias($path) {
if (($map = drupal_get_path_map()) && ($newpath = array_search($path, $map))) {
return $newpath;
}
elseif (function_exists("conf_url_rewrite")) {
return conf_url_rewrite($path, 'outgoing');
}
}
/**
* Given an alias, return the default url.
*/
function drupal_get_normal_path($path) {
if (($map = drupal_get_path_map()) && isset($map[$path])) {
return $map[$path];
}
elseif (function_exists("conf_url_rewrite")) {
return conf_url_rewrite($path, 'incoming');
}
else {
return $path;
}
}
/* @} */
/**
* @name HTTP headers
......@@ -176,21 +195,31 @@ function drupal_get_headers() {
}
/* @} */
/**
* @name HTTP handling
* @ingroup common
*
* Functions to properly handle HTTP responses.
* @{
*/
/**
* HTTP redirects. Makes sure the redirected url is formatted correctly and
* includes the session ID.
*
* @note This function ends the request.
*
* @param $url A string containing a fully qualified URI.
* @param $url A Drupal URL
* @param $query Query string component
* @param $fragment Fragment identifier
*/
function drupal_goto($url) {
function drupal_goto($url = NULL, $query = NULL, $fragment = NULL) {
/*
** Translate &amp; to simply &
** Translate &amp; to simply & in the absolute URL
*/
$url = str_replace("&amp;", "&", $url);
$url = str_replace("&amp;", "&", url($url, $query, $fragment, TRUE));
/*
** It is advised to use "drupal_goto()" instead of PHP's "header()" as
......@@ -237,7 +266,7 @@ function drupal_not_found() {
menu_execute_active_handler();
}
else {
print theme("page", '<h1>'. t('Page not found') .'</h1>');
print theme('page', '', t('Page not found'));
}
}
......@@ -304,27 +333,25 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
fwrite($fp, $request);
// Fetch response.
while (!feof($fp) && $data = fgets($fp)) {
$response[] = $data;
$response = '';
while (!feof($fp) && $data = fread($fp, 1024)) {
$response .= $data;
}
fclose($fp);
// Parse response.
list($protocol, $code, $text) = explode(' ', trim(array_shift($response)), 3);
list($headers, $result->data) = explode("\r\n\r\n", $response, 2);
$headers = preg_split("/\r\n|\n|\r/", $headers);
list($protocol, $code, $text) = explode(' ', trim(array_shift($headers)), 3);
$result->headers = array();
$result->data = '';
// Parse headers.
while ($line = trim(array_shift($response))) {
if ($line == '') {
break;
}
while ($line = trim(array_shift($headers))) {
list($header, $value) = explode(':', $line, 2);
$result->headers[$header] = trim($value);
}
$result->data = implode('', $response);
$responses = array(
100 => 'Continue', 101 => 'Switching Protocols',
200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content',
......@@ -375,15 +402,6 @@ function error_handler($errno, $message, $filename, $line, $variables) {
}
}
function throttle($type, $rate) {
if (!user_access("access administration pages")) {
if ($throttle = db_fetch_object(db_query("SELECT * FROM {watchdog} WHERE type = '%s' AND hostname = '%s' AND %d - timestamp < %d", $type, $_SERVER['REMOTE_ADDR'], time(), $rate))) {
watchdog("warning", "throttle: '". $_SERVER['REMOTE_ADDR'] ."' exceeded submission rate - $throttle->type");
die(message_throttle());
}
}
}
function _fix_gpc_magic(&$item, $key) {
if (is_array($item)) {
array_walk($item, '_fix_gpc_magic');
......@@ -453,9 +471,6 @@ function message_na() {
return t("n/a");
}
function message_throttle() {
return t("You exceeded the maximum submission rate. Please wait a few minutes and try again.");
}
/* @} */
function locale_init() {
......@@ -520,6 +535,7 @@ function drupal_specialchars($input, $quotes = ENT_NOQUOTES) {
* @ingroup common
*
* Functions to validate user input.
* @{
*/
/**
......@@ -531,7 +547,7 @@ function drupal_specialchars($input, $quotes = ENT_NOQUOTES) {
*/
function valid_email_address($mail) {
$user = '[a-zA-Z0-9_\-\.\+\^!#\$%&*+\/\=\?\`\|\{\}~\']+';
$domain = '(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]\.?)+';
$domain = '(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.?)+';
$ipv4 = '[0-9]{1,3}(\.[0-9]{1,3}){3}';
$ipv6 = '[0-9a-fA-F]{1,4}(\:[0-9a-fA-F]{1,4}){7}';
......@@ -703,6 +719,14 @@ function check_file($filename) {
return is_uploaded_file($filename);
}
/**
* @name Formatting
* @ingroup common
*
* Functions to format numbers, strings, dates, etc.
* @{
*/
function format_rss_channel($title, $link, $description, $items, $language = "en", $args = array()) {
// arbitrary elements may be added using the $args associative array
......@@ -747,11 +771,18 @@ function format_rss_item($title, $link, $description, $args = array()) {
* @param $plural The string for the plural case. Please make sure it's clear
* this is plural, to ease translation. Use %count in places of the item
* count, as in "%count new comments".
* @return Translated string
*/
function format_plural($count, $singular, $plural) {
return t($count == 1 ? $singular : $plural, array("%count" => $count));
}
/**
* Generates a string representation for the given byte count.
*
* @param $size The size in bytes
* @return Translated string representation of the size
*/
function format_size($size) {
$suffix = t("bytes");
if ($size > 1024) {
......@@ -765,6 +796,13 @@ function format_size($size) {
return t("%size %suffix", array("%size" => $size, "%suffix" => $suffix));
}
/**
* Formats a time interval with the requested granularity.
*
* @param $timestamp The length of the interval in seconds
* @param $granularity How much units to consider when generating the string
* @return Translated string representation of the interval
*/
function format_interval($timestamp, $granularity = 2) {
$units = array("1 year|%count years" => 31536000, "1 week|%count weeks" => 604800, "1 day|%count days" => 86400, "1 hour|%count hours" => 3600, "1 min|%count min" => 60, "1 sec|%count sec" => 1);
foreach ($units as $key => $value) {
......@@ -782,40 +820,78 @@ function format_interval($timestamp, $granularity = 2) {
return ($output) ? $output : t("0 sec");
}
function format_date($timestamp, $type = "medium", $format = "") {
global $user;
/**
* Formats a date with the given configured format or a custom format string.
* Drupal allows administrators to select formatting strings for 'small',
* 'medium' and 'large' date formats. This function can handle these formats,
* as well as any custom format.
*
* @param $timestamp The exact date to format
* @param $type Could be 'small', 'medium' or 'large' for the preconfigured
* date formats. If 'custom' is specified, the next parameter
* should contain the format string
* @param $format Format string (as required by the PHP date() function).
* Only required if 'custom' date format is requested.
* @param $timezone Timezone offset in seconds in case the user timezone
* should not be used.
* @return Translated date string in the requested format
*/
function format_date($timestamp, $type = 'medium', $format = '', $timezone = NULL) {
if ($timezone === NULL) {
global $user;
$timezone = $user->uid ? $user->timezone : variable_get('date_default_timezone', 0);
}
$timestamp += ($user->timezone) ? $user->timezone - date("Z") : 0;
$timestamp += $timezone;
switch ($type) {
case "small":
$format = variable_get("date_format_short", "m/d/Y - H:i");
case 'small':
$format = variable_get('date_format_short', 'm/d/Y - H:i');
break;
case "large":
$format = variable_get("date_format_long", "l, F j, Y - H:i");
case 'large':
$format = variable_get('date_format_long', 'l, F j, Y - H:i');
break;
case "custom":
case 'custom':
// No change to format
break;
case "medium":
case 'medium':
default:
$format = variable_get("date_format_medium", "D, m/d/Y - H:i");
$format = variable_get('date_format_medium', 'D, m/d/Y - H:i');
}
for ($i = strlen($format); $i >= 0; $c = $format[--$i]) {
if (strstr("AaDFlM", $c)) {
$date = t(date($c, $timestamp)) . $date;
$max = strlen($format);
for ($i = 0; $i <= $max; $c = $format{$i++}) {
if (strpos('AaDFlM', $c)) {
$date .= t(gmdate($c, $timestamp));
}
else if (strpos('BdgGhHiIjLmnsStTUwWYyz', $c)) {
$date .= gmdate($c, $timestamp);
}
else if ($c == 'r') {
$date .= format_date($timestamp - $timezone, 'custom', 'D, d M Y H:i:s O', $timezone);
}
else if (strstr("BdgGhHiIjLmnOrsStTUwWYyZz", $c)) {
$date = date($c, $timestamp) . $date;
else if ($c == 'O') {
$date .= sprintf('%s%02d%02d', ($timezone < 0 ? '-' : '+'), abs($timezone / 3600), abs($timezone % 3600) / 60);
}
else if ($c == 'Z') {
$date .= $timezone;
}
else {
$date = $c.$date;
$date .= $c;
}
}
return $date;
}
/**
* Formats a username.
*
* @param $object User object
* @return String containing a HTML link to the user's page if the
* passed object suggests that this is a site user. Otherwise
* only the user name is returned.
*/
function format_name($object) {
if ($object->uid && $object->name) {
......@@ -825,7 +901,7 @@ function format_name($object) {
*/
if (strlen($object->name) > 20) {
$name = substr($object->name, 0, 15) ."...";
$name = truncate_utf8($object->name, 15) ."...";
}
else {
$name = $object->name;
......@@ -854,16 +930,17 @@ function format_name($object) {
return $output;
}
/* @} */
/**
* @defgroup from Form generation
* @{
*/
function form($form, $method = "post", $action = 0, $options = 0) {
function form($form, $method = "post", $action = NULL, $attributes = NULL) {
if (!$action) {
$action = request_uri();
}
return "<form action=\"$action\" method=\"$method\"". drupal_attributes($options) .">\n$form\n</form>\n";
return "<form action=\"$action\" method=\"$method\"". drupal_attributes($attributes) .">\n$form\n</form>\n";
}
function form_item($title, $value, $description = NULL, $id = NULL) {
......@@ -875,20 +952,28 @@ function form_group($legend, $group, $description = NULL) {
}
function form_radio($title, $name, $value = 1, $checked = 0, $description = NULL, $attributes = NULL) {
return theme("form_element", NULL, "<input type=\"radio\" class=\"form-radio\" name=\"edit[$name]\" value=\"$value\"". ($checked ? " checked=\"checked\"" : "") . drupal_attributes($attributes) ." /> $title", $description);
$element = "<input type=\"radio\" class=\"form-radio\" name=\"edit[$name]\" value=\"$value\"". ($checked ? " checked=\"checked\"" : "") . drupal_attributes($attributes) .' />';
if (!is_null($title)) {
$element = "<label class=\"option\">$element $title</label>";
}
return theme('form_element', NULL, $element, $description);
}
function form_radios($title, $name, $value, $options, $description = NULL) {
if (count($options) > 0) {
foreach ($options as $key => $choice) {
$choices .= "<input type=\"radio\" class=\"form-radio\" name=\"edit[$name]\" value=\"$key\"". ($key == $value ? " checked=\"checked\"" : "") ." /> $choice<br />";
$choices .= "<label class=\"option\"><input type=\"radio\" class=\"form-radio\" name=\"edit[$name]\" value=\"$key\"". ($key == $value ? " checked=\"checked\"" : "") ." /> $choice</label><br />";
}
return theme("form_element", $title, $choices, $description);
return theme('form_element', $title, $choices, $description);
}
}
function form_checkbox($title, $name, $value = 1, $checked = 0, $description = NULL, $attributes = NULL) {
return form_hidden($name, 0) . theme("form_element", NULL, "<input type=\"checkbox\" class=\"form-checkbox\" name=\"edit[$name]\" value=\"". $value ."\"". ($checked ? " checked=\"checked\"" : "") . drupal_attributes($attributes) ." /> $title", $description);
$element = "<input type=\"checkbox\" class=\"form-checkbox\" name=\"edit[$name]\" id=\"edit-$name\" value=\"". $value ."\"". ($checked ? " checked=\"checked\"" : "") . drupal_attributes($attributes) .' />';
if (!is_null($title)) {
$element = "<label class=\"option\">$element $title</label>";
}
return form_hidden($name, 0) . theme('form_element', NULL, $element, $description);
}
function form_textfield($title, $name, $value, $size, $maxlength, $description = NULL, $attributes = NULL) {
......@@ -939,34 +1024,7 @@ function form_weight($title = NULL, $name = "weight", $value = 0, $delta = 10, $
}
/* @} */
/**
* Given an old url, return the alias.
*/
function drupal_get_path_alias($path) {
if (($map = drupal_get_path_map()) && ($newpath = array_search($path, $map))) {
return $newpath;
}
elseif (function_exists("conf_url_rewrite")) {
return conf_url_rewrite($path, 'outgoing');
}
}
/**
* Given an alias, return the default url.
*/
function drupal_get_normal_path($path) {
if (($map = drupal_get_path_map()) && isset($map[$path])) {
return $map[$path];
}
elseif (function_exists("conf_url_rewrite")) {
return conf_url_rewrite($path, 'incoming');
}
else {
return $path;
}
}
function url($url = NULL, $query = NULL, $fragment = NULL) {
function url($url = NULL, $query = NULL, $fragment = NULL, $absolute = NULL) {
global $base_url;
static $script;
......@@ -988,56 +1046,59 @@ function url($url = NULL, $query = NULL, $fragment = NULL) {
$fragment = "#$fragment";
}
$base = ($absolute ? $base_url . '/' : '');
if (variable_get("clean_url", "0") == "0") {
if (isset($url)) {
if (isset($query)) {
return "$base_url/$script?q=$url&amp;$query$fragment";
return "$base$script?q=$url&amp;$query$fragment";
}
else {
return "$base_url/$script?q=$url$fragment";
return "$base$script?q=$url$fragment";
}
}
else {
if (isset($query)) {
return "$base_url/$script?$query$fragment";
return "$base$script?$query$fragment";
}
else {
return "$base_url/$fragment";
return "$base$fragment";
}
}
}
else {
if (isset($url)) {
if (isset($query)) {
return "$base_url/$url?$query$fragment";
return "$base$url?$query$fragment";
}
else {
return "$base_url/$url$fragment";
return "$base$url$fragment";
}
}
else {
if (isset($query)) {
return "$base_url/$script?$query$fragment";
return "$base$script?$query$fragment";
}
else {
return "$base_url/$fragment";
return "$base$fragment";
}
}
}
}
function drupal_attributes($attributes = NULL) {
if (is_array($attributes)) {
function drupal_attributes($attributes = array()) {
if (count($attributes)) {
$t = array();
foreach ($attributes as $key => $value) {
$t[] = "$key=\"$value\"";
}
return " ". implode($t, " ");
}
}
function l($text, $url, $attributes = array(), $query = NULL, $fragment = NULL) {
if ($url == $_GET['q']) {
function l($text, $url, $attributes = array(), $query = NULL, $fragment = NULL, $absolute = NULL) {
if (drupal_get_normal_path($url) == $_GET['q']) {
if (isset($attributes['class'])) {
$attributes['class'] .= ' active';
}
......@@ -1045,7 +1106,7 @@ function l($text, $url, $attributes = array(), $query = NULL, $fragment = NULL)
$attributes['class'] = 'active';
}
}
return "<a href=\"". url($url, $query, $fragment) ."\"". drupal_attributes($attributes) .">$text</a>";
return "<a href=\"". url($url, $query, $fragment, $absolute) ."\"". drupal_attributes($attributes) .">$text</a>";
}
function field_get($string, $name) {
......@@ -1091,6 +1152,33 @@ function drupal_page_footer() {
module_invoke_all("exit");
}
/**
* Walks through the provided array and constructs an associative
* array out of it. The keys of the resulting array will be the
* values of the passed array. The values will either be the same
* (if no function was specified), or the results of the function
* given the value.
*
* @param $array An array
* @param $function A name of a function to apply to all values
*/
function drupal_map_assoc($array, $function = NULL) {
if (!isset($function)) {
$result = array();
foreach ($array as $value) {
$result[$value] = $value;
}
return $result;
}
elseif (function_exists($function)) {
$result = array();
foreach($array as $value) {
$result[$value] = $function($value);
}
return $result;
}
}
/**
* Wrapper around xml_parser_create() which extracts the encoding from the XML
* data first and sets the output encoding to UTF-8. This function should be
......@@ -1110,15 +1198,50 @@ function drupal_xml_parser_create(&$data) {
}
/*
* Note: unsupported encodings will need to be converted here into UTF-8,
* and $encoding set to 'utf-8'.
* Unsupported encodings are converted here into UTF-8.
* Requires iconv, see http://www.php.net/iconv
*/
$php_supported = array('utf-8', 'iso-8859-1', 'us-ascii');
if (!in_array(strtolower($encoding), $php_supported)) {
if (function_exists('iconv')) {
$out = iconv($encoding, 'utf-8', $data);
if ($out !== false) {
$data = $out;
$encoding = 'utf-8';
}
}
}
$xml_parser = xml_parser_create($encoding);
xml_parser_set_option($xml_parser, XML_OPTION_TARGET_ENCODING, 'utf-8');
return $xml_parser;
}
/**
* UTF-8-safe string truncation
* If the end position is in the middle of a UTF-8 sequence, it scans backwards
* until the beginning of the byte sequence.
*
* Use this function whenever you want to chop off a string at an unsure
* location. On the other hand, if you're sure that you're splitting on a
* character boundary (e.g. after using strpos or similar), you can safely use
* substr() instead.
*
* @param $string The string to truncate
* @param $len An upper limit on the returned string length.
*/
function truncate_utf8($string, $len) {
$slen = strlen($string);
if ($slen <= $len) {
return $string;
}
if ((ord($string[$len]) < 0x80) || (ord($string[$len]) >= 0xC0)) {
return substr($string, 0, $len);
}
while (ord($string[--$len]) < 0xC0) {};
return substr($string, 0, $len);
}
include_once "includes/theme.inc";
include_once "includes/pager.inc";
include_once "includes/menu.inc";
......@@ -1130,7 +1253,7 @@ function drupal_xml_parser_create(&$data) {
set_error_handler("error_handler");
// spit out the correct charset http header
header("Content-Type: text/html; charset=utf-8");
drupal_set_header("Content-Type: text/html; charset=utf-8");
// initialize the _GET["q"] prior to loading the modules and invoking their 'init' hook:
if (!empty($_GET["q"])) {
......
......@@ -14,7 +14,6 @@
# $db_url = "mysql://user:password@hostname/database";
# $db_url = "pgsql://user:password@hostname/database";
# $db_url = "mssql://user:password@hostname/database";
$db_url = "mysql://drupal:drupal@localhost/drupal";
# If $db_prefix is specified all database table names will be
......
......@@ -175,11 +175,17 @@ function file_copy(&$source, $dest = 0, $replace = 0) {
// and find a new filename.
$pos = strrpos($basename, '.');
$name = substr($basename, 0, $pos);
$ext = substr($basename, $pos);
if ($pos = strrpos($basename, '.')) {
$name = substr($basename, 0, $pos);
$ext = substr($basename, $pos);
}
else {
$name = $basename;
}
$counter = 0;
do {
$dest = $directory . FILE_SEPARATOR . $name .'_'. $counter++ . $ext;
$counter++;
} while (file_exists($dest));
}
......@@ -249,13 +255,18 @@ function file_save_upload($source, $dest = 0, $replace = 0) {
// Check for file upload errors.
switch ($file->error) {
case UPLOAD_ERR_PARTIAL:
case UPLOAD_ERR_NO_FILE:
case 0: // UPLOAD_ERR_OK
break;
case 1: // UPLOAD_ERR_INI_SIZE
case 2: // UPLOAD_ERR_FORM_SIZE
drupal_set_message(t("file upload failed: file size too big."), 'error');
return 0;
case 3: // UPLOAD_ERR_PARTIAL
case 4: // UPLOAD_ERR_NO_FILE
drupal_set_message(t("file upload failed: incomplete upload."), 'error');
return 0;
case UPLOAD_ERR_INI_SIZE:
case UPLOAD_ERR_FORM_SIZE:
drupal_set_message(t("file upload failed: file size too big."), 'error');
default: // Unknown error
drupal_set_message(t("file upload failed: unkown error."), 'error');
return 0;
}
......@@ -296,7 +307,7 @@ function file_transfer($source, $headers) {
// Transfer file in 1024 byte chunks to save memory usage.
$fd = fopen($source, 'rb');
while (!feof($fd)) {
print fgets($fd);
print fgets($fd, 1024);
}
fclose($fd);
exit();
......
......@@ -140,11 +140,11 @@ function menu_execute_active_handler() {
if ($_list[$path]["callback"]) {
$arg = substr($_GET["q"], strlen($path) + 1);
if (empty($arg)) {
return call_user_func($_list[$path]["callback"]);
if (isset($arg)) {
return call_user_func_array($_list[$path]["callback"], explode("/", $arg));
}
else {
return call_user_func_array($_list[$path]["callback"], explode("/", $arg));
return call_user_func($_list[$path]["callback"]);
}
}
}
......@@ -170,6 +170,23 @@ function menu_in_active_trail($path) {
return in_array($path, $trail);
}
/**
* Returns true when the menu has visisble children.
*/
function menu_has_visible_children($item) {
global $_list;
if ($_list[$item]['children']) {
foreach ($_list[$item]['children'] as $child) {
if ($_list[$child]['hidden'] == MENU_SHOW) {
return true;
}
}
}
return false;
}
/**
* Returns a rendered menu tree.
*/
......@@ -191,8 +208,11 @@ function menu_tree($parent = "", $hidden = 0) {
** nor children. The latter check avoids that useless links are being
** rendered.
*/
if (($_list[$item]["hidden"] == MENU_SHOW && ($_list[$item]["callback"] || $_list[$item]["children"])) || ($_list[$item]["hidden"] == MENU_HIDE_NOCHILD && $_list[$item]["children"])) {
$style = ($_list[$item]["children"] ? (menu_in_active_trail($item) ? "expanded" : "collapsed") : "leaf");
$visible = menu_has_visible_children($item);
if (($_list[$item]["hidden"] == MENU_SHOW && $_list[$item]["callback"]) ||
($_list[$item]["hidden"] == MENU_SHOW && $visible) ||
($_list[$item]["hidden"] == MENU_HIDE_NOCHILD && $visible)) {
$style = ($visible ? (menu_in_active_trail($item) ? "expanded" : "collapsed") : "leaf");
$output .= "<li class=\"$style\">";
$output .= _render_item($item);
if (menu_in_active_trail($item)) {
......
......@@ -106,7 +106,7 @@ function pager_first($text, $limit, $element = 0, $attributes = array()) {
global $pager_from_array;
if ($pager_from_array[$element]) {
return "<a href=\"". pager_link(pager_load_array(0, $element, $pager_from_array), $attributes) ."\">$text</a>";
return "<a href=\"". pager_link(pager_load_array(0, $element, $pager_from_array), $element, $attributes) ."\">$text</a>";
}
else {
// we are already at the first page, return nothing
......@@ -132,7 +132,7 @@ function pager_previous($text, $limit, $element = 0, $n = 1, $attributes = array
if ($from_new[$element] < 1) {
return pager_first($text, $limit, $element, $attributes);
}
return "<a href=\"". pager_link($from_new, $attributes) ."\">$text</a>";
return "<a href=\"". pager_link($from_new, $element, $attributes) ."\">$text</a>";
}
/**
......@@ -151,7 +151,7 @@ function pager_next($text, $limit, $element = 0, $n = 1, $attributes = array())
global $pager_from_array, $pager_total;
$from_new = pager_load_array(((int)$pager_from_array[$element] + ((int)$limit * (int)$n)), $element, $pager_from_array);
if ($from_new[$element] < $pager_total[$element]) {
return "<a href=\"". pager_link($from_new, $attributes) ."\">$text</a>";
return "<a href=\"". pager_link($from_new, $element, $attributes) ."\">$text</a>";
}
return " ";
}
......@@ -170,12 +170,12 @@ function pager_next($text, $limit, $element = 0, $n = 1, $attributes = array())
function pager_last($text, $limit, $element = 0, $attributes = array()) {
global $pager_from_array, $pager_total;
$from_new = pager_load_array(($pager_total[$element] - $limit), $element, $pager_from_array);
$from_new = pager_load_array(($pager_total[$element] - ($pager_total[$element] % $limit)), $element, $pager_from_array);
if ($from_new[$element] < ($pager_from_array[$element] + $limit)) {
return pager_next($text, $limit, $element, 1, $attributes);
}
if (($from_new[$element] > $pager_from_array[$element]) && ($from_new[$element] > 0) && $from_new[$element] < $pager_total[$element]) {
return "<a href=\"". pager_link($from_new, $attributes) ."\">$text</a>";
return "<a href=\"". pager_link($from_new, $element, $attributes) ."\">$text</a>";
}
return " ";
}
......@@ -281,18 +281,20 @@ function pager_list($limit, $element = 0, $quantity = 5, $text = "", $attributes
}
/* @} End of member group pager pieces */
function pager_link($from_new, $attributes = array()) {
function pager_link($from_new, $element, $attributes = array()) {
$q = $_GET["q"];
$from = $_GET["from"];
foreach($attributes as $key => $value) {
$query[] = "$key=$value";
}
$from_new = pager_load_array($from_new[$element], $element, explode("," ,$from));
if (count($attributes)) {
$url = url($q, "from=". $from_new[0] ."&amp;". implode("&amp;", $query));
$url = url($q, "from=". implode($from_new, ",") ."&amp;". implode("&amp;", $query));
}
else {
$url = url($q, "from=". $from_new[0]);
$url = url($q, "from=". implode($from_new, ","));
}
return $url;
......
......@@ -31,8 +31,9 @@ function tablesort($cell, $header) {
// special formatting for the currently sorted column header
if ($cell['data'] == $ts['order']) {
$ts['sort'] = (($ts['sort'] == 'asc') ? 'desc' : 'asc');
$cell['class'] = 'cell-highlight';
$image = '&nbsp;<img src="' . theme('image', 'arrow-' . $ts['sort'] . '.gif"') . ' alt="'. t('sort icon') .'" />';
$image = '&nbsp;<img src="' . theme('image', 'arrow-' . $ts['sort'] . '.gif') . '" alt="'. t('sort icon') .'" />';
$title = ($ts['sort'] == 'asc' ? t("sort ascending") : t("sort descending"));
} else {
// If the user clicks a different header, we want to sort ascending initially.
......@@ -89,12 +90,12 @@ function tablesort_get_order_sql($header, $order) {
function tablesort_get_sort($headers) {
if ($_GET['sort']) {
return ($_GET['sort'] == 'desc') ? 'asc' : 'desc';
return ($_GET['sort'] == 'desc') ? 'desc' : 'asc';
}
// user has not specified a sort. check module for default and if none, use 'asc'
else {
foreach ($headers as $header) {
if (isset($header['sort'])) {
if (is_array($header) && isset($header['sort'])) {
return $header['sort'];
}
}
......
......@@ -21,7 +21,7 @@
* @return a string containing the help output.
*/
function theme_help($section) {
$output = "";
$output = '';
switch ($section) {
case 'admin/system/themes#description':
......@@ -96,7 +96,7 @@ function theme() {
$args = func_get_args();
$function = array_shift($args);
if (($theme != "") && (function_exists($theme ."_". $function))) {
if (($theme != '') && (function_exists($theme ."_". $function))) {
return call_user_func_array($theme ."_". $function, $args);
}
elseif (function_exists("theme_". $function)){
......@@ -208,7 +208,7 @@ function theme_image($name) {
* @return a string containing the @a breadcrumb output.
*/
function theme_breadcrumb($breadcrumb) {
return "<div class=\"breadcrumb\">". implode($breadcrumb, " &raquo; ") ."</div>";
return "<div class=\"breadcrumb\">". implode($breadcrumb, ' &raquo; ') ."</div>";
}
/**
......@@ -245,7 +245,7 @@ function theme_node($node, $main = 0, $page = 0) {
}
if (count($terms)) {
$output .= " <small>(". theme("links", $terms) .")</small><br />";
$output .= " <small>(". theme('links', $terms) .")</small><br />";
}
if ($main && $node->teaser) {
......@@ -256,7 +256,7 @@ function theme_node($node, $main = 0, $page = 0) {
}
if ($links = link_node($node, $main)) {
$output .= "<div class=\"links\">". theme("links", $links) ."</div>";
$output .= "<div class=\"links\">". theme('links', $links) ."</div>";
}
return $output;
......@@ -270,7 +270,7 @@ function theme_node($node, $main = 0, $page = 0) {
* @param $description the form element's description or explanation
* @param $id the form element's ID used by the &lt;label&gt; tag
*
* @return a string containing the @a node output.
* @return a string representing the form element
*/
function theme_form_element($title, $value, $description = NULL, $id = NULL) {
......@@ -285,7 +285,7 @@ function theme_form_element($title, $value, $description = NULL, $id = NULL) {
}
else {
if ($id) {
$title = "<label for=\"$id\" />";
$title = "<label for=\"$id\"></label>";
// TODO: does this make sense to do?
}
}
......@@ -300,10 +300,11 @@ function theme_form_element($title, $value, $description = NULL, $id = NULL) {
/**
* Returns themed table.
*
* @param $header
* @param $rows
* @param $header array of table header strings
* @param $rows array of arrays containing the table cells
* @param $attributes attribute array for the table tag
*
* @return a string containing the @a node output.
* @return a string representing the table.
*/
function theme_table($header, $rows, $attributes = NULL) {
......@@ -317,7 +318,7 @@ function theme_table($header, $rows, $attributes = NULL) {
if (is_array($header)) {
$output .= " <tr>";
foreach ($header as $cell) {
if (is_array($cell) && $cell["field"]) {
if (is_array($cell) && $cell['field']) {
$cell = tablesort($cell, $header);
}
$output .= _theme_table_cell($cell, 1);
......@@ -359,8 +360,8 @@ function theme_table($header, $rows, $attributes = NULL) {
*
* @return a string containing the @a box output.
*/
function theme_box($title, $content, $region = "main") {
$output = "<h2 class=\"title\">$title</h2><p>$content</p>";
function theme_box($title, $content, $region = 'main') {
$output = "<h2 class=\"title\">$title</h2><div>$content</div>";
return $output;
}
......@@ -393,7 +394,7 @@ function theme_block($block) {
* @return a string containing the @a mark output.
*/
function theme_mark() {
return "<span class=\"marker\">*</span>";
return '<span class="marker">*</span>';
}
/**
......@@ -450,7 +451,7 @@ function theme_xml_icon($url) {
* @return a string containing the @a closure output.
*/
function theme_closure($main = 0) {
$footer = module_invoke_all("footer", $main);
$footer = module_invoke_all('footer', $main);
return implode($footer, "\n");
}
......@@ -472,7 +473,7 @@ function theme_onload_attribute($theme_onloads = array()) {
if (count($onloads)) {
return " onload=\"" . implode("; ", $onloads) . "\"";
}
return "";
return '';
}
/**
......@@ -483,7 +484,7 @@ function theme_onload_attribute($theme_onloads = array()) {
* @return a string containing the @a blocks output.
*/
function theme_blocks($region) {
$output = "";
$output = '';
if ($list = module_invoke('block', 'list', $region)) {
foreach ($list as $key => $block) {
......@@ -497,9 +498,9 @@ function theme_blocks($region) {
function _theme_table_cell($cell, $header = 0) {
if (is_array($cell)) {
$data = $cell["data"];
$data = $cell['data'];
foreach ($cell as $key => $value) {
if ($key != "data") {
if ($key != 'data') {
$attributes .= " $key=\"$value\"";
}
}
......
......@@ -150,6 +150,9 @@ li a.active {
.form-item label {
font-weight: bold;
}
.form-item label.option {
font-weight: normal;
}
.form-submit {
margin: 0.5em 0;
}
......@@ -209,18 +212,13 @@ li a.active {
.poll .bar {
height: 1em;
margin: 1px 0;
}
.poll .bar .background {
background-color: #ddd;
float: left;
height: 1em;
margin-left: -1px;
}
.poll .bar .foreground {
background-color: #000;
float: left;
height: 1em;
margin-right: -1px;
clear: left;
float: left;
}
.poll .links {
text-align: center;
......@@ -239,6 +237,9 @@ li a.active {
margin: 0 auto;
display: table;
}
.node-form .poll-form fieldset {
display: block;
}
.more-link {
text-align: right;
}
......@@ -304,7 +305,6 @@ pre, code {
text-align:left;
}
.menu li a {
display: block;
width: 100%;
text-decoration: none;
}
......
<html>
<head>
<title>font test</title>
<style type="text/css">
.f5 { font-size: 5pt; font-family: arial,helvetica; }
.f6 { font-size: 6pt; font-family: arial,helvetica; }
.f7 { font-size: 7pt; font-family: arial,helvetica; }
.f8 { font-size: 8pt; font-family: arial,helvetica; }
.f9 { font-size: 9pt; font-family: arial,helvetica; }
.f10 { font-size: 10pt; font-family: arial,helvetica; }
.f11 { font-size: 11pt; font-family: arial,helvetica; }
.f12 { font-size: 12pt; font-family: arial,helvetica; }
.f13 { font-size: 13pt; font-family: arial,helvetica; }
.f14 { font-size: 14pt; font-family: arial,helvetica; }
.f15 { font-size: 15pt; font-family: arial,helvetica; }
.f16 { font-size: 16pt; font-family: arial,helvetica; }
.f17 { font-size: 17pt; font-family: arial,helvetica; }
.f18 { font-size: 18pt; font-family: arial,helvetica; }
</style>
</head>
<body>
<span class="f5">5pt abcdefghijklmnopqrstuvwxyz</span><br />
<span class="f6">6pt abcdefghijklmnopqrstuvwxyz</span><br />
<span class="f7">7pt abcdefghijklmnopqrstuvwxyz</span><br />
<span class="f8">8pt abcdefghijklmnopqrstuvwxyz</span><br />
<span class="f9">9pt abcdefghijklmnopqrstuvwxyz</span><br />
<span class="f10">10pt abcdefghijklmnopqrstuvwxyz</span><br />
<span class="f11">11pt abcdefghijklmnopqrstuvwxyz</span><br />
<span class="f12">12pt abcdefghijklmnopqrstuvwxyz</span><br />
<span class="f13">13pt abcdefghijklmnopqrstuvwxyz</span><br />
<span class="f14">14pt abcdefghijklmnopqrstuvwxyz</span><br />
<span class="f15">15pt abcdefghijklmnopqrstuvwxyz</span><br />
<span class="f16">16pt abcdefghijklmnopqrstuvwxyz</span><br />
<span class="f17">17pt abcdefghijklmnopqrstuvwxyz</span><br />
<span class="f18">18pt abcdefghijklmnopqrstuvwxyz</span><br />
</body>
</html>
......@@ -19,12 +19,7 @@ function admin_link($type) {
}
function admin_admin() {
if (user_access("access administration pages")) {
print theme("page", watchdog_overview("actions"));
}
else {
print theme("page", message_access());
}
print theme("page", watchdog_overview("actions"));
}
?>