Source for file CurrencySwitcher.class.php
Documentation is available at CurrencySwitcher.class.php
* Содержит класс CurrencySwitcher
* @copyright ColoCall 2007
//require_once('core/modules/share/components/DBDataSet.class.php');
//require_once('core/modules/shop/components/CurrencyConverter.class.php');
* @param Document $document
public function __construct($name, $module, Document $document, array $params = null) {
parent::__construct($name, $module, $document, $params);
$this->setParam('recordsPerPage', false);
$this->setParam('onlyCurrentLang', true);
* Добавлен параметр id - идентификатор страницы
protected function main() {
$currIDField = $this->getData()->getFieldByName('curr_id');
$currRate = $this->getData()->getFieldByName('curr_rate');
$currString = new Field('curr_string');
$this->getData()->addField($currString);
foreach($currIDField as $rowID => $currencyRowData){
if($currencyRowData == $currencyConverter->getCurrent()){
$currIDField->setRowProperty($rowID, 'current', 'current');
$currencyConverter->format(
$currencyConverter->convert(
$currencyConverter->getMain()
|