public static function ShareaholicPublic::canvas in Share Buttons, Related Posts, Content Analytics - Shareaholic 7.3
Same name and namespace in other branches
- 8 public.php \ShareaholicPublic::canvas()
Draws an individual canvas given a specific location id and app
Parameters
string $id the location id for configuration:
string $app the type of app:
string $id_name location id name for configuration:
string $title the title of URL:
string $link url:
string $summary summary text for URL:
1 call to ShareaholicPublic::canvas()
- ShareaholicPublic::draw_canvases in ./
public.php - This static function inserts the shareaholic canvas in a node
File
- ./
public.php, line 352
Class
- ShareaholicPublic
- This class is all about drawing the stuff in publishers' templates that visitors can see.
Code
public static function canvas($id, $app, $id_name = NULL, $title = NULL, $link = NULL, $summary = NULL) {
$title = trim(htmlspecialchars($title, ENT_QUOTES));
$link = trim($link);
$summary = trim(htmlspecialchars(strip_tags($summary), ENT_QUOTES));
$canvas = "<div class='shareaholic-canvas'\n data-app-id='{$id}'\n data-app-id-name='{$id_name}'\n data-app='{$app}'\n data-title='{$title}'\n data-link='{$link}'\n data-summary='{$summary}'></div>";
return trim(preg_replace('/\\s+/', ' ', $canvas));
}