| 1 |
<?php |
<?php |
| 2 |
// $Id: jq.admin.inc,v 1.2.2.2 2008/05/04 19:06:16 aaron Exp $ |
// $Id: jq.admin.inc,v 1.2.2.3 2008/10/01 01:27:33 aaron Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* The administration form. Allows an administrator to turn off specific plugins |
* The administration form. Allows an administrator to turn off specific plugins |
| 77 |
function _jq_plugins($display_errors = FALSE, $log_errors = TRUE) { |
function _jq_plugins($display_errors = FALSE, $log_errors = TRUE) { |
| 78 |
$plugins = array(); |
$plugins = array(); |
| 79 |
|
|
| 80 |
// Scan the '/plugins' and '/sites/example.com/files/plugins' directories for .js and .css files. |
// Scan the '/plugins' and '/sites/example.com/plugins' directories for .js and .css files. |
| 81 |
// If there are multiple plugins with the same filename in the directory, the LAST file read will be used. |
// If there are multiple plugins with the same filename in the directory, the LAST file read will be used. |
| 82 |
$files = drupal_system_listing('(\.js$|\.css$)', 'plugins', 'basename', 0); |
$files = drupal_system_listing('(\.js$|\.css$)', 'plugins', 'basename', 0); |
| 83 |
foreach ($files as $file) { |
foreach ($files as $file) { |
| 84 |
$plugins[$file->name] = array( |
$plugins[$file->name]['name'] = $file->name; |
| 85 |
'name' => $file->name, |
$plugins[$file->name]['plugin'] = $file->name; |
| 86 |
'plugin' => $file->name, |
if (substr($file->filename, strripos($file->filename, '.') + 1) == 'js') { |
| 87 |
); |
$plugins[$file->name]['files']['js'][] = $file->filename; |
|
if (substr($filename, -1 * strripos($filename, '.')) == 'js') { |
|
|
$plugins[$file->name]['files']['js'] = $file->filename; |
|
| 88 |
} |
} |
| 89 |
else { |
else { |
| 90 |
$plugins[$file->name]['files']['css'] = $file->filename; |
$plugins[$file->name]['files']['css'][] = $file->filename; |
| 91 |
} |
} |
| 92 |
} |
} |
| 93 |
|
|