Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

improve tep_draw_button()

  • Loading branch information...
commit 3468522144cab060f7ec058fbe793942f46bb641 1 parent 15601d2
@haraldpdl haraldpdl authored
View
14 catalog/admin/includes/functions/html_output.php
@@ -378,18 +378,28 @@ function tep_draw_button($title = null, $icon = null, $link = null, $priority =
$button .= '>' . $title . '</button><script>$("#tdb' . $button_counter . '").button(';
+ $args = array();
+
if ( isset($icon) ) {
if ( !isset($params['iconpos']) ) {
$params['iconpos'] = 'left';
}
if ( $params['iconpos'] == 'left' ) {
- $button .= '{icons:{primary:"ui-icon-' . $icon . '"}}';
+ $args[] = 'icons:{primary:"ui-icon-' . $icon . '"}';
} else {
- $button .= '{icons:{secondary:"ui-icon-' . $icon . '"}}';
+ $args[] = 'icons:{secondary:"ui-icon-' . $icon . '"}';
}
}
+ if (empty($title)) {
+ $args[] = 'text:false';
+ }
+
+ if (!empty($args)) {
+ $button .= '{' . implode(',', $args) . '}';
+ }
+
$button .= ').addClass("ui-priority-' . $priority . '");</script>';
$button_counter++;
View
14 catalog/includes/functions/html_output.php
@@ -373,18 +373,28 @@ function tep_draw_button($title = null, $icon = null, $link = null, $priority =
$button .= '>' . $title . '</button><script>$("#tdb' . $button_counter . '").button(';
+ $args = array();
+
if ( isset($icon) ) {
if ( !isset($params['iconpos']) ) {
$params['iconpos'] = 'left';
}
if ( $params['iconpos'] == 'left' ) {
- $button .= '{icons:{primary:"ui-icon-' . $icon . '"}}';
+ $args[] = 'icons:{primary:"ui-icon-' . $icon . '"}';
} else {
- $button .= '{icons:{secondary:"ui-icon-' . $icon . '"}}';
+ $args[] = 'icons:{secondary:"ui-icon-' . $icon . '"}';
}
}
+ if (empty($title)) {
+ $args[] = 'text:false';
+ }
+
+ if (!empty($args)) {
+ $button .= '{' . implode(',', $args) . '}';
+ }
+
$button .= ').addClass("ui-priority-' . $priority . '");</script>';
$button_counter++;
Please sign in to comment.
Something went wrong with that request. Please try again.