Commit 55eec8f6 authored by Steven Wittens's avatar Steven Wittens

#79601: module_exist() -> module_exists()

parent e14c3aa6
......@@ -591,7 +591,7 @@ function menu_rebuild() {
_menu_build();
if (module_exist('menu')) {
if (module_exists('menu')) {
$menu = menu_get_menu();
// Fill a queue of new menu items which are modifiable.
......@@ -828,7 +828,7 @@ function theme_menu_local_task($mid, $active, $primary) {
* -active is appended if this element is in the active trail.
*/
function menu_primary_links($start_level = 1, $pid = 0) {
if (!module_exist('menu')) {
if (!module_exists('menu')) {
return NULL;
}
if (!$pid) {
......@@ -1081,7 +1081,7 @@ function _menu_build() {
}
// Now fetch items from the DB, reassigning menu IDs as needed.
if (module_exist('menu')) {
if (module_exists('menu')) {
$result = db_query(db_rewrite_sql('SELECT m.mid, m.* FROM {menu} m ORDER BY m.mid ASC', 'm', 'mid'));
while ($item = db_fetch_object($result)) {
// Handle URL aliases if entered in menu administration.
......
......@@ -136,7 +136,7 @@ function module_rebuild_cache() {
* @return
* TRUE if the module is both installed and enabled.
*/
function module_exist($module) {
function module_exists($module) {
$list = module_list();
return array_key_exists($module, $list);
}
......@@ -181,7 +181,7 @@ function module_enable($module) {
* The name of the module (without the .module extension).
*/
function module_disable($module) {
if (module_exist($module)) {
if (module_exists($module)) {
module_load_install($module);
module_invoke($module, 'disable');
db_query("UPDATE {system} SET status = 0, throttle = 0 WHERE type = 'module' AND name = '%s'", $module);
......
......@@ -244,7 +244,7 @@ function theme_get_settings($key = NULL) {
'toggle_comment_user_picture' => 0,
);
if (module_exist('node')) {
if (module_exists('node')) {
foreach (node_get_types() as $type => $name) {
$defaults['toggle_node_info_' . $type] = 1;
}
......@@ -256,7 +256,7 @@ function theme_get_settings($key = NULL) {
}
// Only offer search box if search.module is enabled.
if (!module_exist('search') || !user_access('search content')) {
if (!module_exists('search') || !user_access('search content')) {
$settings['toggle_search'] = 0;
}
......@@ -600,7 +600,7 @@ function theme_node($node, $teaser = FALSE, $page = FALSE) {
$output = '<div class="node-unpublished">';
}
if (module_exist('taxonomy')) {
if (module_exists('taxonomy')) {
$terms = taxonomy_link('taxonomy terms', $node);
}
......
......@@ -1325,7 +1325,7 @@ function theme_aggregator_feed($feed) {
function theme_aggregator_block_item($item, $feed = 0) {
global $user;
if ($user->uid && module_exist('blog') && user_access('edit own blog')) {
if ($user->uid && module_exists('blog') && user_access('edit own blog')) {
if ($image = theme('image', 'misc/blog.png', t('blog it'), t('blog it'))) {
$output .= '<div class="icon">'. l($image, 'node/add/blog', array('title' => t('Comment on this news item in your personal blog.'), 'class' => 'blog-it'), "iid=$item->iid", NULL, FALSE, TRUE) .'</div>';
}
......
......@@ -221,7 +221,7 @@ function block_admin_display($theme = NULL) {
$blocks = _block_rehash();
usort($blocks, '_block_compare');
$throttle = module_exist('throttle');
$throttle = module_exists('throttle');
$block_regions = system_region_list($theme_key);
// Build form tree
......@@ -295,7 +295,7 @@ function block_admin_display_submit($form_id, $form_values) {
function theme_block_admin_display($form) {
global $theme_key;
$throttle = module_exist('throttle');
$throttle = module_exists('throttle');
$block_regions = system_region_list($theme_key);
// Highlight regions on page to provide visual reference.
......
......@@ -27,7 +27,7 @@ function contact_help($section) {
return t('Enables the use of both personal and site-wide contact forms.');
case 'admin/build/contact':
$output = t('This page lets you setup <a href="@form">your site-wide contact form</a>. To do so, add one or more categories. You can associate different recipients with each category to route e-mails to different people. For example, you can route website feedback to the webmaster and direct product information requests to the sales department. On the <a href="@settings">settings page</a>, you can customize the information shown above the contact form. This can be useful to provide additional contact information such as your postal address and telephone number.', array('@settings' => url('admin/build/contact/settings'), '@form' => url('contact')));
if (!module_exist('menu')) {
if (!module_exists('menu')) {
$menu_note = t('The menu item can be customized and configured only once the menu module has been <a href="@modules-page">enabled</a>.', array('@modules-page' => url('admin/settings/modules')));
}
else {
......
......@@ -851,7 +851,7 @@ function _forum_new($tid) {
* Menu callback; prints a forum listing.
*/
function forum_page($tid = 0) {
if (module_exist('taxonomy') && module_exist('comment')) {
if (module_exists('taxonomy') && module_exists('comment')) {
$forum_per_page = variable_get('forum_per_page', 25);
$sortby = variable_get('forum_order', 1);
......@@ -908,7 +908,7 @@ function theme_forum_display($forums, $topics, $parents, $tid, $sortby, $forum_p
$output = '<div id="forum">';
$output .= '<ul>';
if (module_exist('tracker')) {
if (module_exists('tracker')) {
if ($user->uid) {
$output .= ' <li>'. l(t('My discussions.'), "tracker/$user->uid") .'</li>';
}
......
......@@ -785,10 +785,10 @@ function node_search($op = 'search', $keys = NULL) {
$ranking = array('node_rank_relevance' => t('Keyword relevance'),
'node_rank_recent' => t('Recently posted'));
if (module_exist('comment')) {
if (module_exists('comment')) {
$ranking['node_rank_comments'] = t('Number of comments');
}
if (module_exist('statistics') && variable_get('statistics_count_content_views', 0)) {
if (module_exists('statistics') && variable_get('statistics_count_content_views', 0)) {
$ranking['node_rank_views'] = t('Number of views');
}
......@@ -846,7 +846,7 @@ function node_search($op = 'search', $keys = NULL) {
$join2 .= ' INNER JOIN {node} n ON n.nid = i.sid LEFT JOIN {node_comment_statistics} c ON c.nid = i.sid';
$stats_join = TRUE;
}
if (module_exist('comment') && $weight = (int)variable_get('node_rank_comments', 5)) {
if (module_exists('comment') && $weight = (int)variable_get('node_rank_comments', 5)) {
// Inverse law that maps the highest reply count on the site to 1 and 0 to 0.
$scale = variable_get('node_cron_comments_scale', 0.0);
$ranking[] = '%d * (2.0 - 2.0 / (1.0 + c.comment_count * %f))';
......@@ -856,7 +856,7 @@ function node_search($op = 'search', $keys = NULL) {
$join2 .= ' LEFT JOIN {node_comment_statistics} c ON c.nid = i.sid';
}
}
if (module_exist('statistics') && variable_get('statistics_count_content_views', 0) &&
if (module_exists('statistics') && variable_get('statistics_count_content_views', 0) &&
$weight = (int)variable_get('node_rank_views', 5)) {
// Inverse law that maps the highest view count on the site to 1 and 0 to 0.
$scale = variable_get('node_cron_views_scale', 0.0);
......@@ -1011,7 +1011,7 @@ function node_menu($may_cache) {
$items[] = array('path' => 'admin/content/node/overview', 'title' => t('list'),
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
if (module_exist('search')) {
if (module_exists('search')) {
$items[] = array('path' => 'admin/content/search', 'title' => t('search posts'),
'description' => t('Search posts by keyword.'),
'callback' => 'node_admin_search',
......
......@@ -1233,7 +1233,7 @@ function system_modules() {
/**
* Handle throttle checkboxes, including overriding the generated checkboxes for required modules.
*/
if (module_exist('throttle')) {
if (module_exists('throttle')) {
$form['throttle'] = array('#type' => 'checkboxes', '#default_value' => $throttle, '#options' => $options);
$throttle_required = array_merge($required, array('throttle'));
foreach ($throttle_required as $require) {
......@@ -1253,14 +1253,14 @@ function theme_system_modules($form) {
$row[] = drupal_render($form['description'][$key]);
$row[] = array('data' => drupal_render($form['status'][$key]), 'align' => 'center');
if (module_exist('throttle')) {
if (module_exists('throttle')) {
$row[] = array('data' => drupal_render($form['throttle'][$key]), 'align' => 'center');
}
$rows[] = $row;
}
$header = array(t('Name'), t('Description'), t('Enabled'));
if (module_exist('throttle')) {
if (module_exists('throttle')) {
$header[] = t('Throttle');
}
......@@ -1399,7 +1399,7 @@ function system_theme_settings($key = '') {
$disabled['toggle_node_user_picture'] = TRUE;
$disabled['toggle_comment_user_picture'] = TRUE;
}
if (!module_exist('search')) {
if (!module_exists('search')) {
$disabled['toggle_search'] = TRUE;
}
......
......@@ -20,7 +20,7 @@ function taxonomy_perm() {
* print lists of terms associated with a node. Themes can print taxonomy
* links with:
*
* if (module_exist('taxonomy')) {
* if (module_exists('taxonomy')) {
* $this->links(taxonomy_link('taxonomy terms', $node));
* }
*/
......
......@@ -104,7 +104,7 @@ function tracker_page($uid = 0) {
while ($node = db_fetch_object($result)) {
// Determine the number of comments:
$comments = 0;
if (module_exist('comment') && $node->comment_count) {
if (module_exists('comment') && $node->comment_count) {
$comments = $node->comment_count;
if ($new = comment_num_new($node->nid)) {
......
......@@ -743,7 +743,7 @@ function user_menu($may_cache) {
'callback' => 'drupal_get_form', 'callback arguments' => array('user_admin_access_delete_confirm'),
'access' => $access_access, 'type' => MENU_CALLBACK);
if (module_exist('search')) {
if (module_exists('search')) {
$items[] = array('path' => 'admin/user/search', 'title' => t('search users'),
'description' => t('Search users by name.'),
'callback' => 'user_admin', 'callback arguments' => array('search'), 'access' => $admin_access,
......
......@@ -135,7 +135,7 @@ function chameleon_node($node, $teaser = 0, $page = 0) {
$submitted['node_submitted'] = theme_get_setting("toggle_node_info_$node->type") ? array('#title' => t("By %author at %date", array('%author' => theme('username', $node), '%date' => format_date($node->created, 'small')))) : array();
$terms = array();
if (module_exist('taxonomy')) {
if (module_exists('taxonomy')) {
$terms = taxonomy_link("taxonomy terms", $node);
}
......
......@@ -253,7 +253,7 @@ function phptemplate_page($content) {
* into a pluggable template engine.
*/
function phptemplate_node($node, $teaser = 0, $page = 0) {
if (module_exist('taxonomy')) {
if (module_exists('taxonomy')) {
$taxonomy = taxonomy_link('taxonomy terms', $node);
}
else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment