Commit Graph

53 Commits (49240b6b1e55c1986f572408fc69f7c293d06787)

Author SHA1 Message Date
Steven Wittens 198ec98f75 #18329: Unify confirmation messages (and make them themable) 2005-03-03 20:51:27 +00:00
Dries Buytaert 668e8cbf18 - Patch #16016 by Goba: fixed various bugs in filter tip display. 2005-01-23 22:29:28 +00:00
Dries Buytaert 3ec108eccc - Refinements by Walkah, based on suggestions of Steven and myself. 2005-01-19 19:30:04 +00:00
Dries Buytaert 74aa71e89b - Patch #15847 by James: added rel="nofollow" support. This is implemented as a filter so it can be enabled/disabled on a per-role basis (eg. some people might want to enable this for anonymous users but not for authenticated users). 2005-01-19 16:35:14 +00:00
Steven Wittens 0bda8f4700 #14548: Add optional HTML help to filter.module's HTML filter. 2005-01-03 01:09:02 +00:00
Dries Buytaert 2b17b3a966 - Patch #13907 by Neil: less ways to set the page title.
* Less logic in theme code.
   * Encourages use of the menu system.
   * Easier to find where a title or breadcrumb comes from in other people's code because there are less places to look. Look in menu and then grep for the appropriate set function. Looking for calls to theme_page() is hard because there are too many of them.
   * Very slightly more efficient.
2004-12-15 21:19:42 +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 9979aceab0 - Patch #12783 by Stefan: various small consistency/usability improvements. 2004-11-15 11:16:39 +00:00
Steven Wittens 83dc5f9bab #12295: missing </p> in filter help. 2004-10-30 16:58:51 +00:00
Steven Wittens 9e4399aae8 #10677: Confirmation when deleting a block + unifying confirmation screens. 2004-10-14 15:28:24 +00:00
Dries Buytaert 4bc031b13e - Patch #11530 by Frodo: fixed long filter tips. 2004-10-13 17:03:06 +00:00
Steven Wittens 7a536c06d4 #11503: missing t() in throttle and filter modules. 2004-10-12 15:56:02 +00:00
Dries Buytaert 489903fd90 - Bugfix: the filter tips contained a non-existing ID which resulted in invalid XHTML code. 2004-10-09 16:01:07 +00:00
Dries Buytaert a56f9b5c9f - Bugfix: the filter module generated an empty <ul></ul> (= invalid XHTML) when no filter tips are present. 2004-10-09 15:47:44 +00:00
Steven Wittens 1298d2b9c9 Modified version of #10230: Put placement of filter format selector in a module's hands, and move it below the relevant textarea. 2004-09-28 19:13:03 +00:00
Dries Buytaert 5c7983c4de - Patch #8179 by JonBob: reintroduced menu caching. 2004-09-16 07:17:56 +00:00
Steven Wittens f8b429e963 #10862: Smarter filter cache wiping. 2004-09-15 20:34:35 +00:00
Steven Wittens ad864fae9e Filter.module usability: the default format is implicitly accessible to everyone (prevents misconfigurations).
The role checkboxes are disabled in the admin interface for the default format.
2004-09-13 23:24:48 +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 0b1592c395 - Patch #10678 by drumm: usability improvement: one-liner to make the deletion message more consistent with the rest of Drupal. Use <em>-tags instead of single quotes. 2004-09-09 05:12:59 +00:00
Dries Buytaert d619ccc87e - Patch #10247 by Bart Jansens: bugfixes: added some missing braces and changed the default value in one variable_get so the same default value is used everywhere. 2004-08-21 15:57:25 +00:00
Dries Buytaert ab616a560a - Patch #10233 by Ax: code improvement: made sure the default filtered tags
are XHTML compliant.
2004-08-21 10:13:54 +00:00
Dries Buytaert 94e30bf776 - Patch by JonBob: for consistency and readability, add brief descriptions of each source file inside the @file comment block at the head of the file. This helps with Doxygen indexing, and also allows neophytes to see what a file does immediately on opening the source, regardless of the organization of the hooks. 2004-08-21 06:42:38 +00:00
Dries Buytaert fa25c7a0ca - Code improvements by Stefan: use capital letters for header titles (and added some missing t() functions). 2004-08-19 15:41:57 +00:00
Steven Wittens feb61eea86 Fixing incorrect default value of allowed_html at one instance. 2004-08-19 14:55:17 +00:00
Dries Buytaert 83a739bd89 - Code improvements by Stefan: made all status messages consistent (and easier to translate). 2004-08-18 19:57:27 +00:00
Dries Buytaert 0f088b79ca - Patch #9983 by Stefan: various code style improvements. 2004-08-12 18:00:11 +00:00
Steven Wittens 2b594adc54 Renumbering filters in filter.module. 2004-08-12 15:13:38 +00:00
Steven Wittens 441b63accd Moving all legacy handlers into legacy.module. 2004-08-12 15:12:26 +00:00
Steven Wittens 8517e17e70 - Removing tab from line break convertor
- Cleaning up code a bit
2004-08-11 11:21:36 +00:00
Steven Wittens 6fd74abb88 - Renaming parameter to hook_filter_tips()
- Removing some leftover dead code
2004-08-10 22:51:21 +00:00
Steven Wittens b9700a638f - #9927: Filter.module doxygen fixes by JonBob 2004-08-10 21:25:39 +00:00
Steven Wittens 660f99287d The Input formats - filter patch has landed. I still need to make update instructions for modules and update the hook docs.
Here's an overview of the changes:
1) Multiple Input formats: they are complete filter configurations (what filters to use, in what order and with which settings). Input formats are admin-definable, and usage of them is role-dependant. For example, you can set it up so that regular users can only use limited HTML, while admins can free HTML without any tag limitations.
The input format can be chosen per content item (nodes, comments, blocks, ...) when you add/edit them. If only a single format is available, there is no choice, and nothing changes with before.

