Commit Graph

77 Commits (3604231dd1d7eca9e650b743bdcad811e83d0afb)

Author SHA1 Message Date
Dries Buytaert ab78dadd51 - Patch #520764 by Damien Tournoud, JoshuaRogers, brianV: fixed SA-CORE-2009-007: request values in URL, including password/username. 2009-12-05 20:17:02 +00:00
Dries Buytaert 1b01b241ae - Patch #648744 by Crell: specified more @return type definitions for auto-completion in IDEs. 2009-12-04 16:31:04 +00:00
Dries Buytaert bc48ac21da - Patch #266434 by catch, merlinofchaos, sun: fixed E_NOTICE in pager_load_array(). 2009-11-14 20:20:06 +00:00
Dries Buytaert 534c89f21e - Patch #321023 by Everett Zufelt, mgifford: improve accesibility in pager.inc. 2009-10-31 18:12:26 +00:00
Dries Buytaert c05f2181dc - Patch #572618 by effulgentsia, pwolanin, sun: all theme functions should take a single argument. Code clean-up and performance improvement. Woot. 2009-10-09 01:00:08 +00:00
Dries Buytaert 598e739208 - Patch #578520 by sun | c960657, mfb, Dries, catch, mattyoung: make in url() only accept an array. Another nice API clean-up! 2009-09-29 15:31:17 +00:00
Angie Byron e18feedfdb #564394 by Berdir and Crell: Removed database BC layer. nah nah nah nah... hey hey hey... gooood byeeee... 2009-09-18 00:04:24 +00:00
Angie Byron fd164e9d02 #496516 by Crell and Berdir: Moved query_alter() into a preExecute() method, so that modules can know the final query/arguments before they are run. 2009-08-26 04:58:23 +00:00
Angie Byron 36ec189695 #326539 by JohnAlbin, sun, cha0s, ultimateboy, Rob Loach, Damien Tournoud: Convert 'class' attribute to use an array, not a string. 2009-08-22 14:34:23 +00:00
Angie Byron 82f604753e #514914 by Gábor Hojtsy: Add back removed pager_limits variable. 2009-08-11 16:43:11 +00:00
Dries Buytaert a938e18a1b - Patch #491556 by Berdir: completed converting core to DBTNG. Oh my. Kudos to Berdir for this humongous effort. 2009-07-28 19:18:08 +00:00
Dries Buytaert 79748fa835 - Patch #430904 by Berdir: fixed notice in case there are two pagers on one page. 2009-05-12 18:26:41 +00:00
Dries Buytaert 7a6f73f49d - Patch #330748 by stBorchert: remove from theme_pager*. 2009-04-26 19:44:40 +00:00
Dries Buytaert b3e36d655c - Patch #299267 by Crell: add extender support to the SELECT query builder. 2009-02-22 16:53:41 +00:00
Angie Byron f76acb2d9d #282405 by Damien Tournoud, lilou, Dave Reid: Enforce coding standard on elseif. 2008-10-12 04:30:09 +00:00
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