On our way to user scheme selection

Commit #118868

On a blog note, I added CCK fields to the blog content type for SOC diffs. It was done rather hastily, but you can grab the export here for you to mess with.

We are on our way to allowing users to select their color schemes.

Changes:
    - For the moment the inline color scheme selection has been removed from /user/{uid}/edit. Can be placed back at a later time if wanted (it is in 1.6 of color.module)
    - Fixed bug with color schemer showing on none Color.module themes.
    + Users can now store their theme selections (not creations yet) in the DB. It will insert and edit.
    + New special 'user_scheme' name. Currently stores serialized hexed codes for color schemes. Built to support custom schemes for users.
    + A form validation for when a theme and color scheme is chosen at the same time.

SOC Diff CCK and Contemplate

Tested for use with CCK 1.7 for Drupal 5 and Contemplate 2.02 for Drupal 5

Export of code diff CCK

After some testing, this should work if you select the content type you want to pick. If one isn't available, create one and select it.

 $content[type]  = array (
  'name' => 'Blog entry',
  'type' => 'blog',
  'description' => 'A blog is a regularly updated journal or diary made up of individual posts shown in reversed chronological order. Each member of the site may create and maintain a blog.',
  'title_label' => 'Title',
  'body_label' => 'Body',
  'min_word_count' => '0',
  'help' => '',
  'node_options' =>
  array (
    'status' => true,
    'promote' => true,
    'sticky' => false,
    'revision' => false,
  ),
  'comment' => '0',
  'upload' => '1',
  'old_type' => 'blog',
  'orig_type' => 'blog',
  'module' => 'blog',
  'custom' => '0',
  'modified' => '1',
  'locked' => '1',
  'reset' => 'Reset to defaults',
);
$content[groups]  = array (
  0 =>
  array (
    'label' => 'CVS Diff',
    'settings' =>
    array (
      'form' =>
      array (
        'style' => 'fieldset_collapsible',
        'description' => '',
      ),
      'display' =>
      array (
        'description' => '',
        'teaser' => NULL,
        'full' => NULL,
        'label' => NULL,
      ),
    ),
    'weight' => '3',
    'group_name' => 'group_cvs_diff',
  ),
);
$content[fields]  = array (
  0 =>
  array (
    'widget_type' => 'text',
    'label' => 'URL to CVS',
    'weight' => '-3',
    'rows' => '1',
    'description' => 'Grab your URL to the file in the cvs.drupal.org when viewing a diff (like the one original link below). Cut off just before the ?view. For instance:
<p />
Original: <a href="http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/color_soc08/color.module?view=diff&r1=text&tr1=1.6&r2=text&tr2=1.5&diff_format=h<br />
<p" title="http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/color_soc08/color.module?view=diff&r1=text&tr1=1.6&r2=text&tr2=1.5&diff_format=h<br />
<p">http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/color_soc08...</a> />
So do: <a href="http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/color_soc08/color.module'
,<br />
" title="http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/color_soc08/color.module',<br />
">http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/color_soc08...</a>    'default_value_widget' =>
    array (
      'field_url_to_cvs' =>
      array (
        0 =>
        array (
          'value' => 'http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/color_soc08/color.module',
        ),
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_cvs_diff',
    'required' => '0',
    'multiple' => '0',
    'text_processing' => '0',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_url_to_cvs',
    'field_type' => 'text',
    'module' => 'text',
    'default_value' =>
    array (
      0 =>
      array (
        'value' => 'http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/color_soc08/color.module',
      ),
    ),
  ),
  1 =>
  array (
    'widget_type' => 'number',
    'label' => 'Last revision',
    'weight' => '0',
    'description' => '',
    'default_value_widget' =>
    array (
      'field_last_revision' =>
      array (
        0 =>
        array (
          'value' => '',
        ),
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_cvs_diff',
    'required' => '0',
    'multiple' => '0',
    'min' => '',
    'max' => '',
    'prefix' => '',
    'suffix' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_last_revision',
    'field_type' => 'number_decimal',
    'module' => 'number',
  ),
  2 =>
  array (
    'widget_type' => 'number',
    'label' => 'This revision',
    'weight' => '0',
    'description' => '',
    'default_value_widget' =>
    array (
      'field_this_revision' =>
      array (
        0 =>
        array (
          'value' => '',
        ),
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_cvs_diff',
    'required' => '0',
    'multiple' => '0',
    'min' => '',
    'max' => '',
    'prefix' => '',
    'suffix' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_this_revision',
    'field_type' => 'number_decimal',
    'module' => 'number',
  ),
  3 =>
  array (
    'widget_type' => 'number',
    'label' => 'First Revision',
    'weight' => '10',
    'description' => '',
    'default_value_widget' =>
    array (
      'field_first_revision' =>
      array (
        0 =>
        array (
          'value' => '1.1',
        ),
      ),
    ),
    'default_value_php' => '',
    'group' => 'group_cvs_diff',
    'required' => '0',
    'multiple' => '0',
    'min' => '',
    'max' => '',
    'prefix' => '',
    'suffix' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_first_revision',
    'field_type' => 'number_decimal',
    'module' => 'number',
  ),
);

Contemplate template

For body and teaser on blog content type:

<?php if ($node->field_url_to_cvs[0]['view'] && $node->field_this_revision[0]['view'] && $node->field_last_revision[0]['view'] && $node->field_first_revision[0]['view']) {?>

<div style="clear:both; text-align:center">
<div style="margin: 0px auto; ">
  <div style="background-color: #2C72E7; float: left; width: 125px; padding: .25em; text-align: center; border-top: #0D2041 1px solid; border-bottom: #0D2041 1px solid"><strong>CVS Diff against</strong></div>
 
  <div style="background-color: #3399CC; width: 355px; padding: .25em; border-top: #0D2041 1px solid; border-bottom: #0D2041 1px solid; text-align: center"><a href="<?php print $node->field_url_to_cvs[0]['view'] ?>?view=diff&r1=text&tr1=<?php print $node->field_this_revision[0]['view'] ?>&r2=text&tr2=<?php print $node->field_last_revision[0]['view'] ?>&diff_format=h" style="color: white">last commit</a> | <a href="<?php print $node->field_url_to_cvs[0]['view'] ?>?view=diff&r1=text&tr1=<?php print $node->field_this_revision[0]['view'] ?>&r2=text&tr2=<?php print $node->field_first_revision[0]['view'] ?>&diff_format=h" style="color: white">first commit</a></div>
</div>
</div>
<?php } ?>


<?php print $node->content['body']['#value']; ?>