Index: wysiwyg.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg.info,v retrieving revision 1.1 diff -u -p -r1.1 wysiwyg.info --- wysiwyg.info 14 Oct 2008 21:45:07 -0000 1.1 +++ wysiwyg.info 1 Jun 2009 18:19:06 -0000 @@ -2,4 +2,5 @@ name = Wysiwyg description = Allows users to edit contents with client-side editors. package = User interface +dependencies[] = libraries core = 6.x Index: wysiwyg.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg.module,v retrieving revision 1.29 diff -u -p -r1.29 wysiwyg.module --- wysiwyg.module 18 May 2009 01:08:13 -0000 1.29 +++ wysiwyg.module 1 Jun 2009 18:28:39 -0000 @@ -632,8 +632,8 @@ function wysiwyg_get_all_editors() { 'title' => '', 'vendor url' => '', 'download url' => '', - 'editor path' => wysiwyg_get_path($editors[$editor]['name']), - 'library path' => wysiwyg_get_path($editors[$editor]['name']), + 'editor path' => module_invoke('libraries', 'get_path', $editors[$editor]['name']), + 'library path' => module_invoke('libraries', 'get_path', $editors[$editor]['name']), 'libraries' => array(), 'version callback' => NULL, 'themes callback' => NULL, @@ -753,104 +753,6 @@ function wysiwyg_load_includes($type = ' } /** - * Helper function to build paths to libraries. - * - * @param $library - * The external library name to return the path for. - * @param $base_path - * Whether to prefix the resulting path with base_path(). - * - * @return - * The path to the specified library. - * - * @ingroup libraries - */ -function wysiwyg_get_path($library, $base_path = FALSE) { - static $libraries; - - if (!isset($libraries)) { - $libraries = wysiwyg_get_libraries(); - } - if (!isset($libraries[$library])) { - // Most often, external libraries can be shared across multiple sites. - return 'sites/all/libraries/' . $library; - } - - $path = ($base_path ? base_path() : ''); - $path .= $libraries[$library]; - - return $path; -} - -/** - * Return an array of library directories. - * - * Returns an array of library directories from the all-sites directory - * (i.e. sites/all/libraries/), the profiles directory, and site-specific - * directory (i.e. sites/somesite/libraries/). The returned array will be keyed - * by the library name. Site-specific libraries are prioritized over libraries - * in the default directories. That is, if a library with the same name appears - * in both the site-wide directory and site-specific directory, only the - * site-specific version will be listed. - * - * @return - * A list of library directories. - * - * @ingroup libraries - */ -function wysiwyg_get_libraries() { - global $profile; - - // When this function is called during Drupal's initial installation process, - // the name of the profile that is about to be installed is stored in the - // global $profile variable. At all other times, the regular system variable - // contains the name of the current profile, and we can call variable_get() - // to determine the profile. - if (!isset($profile)) { - $profile = variable_get('install_profile', 'default'); - } - - $directory = 'libraries'; - $searchdir = array(); - $config = conf_path(); - - // The 'profiles' directory contains pristine collections of modules and - // themes as organized by a distribution. It is pristine in the same way - // that /modules is pristine for core; users should avoid changing anything - // there in favor of sites/all or sites/ directories. - if (file_exists("profiles/$profile/$directory")) { - $searchdir[] = "profiles/$profile/$directory"; - } - - // Always search sites/all/*. - $searchdir[] = 'sites/all/'. $directory; - - // Also search sites//*. - if (file_exists("$config/$directory")) { - $searchdir[] = "$config/$directory"; - } - - // Retrieve list of directories. - // @todo Core: Allow to scan for directories. - $directories = array(); - $nomask = array('CVS'); - foreach ($searchdir as $dir) { - if (is_dir($dir) && $handle = opendir($dir)) { - while (FALSE !== ($file = readdir($handle))) { - if (!in_array($file, $nomask) && $file[0] != '.') { - if (is_dir("$dir/$file")) { - $directories[$file] = "$dir/$file"; - } - } - } - closedir($handle); - } - } - - return $directories; -} - -/** * Return a list of directories by modules implementing wysiwyg_include_directory(). * * @param $plugintype Index: editors/jwysiwyg.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/editors/jwysiwyg.inc,v retrieving revision 1.3 diff -u -p -r1.3 jwysiwyg.inc --- editors/jwysiwyg.inc 18 May 2009 01:08:13 -0000 1.3 +++ editors/jwysiwyg.inc 1 Jun 2009 18:28:55 -0000 @@ -23,7 +23,7 @@ function wysiwyg_jwysiwyg_editor() { ), 'version callback' => 'wysiwyg_jwysiwyg_version', // @todo Wrong property; add separate properties for editor requisites. - 'css path' => wysiwyg_get_path('jwysiwyg'), + 'css path' => module_invoke('libraries', 'get_path', 'jwysiwyg'), 'versions' => array( '0.5' => array( 'js files' => array('jwysiwyg.js'), Index: editors/markitup.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/editors/markitup.inc,v retrieving revision 1.3 diff -u -p -r1.3 markitup.inc --- editors/markitup.inc 18 May 2009 01:08:13 -0000 1.3 +++ editors/markitup.inc 1 Jun 2009 18:29:01 -0000 @@ -16,7 +16,7 @@ function wysiwyg_markitup_editor() { 'title' => 'markItUp', 'vendor url' => 'http://markitup.jaysalvat.com', 'download url' => 'http://markitup.jaysalvat.com/downloads', - 'library path' => wysiwyg_get_path('markitup') . '/markitup', + 'library path' => module_invoke('libraries', 'get_path', 'markitup') . '/markitup', 'libraries' => array( '' => array( 'title' => 'Source', Index: editors/tinymce.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/editors/tinymce.inc,v retrieving revision 1.31 diff -u -p -r1.31 tinymce.inc --- editors/tinymce.inc 19 May 2009 15:29:11 -0000 1.31 +++ editors/tinymce.inc 1 Jun 2009 18:29:09 -0000 @@ -17,7 +17,7 @@ function wysiwyg_tinymce_editor() { 'title' => 'TinyMCE', 'vendor url' => 'http://tinymce.moxiecode.com', 'download url' => 'http://tinymce.moxiecode.com/download.php', - 'library path' => wysiwyg_get_path('tinymce') . '/jscripts/tiny_mce', + 'library path' => module_invoke('libraries', 'get_path', 'tinymce') . '/jscripts/tiny_mce', 'libraries' => array( // We cannot assume that all editors need just one js library. '' => array( // Key may be used in wysiwyg_tinymce_settings() for exec mode. 'title' => 'Minified', Index: editors/yui.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/editors/yui.inc,v retrieving revision 1.3 diff -u -p -r1.3 yui.inc --- editors/yui.inc 4 Mar 2009 11:27:18 -0000 1.3 +++ editors/yui.inc 1 Jun 2009 18:29:23 -0000 @@ -11,7 +11,7 @@ function wysiwyg_yui_editor() { 'title' => 'YUI', 'vendor url' => 'http://developer.yahoo.com/yui/editor/', 'download url' => 'http://developer.yahoo.com/yui/download/', - 'library path' => wysiwyg_get_path('yui') . '/build', + 'library path' => module_invoke('libraries', 'get_path', 'yui') . '/build', 'libraries' => array( 'min' => array( 'title' => 'Minified',