Commit Graph

62 Commits (4f17920c7578fa30ee489914ea83f5b6586b82ef)

Author SHA1 Message Date
Gábor Hojtsy d83289f857 #196667 (GHOP 45) by fberci: add '@ingroup themeable' to all themeable functions 2007-12-06 09:58:34 +00:00
Dries Buytaert bb7d1395bc - Patch #163508 by profix898: fixed 4 E_ALL notices. 2007-08-02 10:58:41 +00:00
Dries Buytaert 2a65f86bf0 - Patch #135931 by EclipseGc: semantic update for core pager. 2007-05-01 06:53:03 +00:00
Dries Buytaert dc5843bd30 - Patch #111347 by Steven: refactor url() and l(). 2007-02-15 11:40:19 +00:00
Dries Buytaert 8d74e4c132 - Patch #87995 by merlinofchaos: added missing css. 2006-10-15 19:57:06 +00:00
Dries Buytaert f2f3416549 - Patch #80934 by timnc: more t() fixes. 2006-08-27 12:43:18 +00:00
Neil Drumm 0ad40f33d4 #80200 by gorgen. More strict pager query regexp. 2006-08-24 08:49:04 +00:00
Dries Buytaert b31b892900 - Patch #78364 by chx: remove pager cruft. 2006-08-16 19:52:37 +00:00
Dries Buytaert e93f8be871 - Patch #72204 by nedjo: upper-cased all TRUE/FALSE/NULL constants. 2006-07-05 11:45:51 +00:00
Gerhard Killesreiter d6a164c400 #5371, drupal_get_destination, pager and tablesort array handling, patch by Steven 2006-04-13 08:25:27 +00:00
Dries Buytaert 84beb25884 - Patch #44771 by jvandyk: small performance improvement. 2006-01-15 16:55:35 +00:00
Steven Wittens 3329ad927c - #44498: Clean up pager / make more accessible 2006-01-15 00:04:20 +00:00
Dries Buytaert 1a866d14f4 - Patch #44498 by m3vrck: improved HTML generated code for pagers. 2006-01-14 09:40:22 +00:00
Dries Buytaert f6764cfbd8 - Patch #30930 by m3avrck/deekayen: cured PHP5 warnings. 2005-10-22 15:14:46 +00:00
Steven Wittens a9260fa2cd - #32603: Clean up theme_pager_link (drumm) 2005-10-21 10:58:15 +00:00
Dries Buytaert 7b8a409675 - Patch #29385 by chx: no ?> add end of files. 2005-08-25 21:14:17 +00:00
Dries Buytaert 9dec4430b2 - Patch #27980 by Neil Drumm: removed unused function. 2005-08-10 20:50:14 +00:00
Steven Wittens c81bbf4aa1 - #24673: Fix deprecated usage of implode 2005-07-30 12:52:54 +00:00
Steven Wittens 753bc588d9 - Fix mistakes in pager patch. 2005-05-25 05:42:05 +00:00
Steven Wittens 3598cbb988 - #23495: Clean up pager code. Now uses $page instead of $from, and counts pages, not items. 2005-05-25 03:29:06 +00:00
Steven Wittens be14203534 - #18817: Clean up plain-text checking (see drupal-devel!) 2005-03-31 09:25:33 +00:00
Dries Buytaert b24a4bda34 - Patch by Remco: <div> -> </div>. 2005-01-28 18:44:17 +00:00
Dries Buytaert b5a72f6216 - Patch by Jeremy: fixed unclosed " 2005-01-27 19:01:01 +00:00
Dries Buytaert 6e30ba6874 - Patch by Jeremy: made the diffs more meaningful. 2005-01-27 15:53:58 +00:00
Dries Buytaert 8618346133 - Patch #16273 by Jeremy: improved the themability of the pager. 2005-01-27 14:30:33 +00:00
Steven Wittens 01d216018f Pager_query's count query was broken if no query arguments were given. 2004-12-06 11:57:04 +00:00
Dries Buytaert cbf3f21e42 - Patch by Steven: fixed bug in pager_query(). 2004-12-04 17:22:08 +00:00
Steven Wittens b70378be00 Fix for pager_query() after #13581 (array of query arguments). 2004-12-02 07:06:33 +00:00
Dries Buytaert 29337ad8bb - Patch #13581 by Steven: Db_query() allows a variable amount of parameters so you can pass the query arguments in. There is however an alternative syntax: instead of passing the query arguments as function arguments, you can also pass a single array with the query arguments in it. For example the following two statements are equivalent:
db_query($query, $a, $b, $c);
db_query($query, array($a, $b, $c));

This usage is particularly interesting when the query is constructed dynamically, and the amount of arguments to pass varies. In that case we use the second method to avoid using call_user_func_array(). This behaviour is not documented explicitly, but it is used in several places.

However, db_query_range() and pager_query() do not support this syntax properly, which means there are several pieces of code which still revert to the ugly call_user_func_array() call.

