| 22 |
return $items; |
return $items; |
| 23 |
} |
} |
| 24 |
|
|
|
function yui_button_init() { |
|
|
// Thank you block.module :) |
|
|
$path = drupal_get_path_alias($_GET['q']); |
|
|
$regexp = '/^('. preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\<front\\\\>($|\|)/'), array('|', '.*', '\1'. preg_quote(variable_get('site_frontpage', 'node'), '/') .'\2'), preg_quote(variable_get("yui_button_include", ''), '/')) .')$/'; |
|
|
|
|
|
$yui_include = variable_get("yui_button_include", ""); |
|
|
if(preg_match($regexp, $path) or empty($yui_include)) { |
|
|
;//render_button(); |
|
|
} |
|
|
} |
|
|
|
|
| 25 |
function yui_button_form_alter(&$form, $form_state, $form_id) { |
function yui_button_form_alter(&$form, $form_state, $form_id) { |
| 26 |
array_walk($form, '_yui_button_form_alter'); |
array_walk($form, '_yui_button_form_alter'); |
| 27 |
} |
} |
| 28 |
|
|
| 29 |
function _yui_button_form_alter($element, $id) { |
function _yui_button_form_alter($element, $id) { |
| 30 |
if (is_array($element)) { |
if (is_array($element)) { |
| 31 |
array_walk($element, '_yui_button_form_alter'); |
array_walk($element, '_yui_button_form_alter'); |
| 32 |
} |
switch ($element['#type']) { |
| 33 |
switch ($element['#type']) { |
case 'button': |
| 34 |
case 'button': |
render_button($id); |
| 35 |
render_button($id); |
break; |
| 36 |
break; |
case 'submit': |
| 37 |
case 'submit': |
render_button($id, 'submit'); |
| 38 |
render_button($id); |
break; |
| 39 |
break; |
case 'checkbox': |
| 40 |
case 'checkbox': |
render_button($id, 'checkbox'); |
| 41 |
render_button($id, 'checkbox'); |
break; |
| 42 |
break; |
case 'radio': |
| 43 |
case 'radio': |
render_button($id, 'radio'); |
| 44 |
render_button($id, 'radio'); |
break; |
| 45 |
break; |
case 'radios': |
| 46 |
case 'radios': |
render_button($id, 'radios'); |
| 47 |
render_button($id, 'radios'); |
break; |
| 48 |
break; |
case 'select': |
| 49 |
case 'select': |
case 'weight': |
| 50 |
case 'weight': |
render_button('menu-' . $id, 'menu'); |
| 51 |
render_button('menu-' . $id, 'menu'); |
break; |
| 52 |
break; |
} |
| 53 |
} |
} |
| 54 |
} |
} |
| 55 |
|
|
| 81 |
|
|
| 82 |
static $radios; |
static $radios; |
| 83 |
|
|
| 84 |
|
$yui_source = variable_get('yui_source','http://yui.yahooapis.com/2.5.2'); |
| 85 |
yui_add_css('button', $yui_source, '/build/fonts/fonts-min.css'); |
yui_add_css('button', $yui_source, '/build/fonts/fonts-min.css'); |
| 86 |
yui_add_css('button', $yui_source, '/build/button/assets/skins/sam/button.css'); |
yui_add_css('button', $yui_source, '/build/button/assets/skins/sam/button.css'); |
| 87 |
yui_add_css('button', $yui_source, '/build/button/assets/skins/sam/menu.css'); |
yui_add_css('button', $yui_source, '/build/button/assets/skins/sam/menu.css'); |