public function import(\SimpleXMLElement $sx) { if (isset($sx->systemcaptcha)) { foreach ($sx->systemcaptcha->library as $th) { $pkg = static::getPackageObject($th['package']); $scl = Library::getByHandle((string) $th['handle']); if (!is_object($scl)) { $scl = Library::add($th['handle'], $th['name'], $pkg); } if ($th['activated'] == '1') { $scl->activate(); } } } }
public function update_captcha() { if (Loader::helper("validation/token")->validate('update_captcha')) { $scl = SystemCaptchaLibrary::getByHandle($this->post('activeCaptcha')); if (is_object($scl)) { $scl->activate(); if ($scl->hasOptionsForm() && $this->post('ccm-submit-submit')) { $controller = $scl->getController(); $controller->saveOptions($this->post()); } $this->redirect('/dashboard/system/permissions/captcha', 'captcha_saved'); } else { $this->error->add(t('Invalid captcha library.')); } } else { $this->error->add(Loader::helper('validation/token')->getErrorMessage()); } $this->view(); }
public function skipItem() { $library = Library::getByHandle($this->object->getHandle()); return is_object($library); }