diff options
Diffstat (limited to 'site/app/views/facebook/share.thtml')
-rw-r--r-- | site/app/views/facebook/share.thtml | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/site/app/views/facebook/share.thtml b/site/app/views/facebook/share.thtml new file mode 100644 index 0000000..fe02f32 --- /dev/null +++ b/site/app/views/facebook/share.thtml @@ -0,0 +1,70 @@ +<?php +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is addons.mozilla.org site. + * + * The Initial Developer of the Original Code is + * The Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2007 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Justin Scott <fligtar@mozilla.com> (Original Author) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +if ($action == 'form') { + echo '<input type="hidden" name="url" value="'.SITE_URL.'/facebook/share/submit">'; + + if (!empty($favorites)) { + echo 'Select a favorite add-on to share: '; + echo '<select name="addon_id">'; + foreach ($favorites as $favorite) { + echo '<option value="'.$favorite['addons']['id'].'">'.$favorite['translations']['name'].'</option>'; + } + echo '</select>'; + } + else { + echo 'You do not have any favorite add-ons to share with this user. <a href="'.FB_URL.'?ref=attach">Why not add some?</a>'; + } +} +elseif ($action == 'submit') { + if (empty($error)) { + if ($addon['previewCount'] > 0) { + echo '<fb:wall-attachment-img src="'.FB_IMAGE_SITE.'/images/addon_preview/'.$addon['Addon']['id'].'/1" />'; + echo '<a href="'.FB_URL.'/view/'.$addon['Addon']['id'].'?ref=attach"><img src="'.FB_IMAGE_SITE.'/images/addon_preview/'.$addon['Addon']['id'].'/1" align="right" border="0" width="100"></a>'; + } + else { + echo '<fb:wall-attachment-img src="'.FB_IMAGE_SITE.'/img/facebook/no-preview-thumb.png" />'; + } + echo '<h2><a href="'.FB_URL.'/view/'.$addon['Addon']['id'].'?ref=attach">'.$addon['Translation']['name']['string'].'</a></h2>'; + echo $addon['Translation']['summary']['string']; + } + else { + echo $error; + } +} +?>
\ No newline at end of file |