Révision c304a780
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/ctools/plugins/contexts/node.inc | ||
---|---|---|
2 | 2 |
|
3 | 3 |
/** |
4 | 4 |
* @file |
5 |
* |
|
6 | 5 |
* Plugin to provide a node context. A node context is a node wrapped in a |
7 | 6 |
* context object that can be utilized by anything that accepts contexts. |
8 | 7 |
*/ |
... | ... | |
106 | 105 |
* Validate a node. |
107 | 106 |
*/ |
108 | 107 |
function ctools_context_node_settings_form_validate($form, &$form_state) { |
109 |
// Validate the autocomplete |
|
108 |
// Validate the autocomplete.
|
|
110 | 109 |
if (empty($form_state['values']['nid']) && empty($form_state['values']['node'])) { |
111 | 110 |
form_error($form['node'], t('You must select a node.')); |
112 | 111 |
return; |
... | ... | |
133 | 132 |
$node = db_query('SELECT nid, status FROM {node} WHERE LOWER(title) = LOWER(:title)', array(':title' => $nid))->fetchObject(); |
134 | 133 |
} |
135 | 134 |
|
136 |
// Do not allow unpublished nodes to be selected by unprivileged users |
|
135 |
// Do not allow unpublished nodes to be selected by unprivileged users.
|
|
137 | 136 |
if (!$node || (empty($node->status) && !(user_access('administer nodes')))) { |
138 | 137 |
form_error($form['node'], t('Invalid node selected.')); |
139 | 138 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules