This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add Filter {Active|Expired|All} for invoices on payment history page | |
Am_Di::getInstance()->blocks->add( | |
'member/payment-history/top', | |
new Am_Block_Base(null, 'inv-filter', null, function(Am_View $v) { | |
$user = $v->di->user; | |
$ids = $v->di->db->selectCol(<<<CUT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//replace standard menu with affiliate specific if currently logged in user is affiliate | |
$di = Am_Di::getInstance(); | |
if ($di->auth->getUserId() && $di->auth->getUser()->is_affiliate) { | |
$n = new Am_Navigation_User(); | |
$n->addMenuPages('_aff'); | |
$di->setService('navigationUser', $n); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Am_Di::getInstance()->router->addRoute('aff-autocomplete', new Am_Mvc_Router_Route('aff/admin/autocomplete', [ | |
'module' => 'default', | |
'controller' => 'admin-aff-autocomplete', | |
'action' => 'index', | |
])); | |
class AdminAffAutocompleteController extends Am_Mvc_Controller | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Am_Di::getInstance()->hook->add('gridAffPayoutDetailInitGrid', function(Am_Event_Grid $e) { | |
$e->getGrid()->getDataSource() | |
->leftJoin('?_data', 'd', "d.`table`='user' AND d.`key` = 'aff_paypal_email' AND u.user_id = d.`id`") | |
->addField('d.value', 'aff_paypal_email'); | |
$e->getGrid()->addFieldBefore('name_f', 'aff_paypal_email', 'PayPal Email'); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Am_Di::getInstance()->blocks->add('helpdesk/ticket/top', new Am_Block_Base(null, 'helpdesk-action-link', null, function(Am_View $v) { | |
if ($v->strategy instanceof Am_Helpdesk_Strategy_Admin) { | |
/** @var HelpdeskTicket $ticket */ | |
$ticket = $v->ticket; | |
/** @var User $user */ | |
$user = $ticket->getUser(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @title Widget Foo Bar | |
* @path application/default/plugins/misc/widget-foobar.php | |
*/ | |
class Am_Plugin_WidgetFoobar extends Am_Plugin | |
{ | |
const PLUGIN_STATUS = self::STATUS_BETA; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$di = Am_Di::getInstance(); | |
if ($di->auth->getUser() | |
&& ($videos = $di->resourceAccessTable->getAllowedResources($di->auth->getUser(), ResourceAccess::VIDEO)) | |
) { | |
$di->view->headStyle() | |
->appendStyle("#member-main-resources li {display: block;}"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style type="text/css">#row-product_id_page-0-0 .am-element-title { | |
float: none; | |
width:auto; | |
text-align:center; | |
padding: 1em; | |
} | |
#row-product_id_page-0-0 .am-element { | |
padding: 1em; | |
margin:0; | |
display: grid; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @title Soft File to License Scheme | |
* @path application/default/plugins/misc/softsalefile-to-license.php | |
*/ | |
class Am_Plugin_SoftsalefileToLicense extends Am_Plugin | |
{ | |
const PLUGIN_STATUS = self::STATUS_PRODUCTION; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Am_Di::getInstance()->hook->add(Am_Event::USER_MENU, function(Am_Event $e) { | |
$menu = $e->getMenu(); | |
[$config, $items] = Am_Navigation_User::getNavigation(); | |
$url = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); | |
foreach ($config as $item) { |