Links & Info:
- JCSS Insert (or JS/CSS Insert) module http://drupal.org/sandbox/dimsh/1724184.
git clone --recursive --branch 6.x-1.x http://git.drupal.org/sandbox/dimsh/1724184.git jcss_insert- For Drupal 6
Description:
The module is for D6 and allows for the inclusion of JavaScript and CSS styles defined using the admin interface without modifying a particular theme or module .js/.css files on the file-system, JS and CSS snippets are defined using rules, each rule has a title and corresponding code according to its type along with other options to control its loading behavior.
The main purpose for developing it was to allow site builders to add quick CSS for positioning the output of Views and Panels, since those two modules accepts custom CSS-classes to their output, a need has raised for me to modify their output displacement instantly and quickly, then aggregate the created CSS into the theme when finished building the site. The JavaScript part of the module is an added value to solve a missing feature in a similar module (see next).
The module can optionally override JavaScript and Stylesheets of the current theme, this is the main point for it to be useful in theming Views and Panel panes.
Similar modules are CSS Injector and JS injector, they both (for Drupal 6 version of them):
- Do not provide the option to override theme Styles or JavaScript.
- No quick edit feature.
- Don't store the JS or CSS code into the database.
- CSS Injector does not support RTL Stylesheets.
- Have no clean API for inserting a rule.
- Have no weighted rules and no option to disable a rule.
Beside, this module support RTL Styles loaded using Drupals' default override work model along with standalone RTL mode wich - if selected for a rule - will not load the normal LTR CSS code for RTL pages (and will not load the CSS-RTL code for non-RTL pages).
Finally, the code for CSS/JS rules may optionally be passed into PHP parser and the output of the code eval()-uation will be the actual CSS or JS code to load, this option makes the module more powerful and less appropriate for non-developers who may mistakenly grant the permissions.
Alike CSS Injector this module allow for visibility (or activation/deactivation) of rules based on the current path, borrowed from core block module, rules can be active or inactive for paths/path-wildcards (or PHP code).
The module comes with permissions:
- 'administer jcss insert': for generally allow the addition/editing of rules.
- 'use PHP for rule visibility': for allowing the visibility of rules based on the output of a PHP eval() (in contrary to 'use PHP for block visibility').
- 'use PHP evaluate for rule code': to allow the editor or creator to mark the JS/CSS code as needs parsing by PHP before inclusion (a rule set as PHP-evaluated rule and being modified by an editor who doesn't have this permission will automatically unset the PHP-evaluation option).
The last two permissions are useless without the first one.
Comments
Comment #1
D4Ko commentedYou can find the results of the automated report at http://ventral.org/pareview/httpgitdrupalorgsandboxdimsh1724184git
Comment #2
dimsh commentedI have fixed most of the issues in the report, as reported there are false positives which are kept as is, mostly the ones related to the use of drupal_eval() which were reported as critical, the module depends on that function in some of its operations, those parts are protected using the permission system.
Comment #3
groupdocs commentedThere are few issues from manual review:
1) Variables used in the .module file must be uninstalled in .install file.
2) Why not to use drupal_get_path http://api.drupal.org/api/drupal/includes!common.inc/function/drupal_get... ?
3) What is this for? This will not output anything?
Comment #4
klausiClosing due to lack of activity. Feel free to reopen if you are still working on this application.