mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-02 07:05:24 +00:00
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:
parent
28616002f4
commit
05869dc9bb
24
webtools/addons/public/htdocs/dictionaries.php
Normal file
24
webtools/addons/public/htdocs/dictionaries.php
Normal 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')
|
||||
);
|
||||
?>
|
12
webtools/addons/public/tpl/dictionaries.tpl
Normal file
12
webtools/addons/public/tpl/dictionaries.tpl
Normal 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>
|
@ -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">
|
||||
|
@ -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.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user