function content_theme_admin_content_node_submit in Content Theme 6
Same name and namespace in other branches
- 7.2 content_theme.admin.inc \content_theme_admin_content_node_submit()
- 7 content_theme.admin.inc \content_theme_admin_content_node_submit()
File
- ./
content_theme.admin.inc, line 135 - Admin page callbacks for the content_theme module.
Code
function content_theme_admin_content_node_submit($form, &$form_state) {
$edit_theme = $form_state['values']['content_theme_edit'];
$view_theme = $form_state['values']['content_theme_view'];
foreach ($form_state['values']['nodes_select'] as $node) {
if (!empty($node)) {
db_query('DELETE FROM {content_theme_node} WHERE nid = %d', $node);
if ($edit_theme != '-content_type-') {
db_query('INSERT INTO {content_theme_node} (nid, action, theme) VALUES (%d, "edit", "%s")', $node, $edit_theme);
}
if ($view_theme != '-content_type-') {
db_query('INSERT INTO {content_theme_node} (nid, action, theme) VALUES (%d, "view", "%s")', $node, $view_theme);
}
}
}
drupal_set_message(t('The themes have been updated.'));
cache_clear_all();
}