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()->front->registerPlugin(new class extends Zend_Controller_Plugin_Abstract { | |
public function preDispatch(Zend_Controller_Request_Abstract $request) | |
{ | |
if ($request->getModuleName() == 'default' && | |
$request->getControllerName() == 'member' && | |
$request->getActionName() == 'payment-history') { | |
$di = Am_DI::getInstance(); |
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('gridProductInitGrid', function(Am_Event_Grid $e) { | |
$e->getGrid()->addField('comment', ___('Comment')); | |
$e->getGrid()->addField('start_date', ___('Start Date Calculation')) | |
->setGetFunction(function($record, $grid, $fieldname, $field){ | |
$r = explode(',', $record->{$fieldname}); | |
foreach ($r as $k => $v) { |
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('gridCouponBatchInitGrid', function(Am_Event_Grid $e) { | |
$e->getGrid()->removeField('begin_date'); | |
$e->getGrid()->removeField('expire_date'); | |
$e->getGrid()->removeField('is_disabled'); | |
}); |
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 | |
class Am_Plugin_BlockExpireDate extends Am_Plugin | |
{ | |
const PLUGIN_STATUS = self::STATUS_PRODUCTION; | |
const PLUGIN_COMM = self::COMM_COMMERCIAL; | |
const PLUGIN_REVISION = '@@VERSION@@'; | |
const DEFAULT_TPL = '<div class="am-info">Greetings %user.name_f% — your subscription expires on %expire|date%</div>'; |
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
/* Text instead of icon for dashboard menu item */ | |
ul.am-tabs #menu-member { | |
text-indent:0; | |
background: none; | |
width: auto; | |
} | |
ul.am-tabs li.active #menu-member, | |
ul.am-tabs #menu-member:hover { | |
background-image: none; |
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::INVOICE_TERMS, function(Am_Event $e) { | |
$invoice = $e->getInvoice(); | |
if ($invoice->first_total>0 && !($invoice->second_total>0)) { | |
$n = new DateTime('00:00'); | |
$f = clone $n; | |
foreach ($invoice->getItems() as $item) { | |
if ($item->first_total > 0) { |
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::INVOICE_TERMS, function(Am_Event $e) { | |
$invoice = $e->getInvoice(); | |
$multi = array( | |
'y' => 365, | |
'm' => 30, | |
'd' => 1 | |
); | |
if ($invoice->first_total>0 && !($invoice->second_total>0)) { |
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 | |
if ($user = Am_Di::getInstance()->auth->getUser()) { | |
if ($files = Am_Di::getInstance()->resourceAccessTable->getAllowedResources($user, ResourceAccess::FILE)) { | |
Am_Di::getInstance()->blocks->add(new Am_Block('member/main/left', 'Your Downloads', 'files', null, | |
function (Am_View $v) use ($files) { | |
$out = ''; | |
foreach ($files as $f) { | |
$out .= sprintf("<li>%s</li>\n", $f->renderLink()); | |
} |
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 | |
if (($u = Am_Di::getInstance()->auth->getUser()) && | |
($url = Am_Di::getInstance()->store->get("cancel-redirect.{$u->pk()}"))) { | |
Am_Di::getInstance()->store->set("cancel-redirect.{$u->pk()}", null); | |
Am_Mvc_Response::redirectLocation($url); | |
} | |
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()->productTable->customFields()->add(new Am_CustomFieldCheckbox('cart_exclude', 'Exclude from Shopping Cart')); | |
Am_Di::getInstance()->hook->add('cartGetProductsQuery', function(Am_Event $e) { | |
/* @var $q Am_Query */ | |
$q = $e->getQuery(); | |
$q->leftJoin('?_data', 'd', "d.`table` = 'product' AND d.`key` = 'cart_exclude' AND d.`id` = p.product_id"); | |
$q->addWhere('d.`value` IS NULL OR d.`value`<>1'); | |
}); |
OlderNewer