This patch updates db_query_range() and pager_query() so they support the array-passing method. I also added documentation about this method to each of the db functions.

I also cleaned up the code for db_query (it was weird and hard to understand) and moved db_query() and db_queryd() from database.xxxxx.inc to database.inc: it was the same between both mysql and pgsql, as it doesn't do anything database specific. It just prefixes the tables and inserts the arguments. The actual db query is performed in _db_query(), which is still in database.xxxxx.inc.

Finally, I updated several places with the new syntax, and the code is a lot cleaner. For example:
- array_unshift($params, "SELECT u.* FROM {users} u WHERE $query u.status < 3");
- $params[] = 0;
- $params[] = 1;
- $result = call_user_func_array('db_query_range', $params);
+ $result = db_query_range("SELECT u.* FROM {users} u WHERE $query u.status < 3", $params, 0, 1);

and

- return call_user_func_array('db_query_range', array_merge(array($query), $args, array((int)$pager_from_array[$element], (int)$limit)));
+ return db_query_range($query, $args, (int)$pager_from_array[$element], (int)$limit);

I've tested it on mysql. I didn't alter the actual db behaviour, so pgsql should be okay too.

This patch is important because many people avoid the call_user_func_array() method and put data directly into the db query.  This is very, very bad because the database prefix will be applied to it, and strip out braces. It's also generally bad form as you have to call check_query() yourself.  With the new, documented syntax, there is no more excuse to put data directly in the query.
2004-11-29 13:13:29 +00:00
Dries Buytaert 29b32eff2b - Patch #7161 by jhriggs: fixed probem with 'last page' link not being correct under certain circumstances. 2004-10-31 07:59:18 +00:00
Dries Buytaert b84b6e42cf - Patch #10663 by JonBob: documentation improvements: fixed some typos and improved consistency to the use of Doxygen/api.module commands in the comments. 2004-09-09 05:51:08 +00:00
Dries Buytaert d651b9dc3b - Patch #7535 by Gerhard: one could not search for the word 'From'. 2004-08-12 05:46:37 +00:00
Dries Buytaert 702a057683 - Patch #9478 by JonBob: allow printf-style arguments in pager_query.
Currently pager_query() is the black sheep of the database query family, because it does not allow for printf-style arguments to be inserted in the query. This is a problem because it introduces developer confusion when moving from an unpaged query to a paged one, and it encourages substitution of variables directly into the query, which can bypass our check_query() security feature.

  This patch adds this ability to pager_query(). The change is backwards-compatible, but a couple calls to the function in core have been changed to use the new capability.
2004-07-25 14:25:42 +00:00
Steven Wittens edc2f13d82 - #9287: More doxygen/documentation fixes by JonBob 2004-07-22 16:06:54 +00:00
Dries Buytaert 9986cb36b5 - Patch #8973 by JonBob: Drupal contains many undefined variables and array indices, which makes PHP throw a lot of warnings when the reporting level is set to E_ALL. Things run fine with these warnings, but as a matter of code style if nothing else we should probably strive to avoid them. The attached fixes most of the more egregious offenders (about 95% of the warnings when I load /node on my test site). 2004-07-02 18:46:42 +00:00
Dries Buytaert 0be1e6cff7 - Issue #8735 by njivy: made the pager code ignore EOLs. 2004-06-22 05:45:15 +00:00
Dries Buytaert 090743bdba - Patch #8670 by asimmonds: more spelling fixes. 2004-06-21 20:05:37 +00:00
Dries Buytaert cbc230a36c - Patch #7696 by TDobes: renamed 'static' to 'sticky' which is a more
logical name.  Requires a database upgrade.
2004-06-19 10:39:36 +00:00
Dries Buytaert 4eb05da890 - Patch #7161 by jhriggs: fixed bug with 'last page' functionality. 2004-04-15 22:18:08 +00:00
Dries Buytaert 7422939964 - Patch 5834 by Jeremy: made multiple pagers on one page work. 2004-02-15 16:04:36 +00:00
Kjartan Mannes 0d7e205062 - New and updated doxygen comments. 2004-01-06 19:52:14 +00:00
Dries Buytaert 7883ea6e1e - Accessibility improvement: changed a <b>-tag to a <strong>-tag, used to
indicated the current page.
2003-12-22 17:30:43 +00:00
Dries Buytaert 712a30b520 - Improvements by Goba:
+ removes the lots of pagers and indirect pager themeing
  + add the theme_pager() function, which should be called as
    theme("pager", ...) to get a pager.
