diff -u b/includes/scald.admin.inc b/includes/scald.admin.inc --- b/includes/scald.admin.inc +++ b/includes/scald.admin.inc @@ -19,17 +19,19 @@ */ function scald_admin_dashboard() { $types = scald_types(); + $content = ''; $message = '

' . t('This is the Scald administration dashboard. It allows to manage Atom Types (entity bundles) and Representation Contexts (entity view modes). In each context, it is possible to choose which transcoder (for Image atoms, it is image style) is used and how atom is rendered using different players. The context settings is for the atom itself, while "manage display" is to controlled how are fields displayed. If you are strange to the terminology, please read the short README.txt or the long documentation pages.', array('@readme' => 'http://drupalcode.org/project/scald.git/blob/refs/heads/7.x-1.x:/README.txt', '@doc' => 'https://drupal.org/node/1652740')) . '

'; drupal_set_message($message); // Tell the user he can switch to a new export with feature. if (!variable_get('scald_switch_feature_export', FALSE)) { - $message = '

' . t('You can now export your contexts with feature. This will break existing exports and you will have to review your existing features containing scald contexts. Activate feature export', array('@doc' => url('admin/structure/scald/switch-to-feature'))) . '

'; - drupal_set_message($message); + $content .= '

' . t('Scald Feature Export') . '

'; + $switch_form = drupal_get_form('scald_switch_to_feature_form'); + $content .= drupal_render($switch_form); } - $content = '

' . t('Scald Unified Atom Types') . '

'; + $content .= '

' . t('Scald Unified Atom Types') . '

'; $content .= '

' . t('List of Scald Unified Atom Types. Each type is an entity bundle and has different fields, displays and contexts. Multiple providers (e.g. local image provider, Flickr provider) can provide atoms of the same type and share the same transcoders, players.') . '

'; $list = array('type' => 'ul', 'items' => array()); @@ -104,17 +106,4 @@ /** - * Switch export to features instead of CTools. - */ -function scald_admin_switch_export() { - variable_set('scald_switch_feature_export', TRUE); - cache_clear_all(); - - $message = '

' . t('You are now using the new feature export. Please make sure you checked and recreated involved features.') . '

'; - drupal_set_message($message, 'warning'); - - drupal_goto('admin/structure/scald'); -} - -/** * Form for admin settings for Scald Types. */ @@ -743,0 +733,32 @@ + +/** + * Switch to feature form. + */ +function scald_switch_to_feature_form() { + $form = array(); + + $form['text'] = array( + '#markup' => '

' . t('You can now export your contexts with feature. This will break existing exports and you will have to review your existing features containing scald contexts.') . '

', + ); + + $form['submit'] = array( + '#type' => 'submit', + '#value' => t('Switch to features') + ); + + return $form; +} + + +/** + * Switch to feature form submission. + */ +function scald_switch_to_feature_form_submit($form, &$form_state) { + variable_set('scald_switch_feature_export', TRUE); + cache_clear_all(); + + $message = '

' . t('You are now using the new feature export. Please make sure you checked and recreated involved features.') . '

'; + drupal_set_message($message, 'warning'); + + $form_state['redirect'] = 'admin/structure/scald'; +} \ Pas de fin de ligne à la fin du fichier diff -u b/scald.install b/scald.install --- b/scald.install +++ b/scald.install @@ -254,9 +254,9 @@ // Get Scald hooks to run earlier than other modules. db_query("UPDATE {system} SET weight = -50 WHERE name = 'scald'"); - // By default, the context export will be handled by CTools - // to ensure backward compatibility unless wanted. - variable_set('scald_switch_feature_export', FALSE); + // By default, the context export will be handled by features. + // But not for existing installs where CTools old export may be used. + variable_set('scald_switch_feature_export', TRUE); } /** diff -u b/scald.module b/scald.module --- b/scald.module +++ b/scald.module @@ -1903,15 +1903,6 @@ 'file' => 'includes/scald.admin.inc', 'type' => MENU_NORMAL_ITEM, ); - $items['admin/structure/scald/switch-to-feature'] = array( - 'title' => 'Scald switch export type', - 'description' => 'Switch from old CTools export to the new one with features.', - 'page callback' => 'scald_admin_switch_export', - 'access callback' => 'user_access', - 'access arguments' => array('administer scald'), - 'file' => 'includes/scald.admin.inc', - 'type' => MENU_CALLBACK, - ); $items['admin/structure/scald/context/add'] = array( 'title' => 'Add Scald context', 'page callback' => 'drupal_get_form',