';
return $html;
}
/**
* One button of the bar
*
* @param string $button Button key.
* @param string $url Shared URL.
* @param string $title Shared title.
* @param array $options Plugin options.
* @return string Button HTML.
*/
private static function ayudawp_button( $button, $url, $title, $options ) {
return AyudaWP_AISS_Buttons::ayudawp_get_button_html(
$button,
$url,
$title,
$options,
true,
'icons-only',
'link'
);
}
/**
* The toggle and the panel it opens (v2.8.0)
*
* A native : it opens and closes with no script, is announced as
* an expandable button, and a site whose JS fails keeps every button
* reachable. floating-bar.js only adds closing on Escape and on a click
* outside. The panel opens beside the bar, not below the last button, so
* the bar keeps its height however many buttons are behind it.
*
* Two faces. With buttons in sight it is "More", a + that turns into an x.
* With none ("A single Share button") it is the share icon and the panel
* holds every button.
*
* The summary carries .ayudawp-share-btn to take the size and shape of its
* neighbours from the shared rules; it has no data-url or href, so the
* click and tracking handler in the main script lets it through.
*
* @param array $rest Button keys behind the toggle.
* @param string $position 'left', 'right' or 'bottom'.
* @param string $url Shared URL.
* @param string $title Shared title.
* @param array $options Plugin options.
* @param bool $single Whether the toggle is the only thing in sight.
* @return string HTML.
*/
private static function ayudawp_more_html( $rest, $position, $url, $title, $options, $single = false ) {
$count = count( $rest );
// Columns: a side panel grows sideways before it grows taller than
// the bar; along the bottom one row holds up to six. On phones every
// position is a strip along the bottom, five to a row.
if ( 'bottom' === $position ) {
$columns = min( $count, 6 );
} elseif ( $count <= 4 ) {
$columns = 1;
} elseif ( $count <= 10 ) {
$columns = 2;
} else {
$columns = 3;
}
$columns_phone = min( $count, 5 );
if ( $single ) {
/* translators: %d: number of share buttons inside the panel. */
$label = sprintf( __( 'Share (%d)', 'ai-share-summarize' ), $count );
$icon = AyudaWP_AISS_Icons::ayudawp_get_button_icon( 'web_share', 20 );
} else {
/* translators: %d: number of share buttons inside the "More" panel. */
$label = sprintf( __( 'More (%d)', 'ai-share-summarize' ), $count );
$icon = '';
}
$html = '';
$html .= ''
. $icon
. '';
$html .= '