ruleName = JText::translate('VBO_AMOUNT_PAYABLE_RQ'); $this->ruleDescr = sprintf('%s (%s)', JText::translate('VBO_AMOUNT_PAYABLE_RQ'), JText::translate('VBO_AMOUNT_PAYABLE')); $this->ruleId = basename(__FILE__); } /** * Displays the rule parameters. * * @return void */ public function renderParams() { ?>
vbo_app->printYesNoButtons($this->inputName('has_amount_payable'), JText::translate('VBYES'), JText::translate('VBNO'), (int)$this->getParam('has_amount_payable', 0), 1, 0); ?> Use the tag {payment_requested_amount} if you would like to display the actual amount payable in your text.
getParam('has_amount_payable', 0); if (!$has_amount_payable) { return true; } return $this->getPropVal('booking', 'payable', 0) > 0; } /** * Allows to manipulate the message of the conditional text with dynamic contents. * * @override * * @param string $msg the current conditional text message. * * @return string the manipulated conditional text message. */ public function manipulateMessage($msg) { // check if the special and internal tag was used if (strpos($msg, '{payment_requested_amount}') !== false) { // build the amount payable string $amout_payable_str = sprintf('%s %s', VikBooking::getCurrencySymb(), VikBooking::numberFormat($this->getPropVal('booking', 'payable', 0))); // exact placeholder tag found, so use the plain mark string $msg = str_replace('{payment_requested_amount}', $amout_payable_str, $msg); } // return the eventually manipulated message return $msg; } }