Project Page: http://drupal.org/project/flexifilter
Rerolled:
This filter will be the filter to end all filters. It will be like the CCK of Drupal 4.7: as CCK wiped out almost all custom node types in favor of a more user-configurable approach, this module will wipe out all sorts of custom filters to allow a more user-configurable approach. It will allow almost any filtering tasks to take place WITHOUT A CUSTOM MODULE having to be installed.
This filter would expose to the user interface a set of options. The user will be able to define more than one filter. (A filter is something that can be used within an input format). Each filter is composed of components: this task should define basic find/replace components. For example: for every "<front>" replace with "<a href="/node">front page</a>". User should be able to decide whether this is case sensitive or not.
There should be basic logic statements included, such as while() statements and if () statements. For example: if (post contained the phrase "add link") {. The if statements should be components by themselves. This module should get its components by invoking hooks in other modules.
So to recap briefly:
1) Create framework for a filtering module that invokes hooks. This/these should be easy-to-implement yet powerful hooks.
2) Write default hooks for simple find/replace.
3) Add logic statements such as if() and while() to the module.
This task is finished when a module is posted and reviewed by two members. It is to be written for Drupal 6.
Resources
* How to write a good API at http://buytaert.net/how-to-design-a-good-api.
* Documentation on hook_filter at http://api.drupal.org/api/function/hook_filter/6.
* Example filter at http://api.drupal.org/api/file/developer/examples/filter_example.module/....
* Documentation on invoking hooks at http://api.drupal.org/api/function/module_invoke_all/6.
* Documentation of PHP string manipulation functions at http://us3.php.net/manual/en/ref.strings.php.
* Can contact dmitrig01 for help: either drupal.org contact form or irc.freenode.net #drupal-ghop. In fact, anyone at the #drupal-ghop channel will probably be able to provide help if needed
Primary contact: dmitrig01
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | flexifilter_03.tar_.gz | 13.42 KB | corsix |
| #8 | flexifilter_02.tar_.gz | 13.4 KB | corsix |
| #6 | flexifilter_01.tar_.gz | 13.06 KB | corsix |
Comments
Comment #1
gpk commentedHow would this relate to Token module http://drupal.org/project/token, which may already do some of this ...?
Comment #2
cwgordon7 commented#1: It wouldn't. The token module does not do filtering; even if it did, it would be inadequate. This is something more; it may be possible to include tokens, but they are not critical to the task.
Comment #3
sunThat's a huge task. The student accomplishing it will probably receive kudos for life-time. :)
See Inline API issue for a proper draft about what is required and how this could be accomplished. Furthermore, we are probably speaking of Inline v2.x here.
Comment #4
cwgordon7 commentedClaimed by Corsix.
THIS IS JUST SO COMPLETELY AWESOME! I'M SO EXCITED TO SEE HOW THIS TURNS OUT!
-cwgordon7
Edit: Just for the record, I'm the one who's going to be maintaining this after it's finished, so no worries about an unmaintained chunk of code, people. :D
Comment #5
catchsubscribe, sounds wonderful.
Comment #6
corsix commentedIt's quite rough around the edges, but should be functional.
Comment #7
cwgordon7 commentedMajor problem:
Undefined index: in sites\all\modules\flexifilter\flexifilter.module on line 461. This error occurs when there are no conditions inside of something that contains conditions (which should default to false).
Minor problems:
-Add a notice when there are no conditions that it defaults to false.
-Replace the "Help text will go here." text with actual help text.
-Edit, delete, and disable/enable should each have a column of the table for themselves. EDIT: I mean on the overview page, not in the database.
Would probably be better as
-The "Number of iterations before abort" field should check to make sure the value is_numeric. "Abc" can be entered without an error.
Note: These minor problems are very nitpicky, and I probably wouldn't ask you to do them if you didn't have a major problem to fix as well.
However, this looks just plain awesome!
-cwgordon7
Comment #8
corsix commentedFixed the major problem, wrote some help text, moved edit/disable/delete to seperate columns, made adjustments to the comment and extended the description on the no condition to indicate what it does. Didn't add any hard validation to the maximum iterations, as it would require changes on a larger scale (a new $op="settings validate" for components, which would then also need mirroring into conditions for internal consistency).
Comment #9
cwgordon7 commentedAs much as I hate to set this back to code needs work, here I am, doing it. Here's the bug I found:
1) Add a new filter. Do some stuff, then, instead of clicking "create", click "create and edit".
2) Do some more stuff, and then click "create".
3) You're redirected to the overview page, where you notice your filter has been duplicated: the first version is like a snapshot from step 1, the second version is like a snapshot from step 2. This is wrong.
The reason this is happening appears to be because even when you click "create and edit" you remain on the add form, and thus when you click "create" again, it attempts to create a new one. This should be relatively simple to solve by redirecting to the edit form upon clicking "create and edit". This appears to be the only problem I could find.
Hopefully this will be done soon and we can get a release out! This is so exciting!
Comment #10
cwgordon7 commentedOops! Another bug:
It appears that $constant is undefined on line 165 of flexifilter.components.inc in the line
You probably meant to use $step, not $constant.
Comment #11
corsix commentedFixed the two aforementioned issues.
Comment #12
cwgordon7 commentedOk, after discussion with dmitrig01, this is rtbc. I'll be checking it into cvs shortly.
Comment #13
cwgordon7 commentedChecked into cvs! This is closed! Awesomeful! Setting to closed, not fixed, to save webchick work ;)
Comment #14
pasqualleThe project page:
http://drupal.org/project/flexifilter