本文整理汇总了PHP中AppContext::get_captcha_service方法的典型用法代码示例。如果您正苦于以下问题:PHP AppContext::get_captcha_service方法的具体用法?PHP AppContext::get_captcha_service怎么用?PHP AppContext::get_captcha_service使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppContext
的用法示例。
在下文中一共展示了AppContext::get_captcha_service方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param Captcha $captcha The captcha to use. If not given, a default captcha will be used.
*/
public function __construct($id = 'captcha')
{
global $LANG;
$this->captcha = AppContext::get_captcha_service()->get_default_factory();
$field_options = $this->is_enabled() ? array('required' => true) : array();
parent::__construct($id, LangLoader::get_message('form.captcha', 'common'), false, $field_options);
}
示例2: retrieve
$title = retrieve(POST, 'title', '');
$encoded_title = retrieve(GET, 'title', '');
$contents = wiki_parse(retrieve(POST, 'contents', '', TSTRING_AS_RECEIVED));
$contents_preview = retrieve(POST, 'contents', '', TSTRING_UNCHANGE);
$id_cat = retrieve(GET, 'id_parent', 0);
$new_id_cat = retrieve(POST, 'id_cat', 0);
$id_cat = $id_cat > 0 ? $id_cat : $new_id_cat;
$preview = retrieve(POST, 'preview', false);
$id_edit_get = retrieve(GET, 'id', 0);
$id_edit = $id_edit > 0 ? $id_edit : $id_edit_get;
require_once '../kernel/header.php';
$categories = WikiCategoriesCache::load()->get_categories();
//Variable d'erreur
$error = '';
$tpl = new FileTemplate('wiki/post.tpl');
$captcha = AppContext::get_captcha_service()->get_default_factory();
if (!empty($contents)) {
include_once '../wiki/wiki_functions.php';
//On crée le menu des paragraphes et on enregistre le menu
$menu = '';
//Si on détecte la syntaxe des menus alors on lance les fonctions, sinon le menu sera vide et non affiché
if (preg_match('`[\\-]{2,6}`isU', $contents)) {
$menu_list = wiki_explode_menu($contents);
//On éclate le menu en tableaux
$menu = wiki_display_menu($menu_list);
//On affiche le menu
}
if ($preview) {
$tpl->assign_block_vars('preview', array('CONTENTS' => FormatingHelper::second_parse(wiki_no_rewrite(stripslashes($contents))), 'TITLE' => stripslashes($title)));
if (!empty($menu)) {
$tpl->assign_block_vars('preview.menu', array('MENU' => $menu));
示例3: uninstall
public function uninstall()
{
ConfigManager::delete('question-captcha', 'config');
return AppContext::get_captcha_service()->uninstall_captcha('QuestionCaptcha');
}
示例4: generate_captcha_available_option
private function generate_captcha_available_option()
{
$options = array();
$captchas = AppContext::get_captcha_service()->get_available_captchas();
foreach ($captchas as $identifier => $name) {
$options[] = new FormFieldSelectChoiceOption($name, $identifier);
}
return $options;
}
示例5: uninstall
public function uninstall()
{
return AppContext::get_captcha_service()->uninstall_captcha('ReCaptcha');
}