The default install (and the upgrade) contains a basic set of formats which should satisfy the average user's needs.

2) Filters have toggles
Because now you might want to enable a filter only on some input formats, an explicit toggle is provided by the filter system. Modules do not need to worry about it and filters that still have their own on/off switch should get rid of it.

3) Multiple filters per module
This was necessary to accomodate the next change, and it's also a logical extension of the filter system.

4) Embedded PHP is now a filter
Thanks to the multiple input formats, I was able to move the 'embedded PHP' feature from block.module, page.module and book.module into a simple filter which executes PHP code. This filter is part of filter.module, and by default there is an input format 'PHP', restricted to the administrator only, which contains this filter.
This change means that block.module now passes custom block contents through the filter system.
As well as from reducing code duplication and avoiding two type selectors for page/book nodes, you can now combine PHP code with other filters.

5) User-supplied PHP code now requires <?php ?> tags.
This is required for teasers to work with PHP code. Because PHP evaluation is now just another step in the filter process, we can't do this. Also, because teasers are generated before filtering, this would result in errors when the teaser generation would cut off a piece of PHP code.

Also, regular PHP syntax explicitly includes the <?php ?> tags for PHP files, so it makes sense to use the same convention for embedded PHP in Drupal.

6) Filter caching was added.
Benchmarking shows that even for a simple setup (basic html filtering + legacy URL rewriting), filtercache can offer speedups. Unlike the old filtercache, this uses the normal cache table.

7) Filtertips were moved from help into a hook_filter_tips(). This was required to accomodate the fact that there are multiple filters per module, and that filter settings are format dependant. Shoehorning filter tips into _help was ugly and silly. The display of the filter tips is done through the input format selector, so filter_tips_short() no longer exists.

