[development] Two module ideas

Nancy Wichmann nan_wich at bellsouth.net
Fri Dec 18 20:42:57 UTC 2009


Well, if you want to split hairs...
function longer_slogan_form_alter(&$form, &$form_state, $form_id) {
  switch ($form_id) {
    case 'system_site_information_settings':
      $form['site_slogan']['#type'] = 'textarea';
      $form['site_slogan']['#rows'] = 1;
      $form['site_slogan']['#maxlength'] = 256;
      break;
  }
  return $form;
}

function longer_slogan_uninstall() {
  $slogan = variable_get('site_slogan', '');
  if (drupal_strlen($slogan) > 128) {
    drupal_set_message(t('The current slogan exceeds the default maximum
length (128). It will continue to work, but the Site Information form will
fail if edited.'), 'error');
  }
}

I would be happy if core just changed the 128 default to 256. And yes, I
will be submitting a patch for D8.

Nancy E. Wichmann, PMP 
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King,
Jr.


-----Original Message-----
From: development-bounces at drupal.org [mailto:development-bounces at drupal.org]
On Behalf Of Daniel F. Kudwien
Sent: Friday, December 18, 2009 2:45 PM
To: development at drupal.org
Subject: Re: [development] Two module ideas

> I totally agree, Dave, that's why I was hoping someone had a module
> it would fit into. Worse case is that I can add it to Util.


function custom_form_system_site_information_settings_alter(&$form) {
  $form['site_slogan']['#type'] = 'textarea';
}

3 lines, actually.

I'd say that this is even too specific for Util.  Luckily, D7 will allow you
to put this code into your theme, so you don't even need a custom.module.

sun

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 9.0.716 / Virus Database: 270.14.112/2571 - Release Date: 12/18/09
02:35:00



More information about the development mailing list