本文整理汇总了PHP中CBPTXT类的典型用法代码示例。如果您正苦于以下问题:PHP CBPTXT类的具体用法?PHP CBPTXT怎么用?PHP CBPTXT使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CBPTXT类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: drawUserSomethings
/**
* Draws the user profile tab "Subscriptions" (if enabled, user is the profile owner, and something to display.
*
* @param UserTable $user
* @param boolean $itsmyself
* @param string $htmlSubscribed
* @return string
*/
public function drawUserSomethings($user, $itsmyself, $htmlSubscribed)
{
global $_CB_framework, $ueConfig;
$this->htmlSubscribed = $htmlSubscribed;
$subscriptions = $this->_model;
if (count($subscriptions) == 1) {
$subTxt = CBPTXT::T(cbpaidApp::settingsParams()->get('subscription_name', 'subscription'));
} else {
$subTxt = CBPTXT::T(cbpaidApp::settingsParams()->get('subscriptions_name', 'subscriptions'));
}
if ($itsmyself) {
$userName = null;
} else {
$userName = getNameFormat($user->name, $user->username, $ueConfig['name_format']);
}
if ($_CB_framework->getUi() == 1) {
if ($itsmyself) {
$this->htmlTabTitle = sprintf(CBPTXT::Th("Your current %s"), $subTxt);
} else {
$this->htmlTabTitle = sprintf(CBPTXT::Th("%s's current %s"), $userName, $subTxt);
}
} else {
if ($itsmyself) {
$this->htmlTabTitle = sprintf(CBPTXT::Th("Your current and past %s"), $subTxt);
} else {
$this->htmlTabTitle = sprintf(CBPTXT::Th("%s's current and past %s"), $userName, $subTxt);
}
}
return $this->display();
}
开发者ID:jasonrgd,项目名称:Digital-Publishing-Platform-Joomla,代码行数:38,代码来源:usersubscriptions.php
示例2: buttonText
/**
* Returns text for button for upgrade, renewals, etc.
*
* @param string $type 'upgrade', 'pay', 'renew', 'reactivate', 'resubscribe', 'unsubscribe', 'delete', default is Apply
* @return string translated button text (without htmlspecialchars, it will be applied on the returned text.
*/
public function buttonText( $type ) {
switch ( $type ) {
case 'upgrade':
return CBPTXT::T("Buy");
case 'pay':
return CBPTXT::T("Buy Now");
default:
return parent::buttonText( $type );
}
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:16,代码来源:cbpaidProductMerchandise.php
示例3: drawUserUpgradePlans
/**
* Draws the plans upgrade proposals
*
* @param UserTable $user
* @param int $plansDisplayed
* @param string $htmlUpgrades
* @param string $htmlspecialcharedBaseUrl
* @param array $hiddenFlds
* @param array $buttonTexts
* @param string $buttonName
* @return string
*/
public function drawUserUpgradePlans($user, $plansDisplayed, $htmlUpgrades, $htmlspecialcharedBaseUrl, $hiddenFlds, $buttonTexts, $buttonName)
{
$this->htmlUpgrades = $htmlUpgrades;
$this->htmlspecialcharedBaseUrl = $htmlspecialcharedBaseUrl;
$this->hiddenFlds = $hiddenFlds;
$this->buttonName = $buttonName;
$this->buttonText = implode(' / ', $buttonTexts);
$subTxt = CBPTXT::T(cbpaidApp::settingsParams()->get('subscription_name', 'subscription'));
if ($plansDisplayed == 1) {
$this->htmlTitle = sprintf(CBPTXT::Th("Your current %s upgrade possibility:"), $subTxt);
} else {
$this->htmlTitle = sprintf(CBPTXT::Th("Your current %s upgrade possibilities:"), $subTxt);
}
return $this->display();
}
开发者ID:jasonrgd,项目名称:Digital-Publishing-Platform-Joomla,代码行数:27,代码来源:userupgradeplans.php
示例4: drawTab
/**
* Draws the user profile tab "Subscriptions" (if enabled, user is the profile owner, and something to display.
*
* @param string $htmlSubscriptionsAndUpgrades
* @param string $htmlInvoicesLink
* @param string $tabTitleText
* @param string $htmlTabDescription
* @return string
*/
public function drawTab($htmlSubscriptionsAndUpgrades, $htmlInvoicesLink, $tabTitleText, $htmlTabDescription)
{
global $ueConfig;
$this->htmlSubscriptionsAndUpgrades = $htmlSubscriptionsAndUpgrades;
$this->htmlInvoicesLink = $htmlInvoicesLink;
$this->htmlTabDescription = $htmlTabDescription;
$user = $this->_model;
$title = cbReplaceVars(CBPTXT::Th(cbUnHtmlspecialchars($tabTitleText)), $user);
if ($title) {
$name = getNameFormat($user->name, $user->username, $ueConfig['name_format']);
$title = sprintf($title, $name);
}
$this->htmlTabTitle = $title;
return $this->display();
}
开发者ID:jasonrgd,项目名称:Digital-Publishing-Platform-Joomla,代码行数:24,代码来源:userprofilesubstab.php
示例5: sendMail
/**
* Builds and sends e-mail
*
* @param UserTable $user
* @param string $mailFrom_email
* @param string $mailFrom_name
* @param string $mailTo
* @param string $mailSubject
* @param string $mailBody
* @param string $mailHtml
* @param string $mailCC
* @param string $mailBCC
* @param string $mailAttachments
* @param string[] $extraStrings
* @return void
*/
protected function sendMail( $user, $mailFrom_email, $mailFrom_name, $mailTo, $mailSubject, $mailBody, $mailHtml, $mailCC, $mailBCC, $mailAttachments, $extraStrings ) {
global $_CB_framework;
cbimport( 'cb.tabs' );
$cbUser = CBuser::getInstance( $user->id );
if ( ! $cbUser ) {
return;
}
$mailFrom_email = trim( $cbUser->replaceUserVars( $mailFrom_email, false, false, array(), false ) );
$mailFrom_name = trim( $cbUser->replaceUserVars( $mailFrom_name, false, false, array(), false ) );
$mailTo = trim( $cbUser->replaceUserVars( $mailTo, false, false, array(), false ) );
$mailCC = trim( $cbUser->replaceUserVars( $mailCC, false, false, array(), false ) );
$mailBCC = trim( $cbUser->replaceUserVars( $mailBCC, false, false, array(), false ) );
$mailSubject = trim( $cbUser->replaceUserVars( CBPTXT::T( $mailSubject ), false, false, $extraStrings, false ) );
$mailBody = trim( $cbUser->replaceUserVars( CBPTXT::T( $mailBody ), false, false, $extraStrings, false ) );
$mailAttachments = trim( $mailAttachments );
if ( $mailTo != '' ) {
$mailTo = preg_split( '/ *, */', $mailTo );
} else {
return;
}
if ( $mailCC != '' ) {
$mailCC = preg_split( '/ *, */', $mailCC );
} else {
$mailCC = null;
}
if ( $mailBCC != '' ) {
$mailBCC = preg_split( '/ *, */', $mailBCC );
} else {
$mailBCC = null;
}
if ( $mailAttachments != '' ) {
$mailAttachments = preg_split( '/ *, */', $mailAttachments );
} else {
$mailAttachments = null;
}
if ( $mailTo && ( $mailSubject || $mailBody ) ) {
comprofilerMail( $mailFrom_email, $mailFrom_name, $mailTo, $_CB_framework->getCfg( 'sitename' ).' - '.$mailSubject, $mailBody, $mailHtml, $mailCC, $mailBCC, $mailAttachments );
}
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:64,代码来源:cbsubs.email.php
示例6: canDelete
/**
* Check for whether dependancies exist for this object in the db schema
*
* @param int $oid Optional key index
* @return boolean TRUE: OK to delete, FALSE: not OK to delete, error in $this->_error
*/
public function canDelete($oid = null)
{
$k = $this->_tbl_key;
if ($oid) {
$this->{$k} = $oid;
}
$query = "SELECT COUNT(*)" . "\n FROM `#__cbsubs_subscriptions`" . "\n WHERE `plan_id` = " . (int) $this->{$k};
$this->_db->setQuery($query);
$obj = null;
$count = $this->_db->loadResult($obj);
if ($count > 0) {
$this->setError(CBPTXT::T("Subscriptions exist for this plan"));
return false;
}
return parent::canDelete($oid);
}
开发者ID:jasonrgd,项目名称:Digital-Publishing-Platform-Joomla,代码行数:22,代码来源:cbpaidProductUsersubscription.php
示例7: renderCurrencySymbol
/**
* Renders the currency symbol according to global settings
*
* @param string|null $currency
* @param boolean $html
* @return string
*/
public function renderCurrencySymbol( $currency, $html ) {
$params = $this->params;
if ( $currency === null ) {
$currency = $params->get( 'currency_code', 'USD' );
}
$priceCurrencyFormat = $params->get('price_currency_format', '%2$s %1$s' );
if ( $html ) {
if ( strpos( $priceCurrencyFormat, '%3' ) !== false ) {
$currencySymbols = array ( 'EUR' => '€', 'USD' => '$', 'GBP' => '£', 'JPY' => '¥', 'CHF' => 'Fr.', 'CAD' => 'C$', 'AUD' => '$', 'BRL' => 'R$', 'CNY' => '¥', 'DKK' => 'KR', 'ZAR' => 'R', 'SEK' => 'KR' ); //TBD: move to currency table
$textHtmlSymbol = isset( $currencySymbols[$currency] ) ? $currencySymbols[$currency] : CBPTXT::Th( $currency );
} else {
$textHtmlSymbol = CBPTXT::Th( $currency );
}
$textHtmlSymbol = '<span class="cbregPcur">' . $textHtmlSymbol . '</span>';
} else {
$textHtmlSymbol = CBPTXT::T( $currency );
}
return $textHtmlSymbol;
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:26,代码来源:cbpaidMoney.php
示例8: renderColumn
/**
* Renders a $variable for an $output
*
* @param string $variable
* @param string $output
* @param boolean $rounded
* @return string|null
*/
public function renderColumn($variable, $output = 'html', $rounded = false)
{
$html = $output == 'html';
switch ($variable) {
case 'rate':
$ret = $this->renderItemRate($html);
break;
case 'discount_amount':
case 'tax_amount':
$ret = $this->renderJustItemRates($variable, $html, $rounded);
break;
case 'first_rate':
case 'first_discount_amount':
case 'first_tax_amount':
$ret = cbpaidMoney::getInstance()->renderPrice($this->{$variable}, $this->currency, $html, $rounded);
break;
case 'quantity':
// removes insignifiant zeros after ., as well as the . itself if no decimals:
$matches = null;
$matched = preg_match("/^(.+?)[.]?[0]*\$/", $this->get($variable), $matches);
$ret = $matched ? $matches[1] : null;
break;
case 'validity_period':
if ($this->start_date && $this->stop_date && $this->start_date != '0000-00-00 00:00:00' && $this->stop_date != '0000-00-00 00:00:00') {
$showTime = false;
$startDate = cbFormatDate($this->start_date, 1, $showTime);
$stopDate = cbFormatDate($this->stop_date, 1, $showTime);
$ret = htmlspecialchars($startDate);
if ($stopDate && $startDate != $stopDate) {
$ret .= ($html ? ' - ' : ' - ') . htmlspecialchars($stopDate);
}
if ($this->second_stop_date && $this->second_stop_date != '0000-00-00 00:00:00') {
$secondStartDate = cbFormatDate($this->_db->getUtcDateTime(cbpaidTimes::getInstance()->strToTime($this->stop_date) + 1), 1, $showTime);
$secondStopDate = cbFormatDate($this->second_stop_date, 1, $showTime);
$retsecond = htmlspecialchars($secondStartDate) . ($html ? ' - ' : ' - ') . htmlspecialchars($secondStopDate);
$ret = sprintf($html ? CBPTXT::Th("%s, then %s") : CBPTXT::T("%s, then %s"), $ret, $retsecond);
}
} else {
$ret = null;
}
break;
case 'tax_rule_id':
if ($this->tax_rule_id && is_callable(array('cbpaidTaxRule', 'getInstance'))) {
$ret = cbpaidTaxRule::getInstance((int) $this->tax_rule_id)->getShortCode();
} else {
$ret = null;
}
break;
case 'original_rate':
case 'first_original_rate':
$ret = null;
break;
case 'ordering':
case 'artnum':
case 'description':
case 'discount_text':
default:
$value = $this->get($variable);
if ($value !== null) {
$ret = htmlspecialchars($this->get($variable));
} else {
$ret = null;
}
break;
}
return $ret;
}
开发者ID:jasonrgd,项目名称:Digital-Publishing-Platform-Joomla,代码行数:75,代码来源:cbpaidPaymentItem.php
示例9: attemptScheduledTask
/**
* When triggered, before starting to make changes this method should be called
* Transition: -> E{$substate}
*
* @param string $substate
* @return boolean TRUE: got lock to perform scheduled task, FALSE: no scheduling needed here (and no transition made)
*/
public function attemptScheduledTask( $substate = '' ) {
if ( substr( $this->_baseObject->scheduler_state, 0, 1 ) == 'E' ) {
// It was Executing: check for iterations before resetting to 'S' (with error log).
if ( strlen( $this->_baseObject->scheduler_state ) == 1 ) {
// Backwards compatibility:
$this->_baseObject->scheduler_state .= '1';
}
$iteration = (int) $this->_baseObject->scheduler_state[1];
if ( ++$iteration <= $this->maxExecWaitIterations ) {
$this->_baseObject->scheduler_state[1] = (string) $iteration;
$this->_baseObject->store();
} else {
$this->_baseObject->scheduler_state = 'S';
cbpaidApp::setLogErrorMSG( 4, $this->_baseObject, CBPTXT::P("Scheduler for this basket has stayed in execution state for [NUMBER_OF_CRONS] cron cycles. Resetting execution state.", array( '[NUMBER_OF_CRONS]' => $this->maxExecWaitIterations ) ), null );
}
}
// Now normal case:
if ( $this->_baseObject->scheduler_state == 'S' ) {
// it was scheduled:
$this->_baseObject->scheduler_state = 'E1' . $substate; // Executing
return $this->_baseObject->store();
}
return false;
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:34,代码来源:cbpaidScheduler.php
示例10: loadLang
/**
* Standard language loading method:
* @todo add to CB API
*
* @param string $interface 'admin' to force-load admin languages
*/
public static function loadLang($interface = null)
{
global $_CB_framework;
static $loaded = false;
static $adminLoaded = false;
if (!$loaded) {
$path = $_CB_framework->getCfg('absolute_path') . '/components/com_comprofiler/plugin/language';
$myLanguageFolder = '-' . strtolower($_CB_framework->getCfg('lang_tag'));
$myLanguageFile = 'language.php';
$file = $path . '/cbpaidsubscriptions' . $myLanguageFolder . '/' . $myLanguageFile;
if (!file_exists($file)) {
// Old method:
$myLanguageFolder = $_CB_framework->getCfg('lang');
$myLanguageFile = $myLanguageFolder . '.php';
$file = $path . '/cbpaidsubscriptions' . $myLanguageFolder . '/' . $myLanguageFile;
}
if (file_exists($file)) {
if (!$interface) {
$CBstrings = array();
/** @noinspection PhpIncludeInspection */
include_once $file;
// defines $CBstrings
CBPTXT::addStrings($CBstrings);
}
if ($_CB_framework->getUi() == 2 || $interface == 'admin') {
if (!$adminLoaded) {
$file = $path . '/cbpaidsubscriptions' . $myLanguageFolder . '/admin_' . $myLanguageFile;
if (file_exists($file)) {
$CBstrings = array();
/** @noinspection PhpIncludeInspection */
include_once $file;
// defines $CBstrings
CBPTXT::addStrings($CBstrings);
}
$adminLoaded = true;
}
}
}
$loaded = true;
}
}
开发者ID:jasonrgd,项目名称:Digital-Publishing-Platform-Joomla,代码行数:47,代码来源:cbpaidApp.php
示例11: store
/**
* store() function override, instead of storing it imports.
*
* @param boolean $updateNulls
* @return boolean
*/
public function store($updateNulls = false)
{
$return = '';
// Check if file uploads are enabled
if (!(bool) ini_get('file_uploads')) {
$this->_error = CBPTXT::T("Importer") . ' - ' . CBPTXT::T("error:") . ' ' . CBPTXT::T("The importer can't continue before file uploads are enabled in PHP settings.");
return false;
}
if (!$this->import_type) {
$this->_error = CBPTXT::T("Importer") . ' - ' . CBPTXT::T("error:") . ' ' . CBPTXT::T("No import type selected");
return false;
}
$fromFile = cbStartOfStringMatch($this->import_type, 'file_');
if ($fromFile) {
$userfile = $_FILES['userfile'];
if (!$userfile || $userfile == null) {
$this->_error = CBPTXT::T("Importer") . ' - ' . CBPTXT::T("error:") . ' ' . CBPTXT::T("No file selected");
return false;
}
if (isset($userfile['error']) && $userfile['error']) {
$errors_array = array(1 => CBPTXT::T("The uploaded file exceeds the upload_max_filesize directive in php.ini."), 2 => CBPTXT::T("The uploaded file exceeds the maximum size allowed by this form."), 3 => CBPTXT::T("The uploaded file was only partially uploaded."), 4 => CBPTXT::T("No file was selected and uploaded."), 6 => CBPTXT::T("Missing a temporary folder in php.ini."), 7 => CBPTXT::T("Failed to write file to disk."), 8 => CBPTXT::T("File upload stopped by extension."));
if (in_array($userfile['error'], $errors_array)) {
$fileErrorTxt = $errors_array[$userfile['error']];
} else {
$fileErrorTxt = CBPTXT::T("File upload error number ") . htmlspecialchars($userfile['error']);
}
$this->_error = CBPTXT::T("Importer") . ' - ' . CBPTXT::T("error:") . ' ' . $fileErrorTxt;
return false;
}
if (!$userfile['tmp_name'] || !is_uploaded_file($userfile['tmp_name'])) {
$this->_error = CBPTXT::T("Importer") . ' - ' . CBPTXT::T("error:") . ' ' . CBPTXT::T("No temporary file name");
return false;
}
if ($userfile['size'] == 0) {
$this->_error = CBPTXT::T("Importer") . ' - ' . CBPTXT::T("error:") . ' ' . CBPTXT::T("Empty file");
return false;
}
} else {
$userfile = null;
}
if ($this->import_type == 'cms_acl') {
if (!$this->usergroup) {
$this->_error = CBPTXT::T("Importer") . ' - ' . CBPTXT::T("error:") . ' ' . CBPTXT::T("No usergroup selected");
return false;
}
}
if ($this->import_type == 'subscription') {
if (!$this->from_plan) {
$this->_error = CBPTXT::T("Importer") . ' - ' . CBPTXT::T("error:") . ' ' . CBPTXT::T("No subscription plan selected");
return false;
}
if (!$this->from_sub_status) {
$this->_error = CBPTXT::T("Importer") . ' - ' . CBPTXT::T("error:") . ' ' . CBPTXT::T("No subscription status selected");
return false;
}
}
if ($this->import_type != 'file_uid_plan_exp') {
if (!$this->plan) {
$this->_error = CBPTXT::T("Importer") . ' - ' . CBPTXT::T("error:") . ' ' . CBPTXT::T("No plan selected");
return false;
}
if (!$this->state) {
$this->_error = CBPTXT::T("Importer") . ' - ' . CBPTXT::T("error:") . ' ' . CBPTXT::T("No subscription state selected");
return false;
}
if (!$this->date) {
$this->_error = CBPTXT::T("Importer") . ' - ' . CBPTXT::T("error:") . ' ' . CBPTXT::T("No subscription date selected");
return false;
}
}
if ($fromFile) {
$tmpName = $userfile['tmp_name'];
$fileSize = (int) $userfile['size'];
// $fileType = $userfile['type'];
} else {
$tmpName = null;
$fileSize = null;
}
$planStateDate = array();
switch ($this->import_type) {
case 'file_uid':
$fp = fopen($tmpName, 'r');
$content = fread($fp, $fileSize);
fclose($fp);
unlink($tmpName);
$userIdList = explode(',', trim($content));
break;
case 'file_uid_plan_exp':
$userIdList = array();
$fp = fopen($tmpName, 'r');
if ($fp) {
$n = 0;
while (!feof($fp)) {
$line = trim(str_replace('"', '', fgets($fp, 256)));
//.........这里部分代码省略.........
开发者ID:jasonrgd,项目名称:Digital-Publishing-Platform-Joomla,代码行数:101,代码来源:cbpaidSubscriptionsImporter.php
示例12: _renderPeriodOfValiditiy
/**
* Returns formatted time period ( xxx weeks , or xxx years xxx months xxx days xxx hours xxx minutes xxx seconds
*
* @param string $varName 'validity' or 'fist_validity'
* @param int $occurrences [default: 1] multiply period by the occurrences before displaying
* @param boolean $displayOne [default: true] displays also if only 1 unit of something
* @param boolean $displayCalendarYearStart [default: true] displays start of calendar year if not January 1st
* @return string
*/
private function _renderPeriodOfValiditiy( $varName, $occurrences = 1, $displayOne = true, $displayCalendarYearStart = true ) {
// $ycdhmsArray = $this->_timedObject->getValidity( $varName );
// $prefix = ( $this->_timedObject->isCalendarValidity( $varName ) ? CBPTXT::T("calendar ") : '' );
// return $this->_timedObject->renderPeriod( $ycdhmsArray, $occurrences, $displayOne, $prefix );
$ycdhmsArray = $this->getValidity( $varName );
$prefix = ( $this->isCalendarValidity( $varName ) ? CBPTXT::T("calendar ") : '' );
$text = $this->renderPeriod( $ycdhmsArray, $occurrences, $displayOne, $prefix );
$calStart = $this->calendarYearStart( $varName );
if ( $prefix && ( $calStart != '01-01' ) && $displayCalendarYearStart ) {
list( $m, $d ) = explode( '-', $calStart );
$text .= ' ' . CBPTXT::T("starting") . ' ' . date( 'F j', mktime( 0, 0, 0, $m, $d, 2004 ) );
}
return $text;
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:23,代码来源:cbpaidItem.php
示例13: renderTotalRate
/**
* Renders the rate of $this payment item
*
* @param string $variable
* @param boolean $output 'html', ...
* @param boolean $rounded
* @return string|null
*/
private function renderTotalRate($variable, $output, $rounded = false)
{
$renderedBasketPrice = null;
$params = cbpaidApp::settingsParams();
if ($params->get('totalizer_description_' . 'grandtotal') == '[AUTOMATIC]') {
list($recurring, , $period, $occurrences) = $this->_itemsProps($this->_paymentBasket->loadPaymentItems());
$renderedBasketPrice = $this->_paymentBasket->renderPrice(null, null, null, true);
if ($recurring && ($this->_paymentBasket->period1 && $this->_paymentBasket->mc_amount1 != $this->_paymentBasket->mc_amount3)) {
$then = $this->_paymentBasket->renderPrice($this->_paymentBasket->mc_amount3, $period, $occurrences, true);
$renderedBasketPrice = sprintf(CBPTXT::Th("%s, then %s"), $renderedBasketPrice, $then);
}
} else {
parent::renderColumn($variable, $output, $rounded);
}
return $renderedBasketPrice;
}
开发者ID:jasonrgd,项目名称:Digital-Publishing-Platform-Joomla,代码行数:24,代码来源:cbpaidPaymentTotalizer.php
示例14: _file_path
/**
* Finds file and returns absolute file path
*
* @param string $layout one word name
* @param string $extension '.php' or '.css'
* @return string|null
*/
protected function _file_path( $layout, $extension ) {
global $_CB_framework;
$saneLayout = ( $layout ? preg_replace( '/\W/', '', strtolower( $layout ) ) : 'default' ) . $extension;
if ( $extension === '.php' ) {
$absPrefix = $_CB_framework->getCfg( 'absolute_path' );
$chkPrefix = '';
$saneLayout = $this->viewName . '/' . $saneLayout;
} else {
$absPrefix = '';
$chkPrefix = $_CB_framework->getCfg( 'absolute_path' );
}
$cmsTemplate = $this->_cmsCurrentTemplate();
$overrideFilePath = '/templates/' . $cmsTemplate . '/html/com_comprofiler/' . $this->_overrideSubFolder . '/';
if ( $cmsTemplate && file_exists( $chkPrefix . $absPrefix . $overrideFilePath . $saneLayout ) ) {
$this->_tmplUsedPath = $overrideFilePath;
return $absPrefix . $overrideFilePath . $saneLayout;
} else {
$internalFilePath = '/components/com_comprofiler/' . $this->_defaultTemplatePath . '/' . $this->templateToUse() . '/';
if ( file_exists( $chkPrefix . $absPrefix . $internalFilePath . $saneLayout ) ) {
$this->_tmplUsedPath = $internalFilePath;
return $absPrefix . $internalFilePath . $saneLayout;
} else {
$defaultInternalFilePath = '/components/com_comprofiler/' . $this->_defaultTemplatePath . '/' . 'default' . '/';
if ( ( $this->templateToUse() != 'default' ) && file_exists( $chkPrefix . $absPrefix . $defaultInternalFilePath . $saneLayout ) ) {
$this->_tmplUsedPath = $defaultInternalFilePath;
return $absPrefix . $defaultInternalFilePath . $saneLayout;
} else {
// $method = '_render' . $layout;
// if ( is_callable( array( $this, $method ) ) ) {
// $this->$method();
// } else {
trigger_error( sprintf( CBPTXT::T("CB View %s Layout %s has no rendering file %s."), $this->viewName, $saneLayout, $absPrefix . $internalFilePath . $saneLayout ), E_USER_NOTICE );
// }
}
}
}
return null;
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:46,代码来源:cbpaidTemplateHandler.php
示例15: store
/**
* If table key (id) is NULL : inserts a new row
* otherwise updates existing row in the database table
*
* Can be overridden or overloaded by the child class
*
* @param boolean $updateNulls TRUE: null object variables are also updated, FALSE: not.
* @return boolean TRUE if successful otherwise FALSE
*/
public function store($updateNulls = false)
{
if (!cbpaidApp::authoriseAction('cbsubs.refunds')) {
$this->setError(CBPTXT::T("Not authorized"));
return false;
}
// 1) check:
if (!in_array($this->payment_status, array('Completed', 'Pending', 'Partially-Refunded'))) {
$this->setError(CBPTXT::T("This payment is not completed, pending or partially refunded."));
return false;
}
if ($this->txn_id == '') {
$this->txn_id = 'None';
// needed for updatePayment to generate payment record.
}
$payment = new cbpaidPayment();
if (!$payment->load((int) $this->id)) {
$this->setError(CBPTXT::T("This payment does not exist."));
return false;
}
$paymentBasket = new cbpaidPaymentBasket();
if (!$paymentBasket->load($this->payment_basket_id)) {
$this->setError(CBPTXT::T("This payment has no associated payment basket and cannot be refunded from here. Maybe from your PSP online terminal ?"));
return false;
}
if (!$this->gateway_account) {
$this->setError(CBPTXT::T("This payment has no gateway associated so can not be refunded."));
return false;
}
$payAccount = cbpaidControllerPaychoices::getInstance()->getPayAccount($this->gateway_account);
if (!$payAccount) {
$this->setError(CBPTXT::T("This payment's payment basket's associated gateway account is not active, so can not be refunded from here."));
return false;
}
$payClass = $payAccount->getPayMean();
$returnText = null;
$amount = sprintf('%.2f', (double) $this->refund_gross);
if (is_callable(array($payClass, 'refundPayment'))) {
$success = $payClass->refundPayment($paymentBasket, $payment, null, $this->refund_is_last, $amount, $this->refund_reason, $returnText);
} else {
$success = false;
}
$user = CBuser::getUserDataInstance($paymentBasket->user_id);
$username = $user ? $user->username : '?';
$replacements = array('[REFUNDAMOUNT]' => $payment->mc_currency . ' ' . $amount, '[PAYMENTID]' => $payment->id, '[PAYMENTAMOUNT]' => $payment->mc_currency . ' ' . $payment->mc_gross, '[BASKETID]' => $paymentBasket->id, '[ORDERID]' => $paymentBasket->sale_id, '[FULLNAME]' => $paymentBasket->first_name . ' ' . $paymentBasket->last_name, '[USERNAME]' => $username, '[USERID]' => $paymentBasket->user_id, '[PAYMENTMETHOD]' => $payClass->getPayName(), '[TXNID]' => $payment->txn_id, '[AUTHID]' => $payment->auth_id, '[ERRORREASON]' => $paymentBasket->reason_code);
if ($success) {
// Success Message ?
// $returnText = CBPTXT::P("Refunded [REFUNDAMOUNT] for payment id [PAYMENTID] of [PAYMENTAMOUNT] for basket id [BASKETID], Order id [ORDERID] of [FULLNAME] (username [USERNAME] - user id [USERID]) using [PAYMENTMETHOD] with txn_id [TXNID] and auth_id [AUTHID].", $replacements );
} else {
$this->setError(CBPTXT::T($payClass->getErrorMSG()) . '. ' . CBPTXT::P("Refund request of [REFUNDAMOUNT] for payment id [PAYMENTID] of [PAYMENTAMOUNT] for basket id [BASKETID], Order id [ORDERID] of [FULLNAME] (username [USERNAME] - user id [USERID]) using [PAYMENTMETHOD] with txn_id [TXNID] and auth_id [AUTHID] failed for reason: [ERRORREASON].", $replacements));
return false;
}
return true;
}
开发者ID:jasonrgd,项目名称:Digital-Publishing-Platform-Joomla,代码行数:63,代码来源:admin.cbpaidsubscriptions.php
示例16: if
?>
<button type="submit" class="button" name="addcouponcode" value="1" style="position:absolute;left:-9999px;top:-9999px;height:0;width:0;">Add</button>
<div class="cbregCouponsInputed">
<ul class="cbregListOfCouponsInputed">
<?php foreach ( $this->couponsUsed as $coupon ) { ?>
<li>
<span class="cbregCouponCode"><?php echo $coupon->coupon_code; ?></span><span class="cbregCouponCodeSAeparator">:</span>
<span class="cbregCouponName"><?php echo $coupon->name; ?></span>
<span class="cb_button_wrapper_small cpay_button_couponcode_wrapper cbregCouponDelete"><button type="submit" class="button" name="deletecouponcode[<?php echo $coupon->id;?>]" value="1"><?php echo CBPTXT::Th( $this->couponRemoveButtonText ); ?></button></span>
</li>
<?php } ?>
</ul>
</div>
<?php } ?>
<div class="cbregCouponInput">
<label for="cbsubscouponcode"><span><?php echo CBPTXT::Th( $this->couponLabelText ); ?></span></label>
<input name="couponcode" id="cbsubscouponcode" type="text" />
<span class="cb_button_wrapper_small cpay_button_couponcode_wrapper"><button type="submit" class="button" name="addcouponcode" value="1"><?php echo CBPTXT::Th( $this->couponAddButtonText ); ?></button></span>
<span class="cbsubscouponInstructions"><?php echo CBPTXT::Th( $this->couponDescription ); ?></span>
<?php if ( count( $this->couponDescriptionHints ) > 0 ) { ?>
<div class="cbsubscouponsHints">
<?php foreach ( $this->couponDescriptionHints as $htmlDescription ) { ?>
<div class="cbsubsCouponsHint">
<?php echo $htmlDescription; ?>
</div>
<?php } ?>
</div>
<?php } ?>
</div>
</div>
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:30,代码来源:coupon.php
示例17: getPayButtonRecepie
/**
* Returns a cbpaidGatewaySelectorButton object parameters for rendering an HTML form with a visible button and hidden fields for the gateway
* Or a string with HTML content instead (not recommended)
*
* @param cbpaidPaymentBasket $paymentBasket paymentBasket object
* @param string $subMethod 'single', 'subscribe' or gateway-specific string (e.g. credit-card brand)
* @param string $paymentType 'single' or 'subscribe' or for subscriptions 'cancel'
* @return cbpaidGatewaySelectorButton or string with HTML
*/
protected function getPayButtonRecepie( $paymentBasket, $subMethod, $paymentType )
{
// Settings for Free Trial and Order Now buttons are stored in global CBSubs settings:
$params = cbpaidApp::settingsParams();
// Generate URLs for payment:
$pspUrl = $this->pspUrl( $paymentBasket, ( $paymentType == 'subscribe' ) );
$requestParams = $this->getSinglePaymentRequstParams( $paymentBasket );
$customImage = $params->get( $this->_button . '_custom_image' );
$titleText = ( $this->_button == 'freetrial' ? CBPTXT::T("Subscribe to free trial period only") : CBPTXT::T("Confirm Order") );
$altText = ( $this->_button == 'freetrial' ? CBPTXT::T("Free Trial") : CBPTXT::T("Confirm Order") );
$butId = 'cbpaidButt' . strtolower( $this->_button );
if ( $customImage == '' ) {
$customImage = $params->get( $this->_button . '_image', 'components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/icons/cards/'
. ( $this->_button == 'freetrial' ? 'cc_big_orange_free_trial.gif' : 'cc_big_orange_confirm_order.gif' ) );
}
$payNameForCssClass = $this->_button;
return cbpaidGatewaySelectorButton::getPaymentButton( $this->getAccountParam( 'id' ), $subMethod, $paymentType, $pspUrl, $requestParams, $customImage, $altText, $titleText, $payNameForCssClass, $butId );
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:30,代码来源:cbpaidsubscriptions.freetrial.php
示例18: die
<?php
/**
* @version $Id: $
* @package CBSubs (TM) Community Builder Plugin for Paid Subscriptions (TM)
* @subpackage Template for Paid Subscriptions
* @copyright (C) 2007-2015 and Trademark of Lightning MultiCom SA, Switzerland - www.joomlapolis.com - and its licensors, all rights reserved
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU/GPL version 2
*/
/** ensure this file is being included by a parent file */
if (!(defined('_VALID_CB') || defined('_JEXEC') || defined('_VALID_MOS'))) {
die('Direct Access to this location is not allowed.');
}
$tmplVersion = 1;
// This is the template version that needs to match
?>
<div class="contentheading" id="cbregInvoicesTitle"><?php
echo $this->plansTitle;
?>
</div>
<div class="cbregLinkToInvoices">
<a href="<?php
echo $this->invoicesListUrl;
?>
">
<?php
echo CBPTXT::Th("Click here to view the list of invoices");
?>
</a>
</div>
开发者ID:jasonrgd,项目名称:Digital-Publishing-Platform-Joomla,代码行数:30,代码来源:invoiceslistlink.php
示例19: _title
/**
* Utility function to return title with description as hover
*
* @param CBSimpleXMLElement $node
* @return null|string
*/
function _title(&$node)
{
$description = $node->attributes('description');
if ($description) {
$description = CBPTXT::T($description);
$name = $node->attributes('name');
return ' title="' . htmlspecialchars($name . '|' . $description) . '"';
}
return null;
}
开发者ID:jasonrgd,项目名称:Digital-Publishing-Platform-Joomla,代码行数:16,代码来源:cbpaidParamsExt.php
示例20: _invoicesTitle
/**
* Computes text for the title of the invoices list
*
* @param int $invoicesNumber array of cbpaidPaymentBasket of Completed and Pending baskets
* @param UserTable $user reflecting the user being displayed (here null)
* @param boolean $itsmyself user is logged in user
* @param string $periodText if non-empty, text of the period showing invoices
* @return string
*/
protected function _invoicesTitle($invoicesNumber, $user, $itsmyself, $periodText)
{
global $ueConfig;
if ($itsmyself) {
if ($periodText) {
$plansTitle = sprintf(CBPTXT::Th("Your invoices of last %s"), htmlspecialchars($periodText));
} else {
if ($invoicesNumber == 1) {
$plansTitle = CBPTXT::Th("Your invoice");
} else {
$plansTitle = CBPTXT::Th("Your invoices");
}
}
} else {
if ($periodText) {
$plansTitle = sprintf(CBPTXT::Th("%s's invoices of last %s"), getNameFormat($user->name, $user->username, $ueConfig['name_format']), htmlspecialchars($periodText));
} else {
$plansTitle = sprintf(CBPTXT::Th("%s's invoices"), getNameFormat($user->na
|
请发表评论