Commit b8c67eac authored by frjo's avatar frjo
Browse files

Issue #1563732 by Stakcreativa: Make it possibel to deactivate or activate...

Issue #1563732 by Stakcreativa: Make it possibel to deactivate or activate Colorbox on specific pages.
parent 6579280c
......@@ -314,11 +314,17 @@ function colorbox_admin_settings() {
),
),
);
$form['colorbox_advanced_settings']['colorbox_visibility'] = array(
'#type' => 'radios',
'#title' => t('Show Colorbox on specific pages'),
'#options' => array(0 => t('All pages except those listed'), 1 => t('Only the listed pages')),
'#default_value' => variable_get('colorbox_visibility', 0),
);
$form['colorbox_advanced_settings']['colorbox_pages'] = array(
'#type' => 'textarea',
'#title' => t('Deactivate Colorbox on specific pages'),
'#title' => '<span class="element-invisible">' . t('Pages') . '</span>',
'#default_value' => variable_get('colorbox_pages', "admin*\nimg_assist*\nimce*\nnode/add/*\nnode/*/edit\nprint/*\nprintpdf/*"),
'#description' => t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>')),
'#description' => t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>')),
);
return system_settings_form($form);
......
......@@ -159,8 +159,9 @@ function _colorbox_active() {
if ($path != $_GET['q']) {
$page_match = $page_match || drupal_match_path($_GET['q'], $colorbox_pages);
}
$page_match = variable_get('colorbox_visibility', 0) == 0 ? !$page_match : $page_match;
return !$page_match;
return $page_match;
}
/**
......
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