| version 1.6, 2013/10/07 13:48:02 |
version 1.7, 2013/10/07 14:31:05 |
|
|
| * 1.03, 2012-10-02 10:20 Igor |
* 1.03, 2012-10-02 10:20 Igor |
| * 1.04, 2013-02-27 09:56 Igor |
* 1.04, 2013-02-27 09:56 Igor |
| * 1.05, 2013-08-05 16:43 Igor |
* 1.05, 2013-08-05 16:43 Igor |
| |
* 1.06, 2013-10-07 15:50 Igor |
| * |
* |
| */ |
*/ |
| |
|
| Line 57 class RotateAntispam { |
|
| Line 58 class RotateAntispam { |
|
| // vysledok kontroly odpovede |
// vysledok kontroly odpovede |
| protected $correctAnswer_cache = null; |
protected $correctAnswer_cache = null; |
| |
|
| |
// vystupne kodovanie |
| |
protected $outputEncoding = 'UTF-8'; |
| |
|
| // texty |
// texty |
| protected $texts = array( |
protected $texts = array( |
| 'title' => 'Antispam', |
'title' => 'Antispam', |
| Line 142 class RotateAntispam { |
|
| Line 146 class RotateAntispam { |
|
| $this->addLog('Nazov tlacitka pre odosielanie formulara NEBOL nastaveny'); |
$this->addLog('Nazov tlacitka pre odosielanie formulara NEBOL nastaveny'); |
| } |
} |
| |
|
| if (isset($opts['url']) |
if (isset($opts['url']) |
| && is_string($opts['url'])) |
&& is_string($opts['url'])) |
| { |
{ |
| if ($this->setUrlRotateAntispam($opts['url'])) { |
if ($this->setUrlRotateAntispam($opts['url'])) { |
| $this->addLog('URL pre RotateAntispam bola nastavena'); |
$this->addLog('URL pre RotateAntispam bola nastavena'); |
| } else { |
} else { |
| $this->addLog('URL pre RotateAntispam NEBOLA nastavena'); |
$this->addLog('URL pre RotateAntispam NEBOLA nastavena'); |
| } |
} |
| } else { |
} else { |
| $this->setError('URL pre RotateAntispam NEBOLA zadana'); |
$this->setError('URL pre RotateAntispam NEBOLA zadana'); |
| } |
} |
| |
|
| |
if (isset($opts['encoding']) |
| |
&& is_string($opts['encoding'])) |
| |
{ |
| |
if ($this->setOutputEncoding($opts['encoding'])) { |
| |
$this->addLog('Vystupne kodovanie bolo nastavene na hodnotu '.$this->outputEncoding); |
| |
} else { |
| |
$this->addLog('Vystupne kodovanie NEBOLO nastavene na hodnotu '.$opts['encoding']); |
| |
} |
| |
} |
| } |
} |
| |
|
| // ====[ Metody pre zaznamenanie chyb a logov ]============================ |
// ====[ Metody pre zaznamenanie chyb a logov ]============================ |
| /** |
/** |
| * nastavy chybovu spravu, ktoru je v mozne vyziadat pomoocu getErrorMessage() |
* nastavi chybovu spravu, ktoru je v mozne vyziadat pomoocu getErrorMessage() |
| * |
* |
| * @param string $msg - chybova sprava |
* @param string $msg - chybova sprava |
| */ |
*/ |
| Line 168 class RotateAntispam { |
|
| Line 182 class RotateAntispam { |
|
| } |
} |
| |
|
| /** |
/** |
| * nastavy chybovu spravu a priznak chyby |
* nastavi chybovu spravu a priznak chyby |
| * |
* |
| * @param string $msg - chybova sprava |
* @param string $msg - chybova sprava |
| */ |
*/ |
| Line 262 class RotateAntispam { |
|
| Line 276 class RotateAntispam { |
|
| * @return string - hodnota prisluchajuca klucu |
* @return string - hodnota prisluchajuca klucu |
| */ |
*/ |
| protected function getText($key) { |
protected function getText($key) { |
| return $this->texts[$key]; |
$ret = $this->texts[$key]; |
| |
return ($this->outputEncoding == 'UTF-8') |
| |
? $ret |
| |
: iconv('UTF-8', $this->outputEncoding, $ret); |
| } |
} |
| |
|
| /** |
/** |
| Line 299 class RotateAntispam { |
|
| Line 316 class RotateAntispam { |
|
| ); |
); |
| } |
} |
| |
|
| |
/** |
| |
* nastavi typ vystupneho kodovania |
| |
* |
| |
* @param string $encoding - nazov kodovania |
| |
* @return bool - uspech nastavenia |
| |
*/ |
| |
protected function setOutputEncoding($encoding) { |
| |
$allowEncoding = array('UTF-8', 'CP1250', 'ISO-8859-1', 'ISO-8859-2', 'WINDOWS-1250'); |
| |
$encoding = strtoupper($encoding); |
| |
if (in_array($encoding, $allowEncoding)) { |
| |
$this->outputEncoding = $encoding.'//TRANSLIT'; |
| |
return true; |
| |
} |
| |
return false; |
| |
} |
| |
|
| // ====[ Verejne metody ]================================================== |
// ====[ Verejne metody ]================================================== |
| |
|
| /** |
/** |
| Line 672 class RotateAntispam { |
|
| Line 705 class RotateAntispam { |
|
| } |
} |
| |
|
| /** |
/** |
| * nastavy ziadany text |
* nastavi ziadany text |
| * |
* |
| * @param string $key - kluc retazca |
* @param string $key - kluc retazca |
| * @param string $value - hodnota prisluchajuca klucu |
* @param string $value - hodnota prisluchajuca klucu |
| Line 683 class RotateAntispam { |
|
| Line 716 class RotateAntispam { |
|
| } |
} |
| |
|
| /** |
/** |
| * nastavy dizajn |
* nastavi dizajn |
| * |
* |
| * @param string $arr - asociativne pole prvkov |
* @param string $arr - asociativne pole prvkov |
| * @return void |
* @return void |
| Line 698 class RotateAntispam { |
|
| Line 731 class RotateAntispam { |
|
| } |
} |
| |
|
| /** |
/** |
| * nastavy dizajn jedneho elementu |
* nastavi dizajn jedneho elementu |
| * |
* |
| * @param string $key - kluc elementu |
* @param string $key - kluc elementu |
| * @param string $val - hodnota elementu |
* @param string $val - hodnota elementu |