function test_preCompile() { $oPlugin = new Plugins_DeliveryLimitations_CommaSeparatedData(); $this->assertEqual('ab,cd,ef,gh', $oPlugin->_preCompile('ab,cd,ef,gh')); $this->assertEqual('ab,cd,ef,gh', $oPlugin->_preCompile('aB,cD, ef,gh ')); $this->assertEqual('a\\b,cd,ef,gh', $oPlugin->_preCompile('a\\b,cd,ef,gh')); }
function __construct() { parent::__construct(); $phpSniff = new phpSniff('', false); $this->setAValues($phpSniff->_browsers); $this->nameEnglish = 'Client - Browser'; }
function init($data) { parent::init($data); if (is_array($this->data)) { $this->data = $this->_flattenData($this->data); } }
function _expandData($data = null) { if (!empty($data) && is_string($data)) { $offset = strpos($data, '@'); if ($offset !== false) { $data = substr($data, 0, $offset); } } return parent::_expandData($data); }
function _preCompile($sData) { $aContinentCodes = MAX_limitationsGetAFromS($sData); $aCountries = array(); foreach ($aContinentCodes as $continentCode) { $aContinentCountries = $this->res[$continentCode]; unset($aContinentCountries[0]); // Remove the name of the continent $aCountries = array_merge($aCountries, $aContinentCountries); } return parent::_preCompile(MAX_limitationsGetSFromA($aCountries)); }
/** * Method to check input data * * @param array $data Most important to check is $data['data'] field * @return bool|string true or error message */ function checkInputData($data) { $result = parent::checkInputData($data); if ($result === true) { //if parent check was OK if (is_array($data['data'])) { if (strpos($data['data'][0], '|') !== false) { return MAX_Plugin_Translation::translate('Site:Variable: Name contains unallowed character(s)', $this->extension, $this->group); } } } return true; }
function __construct() { parent::__construct(); $this->nameEnglish = 'Geo - Country'; }
function init($data) { parent::init($data); $this->aOperations['=='] = $this->translate('Is all of'); }
function __construct() { parent::__construct(); $this->nameEnglish = 'Geo - Net Speed'; }
function init($data) { parent::init($data); $this->aOperations = array('==' => $this->translate('Is within'), '!=' => $this->translate('Is not within')); }
function __construct() { parent::__construct(); $this->nameEnglish = 'GEO - Designated Market Area'; }
function init($data) { parent::init($data); $this->setAValues(array_keys($this->res)); }