8) A more intelligent linebreak convertor was added, which doesn't stop working if you use block-level tags and which adds <p> tags.
2004-08-10 18:34:29 +00:00
Dries Buytaert ac5b5616c0 - More tab-improvements by JonBob: improved support for the default tabs! 2004-07-10 15:51:48 +00:00
Dries Buytaert c989fc7cf7 - Small improvement to the filter.module's help text.
- Revert patch that accidentically got committed.  Thanks jhriggs.
2004-07-08 13:35:15 +00:00
Dries Buytaert efed4cfc70 - Patch #8679 by asimmonds: fixed spelling mistakes. 2004-06-20 08:27:03 +00:00
Dries Buytaert 54b77d6435 Tabs patch!
CHANGES
-------

 + Introduced tabs. First, we extended the menu system to support tabs. Next, a tab was added for every link that was (1) an administrative action other than the implicit 'view' (2) relevant to that particular page only. This is illustrated by the fact that all tabs are verbs and that clicking a page's tab leads you to a subpage of that page.

 + Flattened the administration menu. The tabs helped simplify the navigation menu as I could separate 'actions' from 'navigation'. In addition, I removed the 'administer > configuration'-menu, renamed 'blocks' to 'sidebars' which I hope is a bit more descriptive, and made a couple more changes. Earlier, we already renamed 'taxonomy' to 'categorization' and we move 'statistics' under 'logs'.

 + Grouped settings. All settings have been grouped under 'administer > settings'.

TODO
----

 + Update core themes: only Xtemplate default supports tabs and even those look ugly.  Need help.

 + Update contributed modules.  The menu() hook changed drastically.  Updating your code adhere the new menu() function should be 90% of the work.  Moreover, ensure that your modue's admin links are still valid and that URLs to node get updated to the new scheme ('node/view/x' -> 'node/x').
2004-06-18 15:04:37 +00:00
Dries Buytaert d80d2d6e2d - Patch #8477 by Goba: fixes issues of newline handling in filters, unifying what newline should a filter expect, and fixes the missing title filter tip issue. 2004-06-15 18:02:52 +00:00
Dries Buytaert e52c0f5d41 - Code improvements by JonBob. Thanks. 2004-05-17 22:00:06 +00:00
Dries Buytaert 5c9c65d2f3 - Patch #7503 by bylund: two strings could not be translated. 2004-05-03 17:33:44 +00:00
Dries Buytaert 7231c88a32 - Added support for 403 handling. Patch by JonBob. As a side benefit,
administrators will be able to define a custom 403 page, just as they
  can define 404 pages now.

  This needs to be documented in the "Changes since / migrating to ..."
  pages.
2004-04-21 13:56:38 +00:00
Dries Buytaert 10bdb51c37 - Patch by JonBob/Jonathan: reworked the menu system so that menus are
configurable!  Menu items can be disabled, repositioned, added and
  so on.

  Upgrading to requires you to run update.php.

  This functionality depricates some of the 'navigation modules' in the
  contributions repository.  Furthermore, modules can now 'suggest'
  menu items and site adminstrators can choose to enable them.  Modules
  in the contributions repository should try to take advantage of this.
2004-04-15 20:49:42 +00:00
Dries Buytaert 4a8571bfdb - Patch #6000 by Goba: makes the short tip list a HTML list (as it is semantically
expected) and gives proper class names to the long and short tip list, so if
  someone would like to reproduce the 'br' tagged version, he can do that with
  some CSS styles easily.  Assigned a dedicated class to the more-tips link, so it
  can be differently stlyed (with a different bullet, different link color or
  anyhow, as the theme designer desires).
2004-02-23 13:17:17 +00:00
Kjartan Mannes 32e46a375d - Fixing help text. The filters DO NOT removed unclosed valid tags. 2004-02-21 16:00:24 +00:00
Dries Buytaert 7abb76e1d1 - Patch 5897 by Moshe: don't consider the 'U' tag to be a block level tag. 2004-02-17 05:57:13 +00:00
Dries Buytaert 4b0b2d02ee - Patch by Steven: removed redundant permission checks. These are no longer
required thanks to the new 404 handling.
2004-02-15 20:09:46 +00:00
Steven Wittens 0a8535eeef - Fix: do not call prepare hook when the admin has chosen to escape everything
- Code style: use constants to prevent confusing configuration options
2004-02-06 19:41:00 +00:00
Dries Buytaert bfba335376 - Added the possibility to reorder filters. Patch by UnConeD. 2004-02-06 19:07:56 +00:00
Dries Buytaert fcb9011d88 - Modified filter patch by Ax. 2004-01-31 10:18:51 +00:00
Dries Buytaert 02c622dea1 - Patch 4332 by Goba: eliminate compose tips module. 2004-01-27 22:10:47 +00:00