Skip to content

Instantly share code, notes, and snippets.

@justinm
Forked from justinpeterman/ad_dialogs.tpl.php
Created September 8, 2011 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinm/1202740 to your computer and use it in GitHub Desktop.
Save justinm/1202740 to your computer and use it in GitHub Desktop.
global scope variable
<?php
if(!empty($social_dialog)): //Step 4: Ok, was anything generated during that pages/element loop?
echo $social_dialog; //print out the html string generated if so...
endif;
?>
<?php
function createSharingDialog($services) //Step 2: Build the dialog and save it to a var for later use
{
$social_dialog = "<div data-role='dialog' id='share_dialog'>";
$social_dialog .= "<div data-role='header'><h2>Share</h2></div>";
$social_dialog .= "<div data-role='content'>";
foreach($services as $item):
$social_dialog .= buildSharingLink($item);
endforeach;
$social_dialog .= "</div>";
$social_dialog .= "</div>";
return $social_dialog;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment