Révision fc3d89c3
Ajouté par Assos Assos il y a plus de 7 ans
drupal7/sites/all/modules/i18n/i18n_select/i18n_select.module | ||
---|---|---|
82 | 82 |
} |
83 | 83 |
|
84 | 84 |
/** |
85 |
* Check current path to enable selection |
|
85 |
* Check current path to enable selection.
|
|
86 | 86 |
* |
87 |
* This works pretty much like block visibility |
|
87 |
* This works pretty much like block visibility.
|
|
88 | 88 |
* |
89 |
* @return boolean
|
|
89 |
* @return bool |
|
90 | 90 |
* TRUE if content selection should be enabled for this page. |
91 | 91 |
*/ |
92 | 92 |
function i18n_select_page() { |
... | ... | |
100 | 100 |
// with different case. Ex: /Page, /page, /PAGE. |
101 | 101 |
$pages = drupal_strtolower($pages); |
102 | 102 |
if ($visibility < I18N_SELECT_PAGE_PHP) { |
103 |
// Convert the Drupal path to lowercase |
|
104 |
$path = drupal_strtolower(drupal_get_path_alias($_GET['q'])); |
|
103 |
// @see views_ajax() |
|
104 |
// @see I18NSelectAdminViewsAjax::testViewsAjaxWithoutSkippingTags() |
|
105 |
$path = isset($_REQUEST['view_path']) ? $_REQUEST['view_path'] : $_GET['q']; |
|
106 |
// Convert the Drupal path to lowercase. |
|
107 |
$path = drupal_strtolower(drupal_get_path_alias($path)); |
|
105 | 108 |
// Compare the lowercase internal and lowercase path alias (if any). |
106 | 109 |
$page_match = drupal_match_path($path, $pages); |
107 | 110 |
if ($path != $_GET['q']) { |
... | ... | |
109 | 112 |
} |
110 | 113 |
// When $visibility has a value of 0 (I18N_SELECT_PAGE_NOTLISTED), |
111 | 114 |
// the block is displayed on all pages except those listed in $pages. |
112 |
// When set to 1 (I18N_SELECT_PAGE_LISTED), it is displayed only on those
|
|
113 |
// pages listed in $pages. |
|
115 |
// When set to 1 (I18N_SELECT_PAGE_LISTED), it is displayed only on |
|
116 |
// those pages listed in $pages.
|
|
114 | 117 |
$mode = !($visibility xor $page_match); |
115 | 118 |
} |
116 | 119 |
elseif (module_exists('php')) { |
... | ... | |
121 | 124 |
} |
122 | 125 |
} |
123 | 126 |
else { |
124 |
// No pages defined, still respect the setting (unlike blocks) |
|
127 |
// No pages defined, still respect the setting (unlike blocks).
|
|
125 | 128 |
$mode = $visibility == I18N_SELECT_PAGE_NOTLISTED; |
126 | 129 |
} |
127 | 130 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules