本文整理汇总了PHP中CBPTXT::Ph方法的典型用法代码示例。如果您正苦于以下问题:PHP CBPTXT::Ph方法的具体用法?PHP CBPTXT::Ph怎么用?PHP CBPTXT::Ph使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBPTXT
的用法示例。
在下文中一共展示了CBPTXT::Ph方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onAfterBackendUsersList
/**
* Intercepts CB User Manager list Viewer to add filters
*
* @param int $listId
* @param UserTable $rows
* @param cbPageNav $pageNav
* @param string $search
* @param string[] $lists
* @param string $option
* @param string $select_tag_attribs
* @return array
*/
public function onAfterBackendUsersList($listId, &$rows, &$pageNav, &$search, &$lists, $option, $select_tag_attribs)
{
if (!cbpaidApp::authoriseAction('cbsubs.usersubscriptionview')) {
return array();
}
$this->outputRegTemplate();
// 1. Filters:
// 1.a. prepare dropdown selector filter with the list of published plans:
$plansMgr = cbpaidPlansMgr::getInstance();
$plans = $plansMgr->loadPublishedPlans(CBuser::getMyUserDataInstance(), true, 'any', null);
$plansList = array();
$plansList[] = moscomprofilerHTML::makeOption(0, CBPTXT::T('- Select Subscription Plan - '));
foreach ($plans as $k => $plan) {
$plansList[] = moscomprofilerHTML::makeOption($k, $plan->get('alias'));
}
if (count($plans) > 0) {
$plansList[] = moscomprofilerHTML::makeOption(-1, CBPTXT::T('ANY PLAN ACTIVE'));
$plansList[] = moscomprofilerHTML::makeOption(-2, CBPTXT::T('NO PLAN ACTIVE'));
}
$lists['cbpaidplan'] = moscomprofilerHTML::selectList($plansList, 'filter_cbpaidplan', $select_tag_attribs, 'value', 'text', $this->filter_cbpaidplan, 2);
// 1.b. prepare additional selector filter for status of subscriptions:
if ($this->filter_cbpaidplan && $this->filter_cbpaidplan != -2) {
// any plan or specific plan: // no plan: nothing for now to do
$statesList = array();
$statesList[] = moscomprofilerHTML::makeOption('A', CBPTXT::T('Active'));
$statesList[] = moscomprofilerHTML::makeOption('X', CBPTXT::T('Expired'));
$statesList[] = moscomprofilerHTML::makeOption('C', CBPTXT::T('Cancelled'));
$statesList[] = moscomprofilerHTML::makeOption('U', CBPTXT::T('Upgraded'));
$lists['cbpaidsubstate'] = moscomprofilerHTML::selectList($statesList, 'filter_cbpaidsubstate', $select_tag_attribs, 'value', 'text', $this->filter_cbpaidsubstate, 1);
$datesList = array();
$datesList[] = moscomprofilerHTML::makeOption('', CBPTXT::T('- Select expiry date -'));
if ($this->filter_cbpaidsubstate == 'A') {
$datesList[] = moscomprofilerHTML::makeOption('1 DAY', sprintf(CBPTXT::T('Expiring within %s hours'), 24));
foreach (array(2, 3, 4, 5, 6, 7) as $v) {
$datesList[] = moscomprofilerHTML::makeOption($v . ' DAY', sprintf(CBPTXT::T('Expiring within %s days'), $v));
}
foreach (array(2, 3, 4) as $v) {
$datesList[] = moscomprofilerHTML::makeOption($v . ' WEEK', sprintf(CBPTXT::T('Expiring within %s weeks'), $v));
}
$datesList[] = moscomprofilerHTML::makeOption('1 MONTH', CBPTXT::T('Expiring within in 1 month'));
foreach (array(2, 3, 4, 6, 9, 12) as $v) {
$datesList[] = moscomprofilerHTML::makeOption($v . ' MONTH', sprintf(CBPTXT::T('Expiring within %s months'), $v));
}
} else {
$datesList[] = moscomprofilerHTML::makeOption('-1 DAY', sprintf(CBPTXT::T('Expired last %s hours'), 24));
foreach (array(2, 3, 4, 5, 6, 7) as $v) {
$datesList[] = moscomprofilerHTML::makeOption('-' . $v . ' DAY', sprintf(CBPTXT::T('Expired last %s days'), $v));
}
foreach (array(2, 3, 4) as $v) {
$datesList[] = moscomprofilerHTML::makeOption('-' . $v . ' WEEK', sprintf(CBPTXT::T('Expired last %s weeks'), $v));
}
$datesList[] = moscomprofilerHTML::makeOption('-1 MONTH', CBPTXT::T('Expired last month'));
foreach (array(2, 3, 4, 6, 9, 12) as $v) {
$datesList[] = moscomprofilerHTML::makeOption('-' . $v . ' MONTH', sprintf(CBPTXT::T('Expired last %s months'), $v));
}
}
$lists['cbpaidsubexpdate'] = moscomprofilerHTML::selectList($datesList, 'filter_cbpaidsubexpdate', $select_tag_attribs, 'value', 'text', $this->filter_cbpaidsubexpdate, 1);
}
// 2. add subscriptions colum to backend users-lists:
$pluginColumns = array();
foreach ($rows as $row) {
$paidUserExtension = cbpaidUserExtension::getInstance((int) $row->id);
$subscriptions = $paidUserExtension->getUserSubscriptions('A', true);
$displayPlans = array();
foreach ($subscriptions as $sub) {
$plan = $sub->getPlan();
if ($plan) {
$cssclass = $plan->get('cssclass');
$aliasHtml = htmlspecialchars($plan->get('alias'));
} else {
$cssclass = null;
$aliasHtml = CBPTXT::Ph("PLAN OF SUBSCRIPTION ID [SUB_ID] IS DELETED", array('[SUB_ID]' => $sub->id));
}
$displayPlans[] = '<span' . ($cssclass ? ' class="' . htmlspecialchars($cssclass) . '"' : '') . '>' . $aliasHtml . '</span>';
}
$pluginColumns[$row->id] = implode(', ', $displayPlans);
}
return array(CBPTXT::T('Subscriptions') => $pluginColumns);
}