fligtar%gmail.com a8bcfba56e Updated addons stuff, including translation support
git-svn-id: svn://10.0.0.236/trunk@208565 18797224-902f-48f8-a5cc-f745e15eee43
2006-08-27 06:08:37 +00:00

42 lines
944 B
PHP

<?php
class AmoComponent extends Object {
var $addonTypes = array();
/**
* Called automatically
* @param object $controller
*/
function startup(&$controller) {
$this->getAddonTypes();
}
/**
* Populates addonTypes array from DB
*/
function getAddonTypes() {
$addontype =& new Addontype();
$addonTypes = $addontype->findAll('', '', '', '', '', -1);
foreach ($addonTypes as $k => $v) {
$this->addonTypes[$addonTypes[$k]['Addontype']['id']] = $addonTypes[$k]['Addontype']['name'];
}
}
/**
* Checks if user has permissions for an addon
* @param int $id
*/
function checkOwnership($id) {
/* to be re-visited after we implement sessions and ACL
if (user is admin) {
return true;
}
if (user is an author) {
return true;
}
*/
return true;
}
}