Basic dictionaries page, need to pretty it up still.

Include install.js in the header, because we need it pretty much everywhere.
This commit is contained in:
shaver%mozilla.org 2006-10-22 08:42:45 +00:00
parent 28616002f4
commit 05869dc9bb
4 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,24 @@
<?php
/**
* Dictionaries page.
*
* @package amo
* @subpackage docs
*/
startProcessing('dictionaries.tpl', 'dictionaries', $compileId, 'rustico');
require_once('includes.php');
setApp();
$amo = new AMO_Object();
$dicts = $amo->getDictionaries();
// Assign template variables.
$tpl->assign(
array( 'dicts' => $dicts,
'content' => 'dictionaries.tpl',
'currentTab' => 'dictionaries')
);
?>

View File

@ -0,0 +1,12 @@
<script src="https://www.stage.mozilla.com/js/download.js"></script>
<div id="mBody">
<h1>Dictionaries</h1>
<p>These dictionaries are available for use with Firefox's built-in spell-checking.</p>
<ul>
{section name=d loop=$dicts step=1 start=0}
<li><a href="{$dicts[d].uri}">{$dicts[d].code}</a></li>
{/section}
</ul>

View File

@ -15,6 +15,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>{$app|capitalize} Add-ons | Mozilla Corporation</title>
<link rel="stylesheet" type="text/css" href="/css/rustico/addons-rustico.css" media="screen">
<script src="{$config.webpath}/js/install.js" type="text/javascript"></script>
</head>
<body id="mozilla-com">

View File

@ -504,6 +504,38 @@ class AMO_Object
return $this->db->record;
}
/**
* Get all dictionaries.
*
* @return array
*/
function getDictionaries() {
$suffix = "@dictionaries.addons.mozilla.org";
$this->db->query("
SELECT
REPLACE(m.guid, '{$suffix}', '') as code,
v.uri
FROM
main m
INNER JOIN version v ON m.id = v.id
INNER JOIN (
SELECT v.id, v.appid, v.osid, max(v.vid) as mxvid
FROM version v
WHERE approved = 'YES' group by v.id, v.appid, v.osid) as vv
ON vv.mxvid = v.vid AND vv.id = v.id
WHERE
approved = 'YES' AND
m.guid LIKE '%{$suffix}'
GROUP BY
m.id
ORDER BY
code
", SQL_ALL, SQL_ASSOC);
return $this->db->record;
}
/**
* Get feature details for specified addons.
*