|
From: Jon O. <jon...@us...> - 2008-04-27 18:43:43
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12530 Modified Files: Tag: core28x mx_functions_style.php Log Message: New style buttons... Index: mx_functions_style.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_style.php,v retrieving revision 1.17.2.24 retrieving revision 1.17.2.25 diff -C2 -d -r1.17.2.24 -r1.17.2.25 *** mx_functions_style.php 11 Mar 2008 19:58:29 -0000 1.17.2.24 --- mx_functions_style.php 27 Apr 2008 18:43:36 -0000 1.17.2.25 *************** *** 1040,1043 **** --- 1040,1120 ---- } + /** + * Create buttons. + * + * You can create code for buttons: + * 1) Simple textlinks (MX_BUTTON_TEXT) + * 2) Standard image links (MX_BUTTON_IMAGE) + * 3) Generic buttons, with spanning text on top background image (MX_BUTTON_GENERIC) + * + * Note: The rollover feature is done using a css shift technique, so you do not need separate images + * + * @param unknown_type $type + * @param unknown_type $label + * @param unknown_type $url + * @param unknown_type $img + */ + function create_button($key, $label, $url) + { + global $images; + + switch($images['buttontype'][$key]) + { + case MX_BUTTON_TEXT: + return '<a class="textbutton" href="'. $url .'"><span>' . $label . '</span></a>'; + break; + + case MX_BUTTON_IMAGE: + return '<a class="imagebutton" href="'. $url .'"><img src = "' . $images[$key] . '" alt="' . $label . '" title="' . $label . '" border="0"></a>'; + break; + + case MX_BUTTON_GENERIC: + return '<a class="genericbutton" href="'. $url .'"><span>' . $label . '</span></a>'; + break; + + default: + return '<a class="imagebutton" href="'. $url .'"><img src = "' . $images[$key] . '" alt="' . $label . '" title="' . $label . '" border="0"></a>'; + break; + } + } + + /** + * Create icons. + * + * You can create code for icons: + * 1) Simple textlinks (MX_BUTTON_TEXT) + * 2) Standard image links (MX_BUTTON_IMAGE) + * 3) Generic buttons, with spanning text on top background image (MX_BUTTON_GENERIC) + * + * Note: The rollover feature is done using a css shift technique, so you do not need separate images + * + * @param unknown_type $type + * @param unknown_type $label + * @param unknown_type $url + * @param unknown_type $img + */ + function create_icon($key, $label, $url) + { + global $images; + + switch($images['buttontype'][$key]) + { + case MX_BUTTON_TEXT: + return '<a class="textbutton" href="'. $url .'"><span>' . $label . '</span></a>'; + break; + + case MX_BUTTON_IMAGE: + return '<a class="imagebutton" href="'. $url .'"><img src = "' . $images[$key] . '" alt="' . $label . '" title="' . $label . '" border="0"></a>'; + break; + + case MX_BUTTON_GENERIC: + return '<a class="genericbutton" href="'. $url .'"><span>' . $label . '</span></a>'; + break; + + default: + return '<a class="imagebutton" href="'. $url .'"><img src = "' . $images[$key] . '" alt="' . $label . '" title="' . $label . '" border="0"></a>'; + break; + } + } } // class mx_user ?> \ No newline at end of file |