示例#1
0
<?php

/**
 * Overview provides an inside look at what is going on for an application.
 *
 * @package amo
 * @subpackage docs
 */
$currentTab = 'home';
setApp();
$pageType = $clean['app'] === 'Firefox' ? 'rustico' : 'nonav';
startProcessing('index.tpl', 'home', $compileId, $pageType);
require_once 'includes.php';
$amo = new AMO_Object();
header("Cache-Control: max-age=120, must-revalidate");
// Assign template variables.
$tpl->assign(array('popularExtensions' => $amo->getPopularAddons($sql['app'], 'E', 5), 'feature' => $amo->getFeature($sql['app']), 'currentTab' => $currentTab, 'app' => $sql['app']));
示例#2
0
// Determine our application.
switch ($_app) {
    case 'seamonkey':
    case 'mozilla':
        $clean['app'] = 'Mozilla';
        break;
    case 'thunderbird':
        $clean['app'] = 'Thunderbird';
        break;
    case 'sunbird':
        $clean['app'] = 'Sunbird';
        break;
    case 'firefox':
    default:
        $clean['app'] = 'Firefox';
        break;
}
$amo = new AMO_Object();
// Despite what $clean holds, GUIDs were used in v1 so we have to support them
if (preg_match('/^(\\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\}|[a-z0-9-\\._]*\\@[a-z0-9-\\._]+)$/i', $_app)) {
    $newestThemes = $amo->getNewestAddonsByGuid($_app, 'T', 10);
    $popularThemes = $amo->getPopularAddonsByGuid($_app, 'T', 10);
    /* This is a bit of a cheesy hack because of the way the templates are written.
     * It's looking for the name of the app in $_GET, so here we are...(clouserw)*/
    $_GET['app'] = strtolower($amo->getAppNameFromGuid($_app));
} else {
    $newestThemes = $amo->getNewestAddons($clean['app'], 'T', 10);
    $popularThemes = $amo->getPopularAddons($clean['app'], 'T', 10);
}
// Assign template variables.
$tpl->assign(array('newestThemes' => $newestThemes, 'popularThemes' => $popularThemes, 'title' => 'Add-ons', 'currentTab' => $currentTab, 'content' => 'themes.tpl', 'sidebar' => 'inc/category-sidebar.tpl', 'cats' => $amo->getCats('T'), 'type' => 'T'));
<?php

/**
 * Home page for extensions, switchable on application.
 *
 * @package amo
 * @subpackage docs
 * @todo make this dynamic based on an SQL field (recommended)
 */
startProcessing('recommended.tpl', 'recommended', $compileId, 'rustico');
require_once 'includes.php';
setApp();
$amo = new AMO_Object();
// Assign template variables.
$tpl->assign(array('recommended' => $amo->getRecommendedAddons($sql['app'], 'E', 100), 'content' => 'recommended.tpl', 'currentTab' => 'recommended'));
示例#4
0
<?php

/**
 * Search page.  All searches are filtered through this page.
 *
 * @package amo
 * @subpackage docs
 */
// App.
$clean['app'] = isset($app) ? $app : 'firefox';
$pageType = $clean['app'] == 'firefox' ? 'rustico' : 'nonav';
startProcessing('search.tpl', $memcacheId, $compileId, $pageType);
require_once 'includes.php';
// Instantiate AMO_Object so we can get our categories and platforms.
$amo = new AMO_Object();
$appList = $amo->getApps();
$appSelectList = array();
foreach ($appList as $id => $name) {
    $appSelectList[strtolower($name)] = $name;
}
// Array to store our page information.
$page = array();
// Category.
if (isset($_GET['cat']) && ctype_digit($_GET['cat'])) {
    $clean['cat'] = intval($_GET['cat']);
}
// Type.
if (isset($_GET['type'])) {
    switch ($_GET['type']) {
        case 'T':
            $clean['type'] = 'T';
<?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'));
 /**
  * Constructor for the AMO Authentication object
  * @access public
  */
 function AMO_Auth()
 {
     parent::AMO_Object();
     $this->_expires = get_cfg_var('session.gc_maxlifetime');
 }
示例#7
0
<?php

/**
 * Home page for extensions, switchable on application.
 *
 * @package amo
 * @subpackage docs
 * @todo make this dynamic based on an SQL field (recommended)
 */
startProcessing('bookmarks.tpl', 'bookmarks', $compileId, 'rustico');
require_once 'includes.php';
setApp();
$amo = new AMO_Object();
$primary = $amo->getAddons(array(3615));
if (is_array($primary) && !empty($primary)) {
    $primary = $primary[0];
}
$other = $amo->getAddons(array(2410, 1833));
// Assign template variables.
$tpl->assign(array('primary' => $primary, 'other' => $other, 'content' => 'bookmarks.tpl', 'currentTab' => 'bookmarks'));