Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/site/app/views/tutorius_api/publish.thtml
diff options
context:
space:
mode:
Diffstat (limited to 'site/app/views/tutorius_api/publish.thtml')
-rw-r--r--site/app/views/tutorius_api/publish.thtml88
1 files changed, 4 insertions, 84 deletions
diff --git a/site/app/views/tutorius_api/publish.thtml b/site/app/views/tutorius_api/publish.thtml
index e7d3f0d..6eb1e28 100644
--- a/site/app/views/tutorius_api/publish.thtml
+++ b/site/app/views/tutorius_api/publish.thtml
@@ -37,87 +37,7 @@
if (isset($error)) { ?>
<error><?php echo ($error); ?></error>
<?php
-} else { ?>
- <tutorial>
- <?php
- $amo = "http://tutorius.org";
- // Allow some additional content to be injected into the addon element by
- // the including template.
- if (isset($addon_pre)) echo $addon_pre;
- ?>
- <name><?php echo $tutorial['Translation']['name']['string']; ?></name>
- <type id='<?php echo $tutorial['Addon']['addontype_id']; ?>'><?php echo Addontype::getName($tutorial['Addon']['addontype_id']); ?></type>
- <guid><?php echo $tutorial['Addon']['guid']; ?></guid>
- <version><?php echo $tutorial['install_version']; ?></version>
- <status id='<?php echo $tutorial['Addon']['status']; ?>'><?php if ($tutorial['Addon']['status'] == STATUS_PUBLIC) {
- echo rtrim(___('Public', 'a_header_public'));
- } else {
- echo rtrim(___('Sandbox', 'a_header_sandbox'));
- }
- ?></status>
- <authors>
- <?php
- foreach ($tutorial['User'] as $author) {
- $authorName = (!empty($author['nickname'])) ? $author['nickname'] : $author['firstname'].' '.$author['lastname'];
- ?>
- <author><?php echo $authorName; ?></author>
- <?php
- }
- ?> </authors>
- <summary><?php echo $tutorial['Translation']['summary']['string']; ?></summary>
- <description><?php echo $tutorial['Translation']['description']['string']; ?></description>
- <icon><?php if (isset($tutorial['Icon'])) {
- echo $amo.$tutorial['Icon'];
- } else {
- $tutorialIconPath = ($tutorial['Addon']['addontype_id'] == ADDON_THEME ? $html->urlImage(DEFAULT_THEME_ICON) : $html->urlImage(DEFAULT_ADDON_ICON));
- echo $amo.$tutorialIconPath;
- } ?></icon>
- <compatible_applications>
- <?php
- foreach ($tutorial['Compatible_apps'] as $app) {
- $name = $app_names[$app['Application']['application_id']];
- ?>
- <application>
- <name><?php echo $name; ?></name>
- <application_id><?php echo $app['Application']['application_id']; ?></application_id>
- <min_version><?php echo $app['Min_Version']['version']; ?></min_version>
- <max_version><?php echo $app['Max_Version']['version']; ?></max_version>
- <?php
- if ($api_version > 1) { ?>
- <appID><?php echo $guids[$name]; ?></appID>
- <?php } ?>
- </application>
- <?php
- }
- ?> </compatible_applications>
- <eula><?php echo $tutorial['Translation']['eula']['string'];?></eula>
- <thumbnail><?php echo $amo.$tutorial['Thumbnail']; ?></thumbnail>
- <rating><?php
- $rating ='';
- if (isset($tutorial['Addon']['averagerating'])) {
- $rating = $tutorial['Addon']['averagerating'];
- if ($api_version < 1) {
- // we need to double the rating since the addons mgr expects it to
- // be out of 10 and we have halved everything in the db
- $rating *= 2;
- }
- // round rating to match stars in AMO
- $rating = ceil($rating);
- }
- echo $rating;
- ?></rating>
- <learnmore><?php echo $amo.'/addon/'.$tutorial['Addon']['id']; ?>?src=api</learnmore>
- <?php foreach($tutorial['fileinfo'] as $file) { ?>
- <install hash='<?php echo $file['File']['hash'];?>'>
- <?php
- echo $amo.'/downloads/file/'.$file['File']['id'].'/'
- .$file['File']['filename']; ?></install>
-
- <?php }
- // Allow some additional content to be injected into the addon element by
- // the including template.
- if (isset($tutorial_post)) echo $tutorial_post;
- ?>
- </tutorial>
-
-<?php } ?> \ No newline at end of file
+} else {
+ $addon = $tutorial;
+ include 'tutorial_display.thtml';
+} ?> \ No newline at end of file