2003-12-08 18:30:20 +00:00
Dries Buytaert 3904790e03 - Tidied up the DoxyGen comments. Patch by Kjartan. 2003-12-08 06:32:19 +00:00
Dries Buytaert 06045ff7fc Patch by Ax to fixe and improve to the core doxygen PHPdoc:
* fixes all doxygen warnings [#]_ in the current code base
    + changes @param style from phpDocumentor (@param type $var desc) to doxygen (@param $var desc)
    + documents all undocumented parameters
    + escapes / fixes html warnings
    + fixes @defgroup in theme.inc
  * adds more groupings [#]_
    + drupal_{set|get}_title, drupal_{set|get}_breadcrumb
    + pager.inc: pager_api (pager_query(), pager_display()), pager pieces
  * adds a new group "themeable" which contains all themeable functions.
2003-11-24 22:46:03 +00:00
Dries Buytaert 951b553a98 - Committed stage 2 of the theme system improvements! Patch by CodeMonkeyX. 2003-11-09 23:27:22 +00:00
Dries Buytaert 355d25e73d - Bugfix: renamed the SQL field 'types' to 'nodes' because 'types' is a reserved keyword in MySQL 4. This fixes critical bug #1618. Patch by Marco.
==> This fix requires to run update.php!

- Bugfix: made sessions work without warnings when register_globals is turned off. The solution is to use $_SESSION instead of session_register().  This fixes critical bug #1797.  Patch by Marco.

- Bugfix: sometimes error messages where being discarded when previewing a node.  Patch by Craig Courtney.

- Bugfix: fixed charset problems.  This fixes critical bug #1549.  Patch '0023.charset.patch' by Al.

- Code improvements: removed some dead code from the comment module.  Patch by Marco.

- Documentation improvements: polished the node module help texts and form descriptions.  Patch '0019.node.module.help.patch' by Al.

- CSS improvements all over the map!  Patch '0021.more.css.patch' by Al.

- GUI improvements: improved the position of Druplicon in the admin menu.  Patch '0020.admin.logo.patch' by Al.

- GUI improvements: new logos for theme Marvin and theme UnConeD.  Logos by Kristjan Jansen.

- GUI improvements: small changes to the output emitted by the profile module.  Suggestions by Steven Wittens.

- GUI improvements: small fixes to Xtemplate.  Patch '0022.xtemplate.css.patch' by Al.

TODO:

- Some modules such as the buddy list module and the annotation module in the contributions repository are also using session_register().  They should be updated.  We should setup a task on Drupal.

- There is code emitting '<div align="right">' which doesn't validate.

- Does our XML feeds validate with the charset changes?

- The forum module's SQL doesn't work properly on PostgreSQL.
2003-06-04 18:24:39 +00:00
Dries Buytaert 05288ac48a - Bugfix: made request_uri() rewrite ( and ) with their entity equivalents
to avoid XSS attacks!  Patch by Al, Moshe, Marco, Kjartan and me.

- Bugfix: the admin module does now import drupal.css prior to admin.css.
Patch by me.

- Bugfix: the admin module was still emitting a <base href=""> tag.  I
removed this as it is been taken care of by theme_head();  Patch by me.

- Bugfix: made the tracker module's pager only consider published pages.
Patch by Moshe.

- Bugfix: cured some typos in the comment module's help function.  Patch by
Marco.

- Bugfix: fixed a typo in the pager_display() that caused optional
attributes to be discarded.

- Bugfix: made the Xtemplate emit empty boxes like any other theme does.
Patch by Al.

- Bugfix: fixed broken link on the statistics module's log page.
Reported by Kjartan.

- CSS improvements: made the HTML output emitted by the tracker module
look nicer.  Patch by Moshe and Al.

- CSS improvements: added CSS classes for form elements.  Patch by Al.

- CSS improvements: added a vertical gap between the last form item and the
submit button.  Patch by Al.  Note that Opera 6 is not picking up this
CSS but apparently others browsers such as Konqueror do.

- Xtemplate improvements: changed the color of the selected day in the
archive module's calendar.  Patch by Al.

- Usability improvements: made the "birthday" field of the profile module
look nicer.  Patch by Al.

------

- TODO: it might be a good idea to emit the following meta tag in the
theme_head() function:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

Currently, some themes (and modules!) emit this while others don't.  This
would also make it possible to change the charset site-wide.

- TODO: now we added support for td.dark and td.light to drupal.css, maybe
it can be removed from admin.css as well as xtemplate.css?
2003-06-03 18:04:47 +00:00
Dries Buytaert b3c8b01d90 - Fixed a register globals problem in the pager. Patch by Al. (I also
removed a dead global variable.)
2003-05-23 21:33:24 +00:00
Dries Buytaert c2d2fb7309 - Fixed a typo in the PostgreSQL database scheme. Patch by Michael Frankowski.
- Fixed a typo in the MSSQL database scheme.  Patch by Michael Frankowski.

- Removed dependency on "register_globals = on"!  Patches by Michael Frankowski.

  Notes:

  + Updated the patches to use $foo["bar"] instead of $foo['bar'].
  + Updated the INSTALL and CHANGELOG files as well.

- Tiny improvement to the "./scripts/code-clean.sh" script.
2003-05-13 18:36:38 +00:00