当前位置: 首页>>代码示例>>PHP>>正文


PHP CCaptcha::GetTTFFontsPath方法代码示例

本文整理汇总了PHP中CCaptcha::GetTTFFontsPath方法的典型用法代码示例。如果您正苦于以下问题:PHP CCaptcha::GetTTFFontsPath方法的具体用法?PHP CCaptcha::GetTTFFontsPath怎么用?PHP CCaptcha::GetTTFFontsPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCaptcha的用法示例。


在下文中一共展示了CCaptcha::GetTTFFontsPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: define

<?php

if (array_key_exists("Preview", $_REQUEST) && strlen($_REQUEST["Preview"]) > 0) {
    define("NO_KEEP_STATISTIC", "Y");
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/prolog.php";
if (!$USER->CanDoOperation('edit_other_settings') && !$USER->CanDoOperation('view_other_settings')) {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
$isAdmin = $USER->CanDoOperation('edit_other_settings');
IncludeModuleLangFile(__FILE__);
$arSettings = array("transparentTextPercent" => array("int", 5, 10, GetMessage("MAIN_ADM_CAPTCHA_PARAM1")), "arBGColor_1" => array("string", 6, "FFFFFF", GetMessage("MAIN_ADM_CAPTCHA_PARAM2")), "arBGColor_2" => array("string", 6, "FFFFFF", GetMessage("MAIN_ADM_CAPTCHA_PARAM3")), "numEllipses" => array("int", 5, 100, GetMessage("MAIN_ADM_CAPTCHA_PARAM4")), "arEllipseColor_1" => array("string", 6, "7F7F7F", GetMessage("MAIN_ADM_CAPTCHA_PARAM5")), "arEllipseColor_2" => array("string", 6, "FFFFFF", GetMessage("MAIN_ADM_CAPTCHA_PARAM6")), "bLinesOverText" => array("checkbox", "Y", "N", GetMessage("MAIN_ADM_CAPTCHA_PARAM7")), "numLines" => array("int", 5, 20, GetMessage("MAIN_ADM_CAPTCHA_PARAM8")), "arLineColor_1" => array("string", 6, "6E6E6E", GetMessage("MAIN_ADM_CAPTCHA_PARAM9")), "arLineColor_2" => array("string", 6, "FAFAFA", GetMessage("MAIN_ADM_CAPTCHA_PARAM10")), "textStartX" => array("int", 5, 7, GetMessage("MAIN_ADM_CAPTCHA_PARAM11")), "textFontSize" => array("int", 5, 20, GetMessage("MAIN_ADM_CAPTCHA_PARAM12")), "arTextColor_1" => array("string", 6, "000000", GetMessage("MAIN_ADM_CAPTCHA_PARAM13")), "arTextColor_2" => array("string", 6, "646464", GetMessage("MAIN_ADM_CAPTCHA_PARAM14")), "textAngel_1" => array("int", 5, -20, GetMessage("MAIN_ADM_CAPTCHA_PARAM15")), "textAngel_2" => array("int", 5, 20, GetMessage("MAIN_ADM_CAPTCHA_PARAM16")), "textDistance_1" => array("int", 5, 27, GetMessage("MAIN_ADM_CAPTCHA_PARAM17")), "textDistance_2" => array("int", 5, 32, GetMessage("MAIN_ADM_CAPTCHA_PARAM18")), "bWaveTransformation" => array("checkbox", "Y", "N", GetMessage("MAIN_ADM_CAPTCHA_PARAM19")), "bEmptyText" => array("checkbox", "Y", "N", GetMessage("MAIN_ADM_CAPTCHA_PARAM23")), "arBorderColor" => array("string", 6, "000000", GetMessage("MAIN_ADM_CAPTCHA_PARAM20")), "arTTFFiles" => array("list", array(), array("font.ttf"), GetMessage("MAIN_ADM_CAPTCHA_PARAM21")), "letters" => array("string", 35, "ABCDEFGHJKLMNPQRSTWXYZ23456789", GetMessage("MAIN_ADM_CAPTCHA_PARAM22")));
include_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/captcha.php";
$cpt = new CCaptcha();
$dh = opendir($_SERVER["DOCUMENT_ROOT"] . $cpt->GetTTFFontsPath());
if ($dh) {
    while (($file = readdir($dh)) !== false) {
        if (substr(strtolower($file), -4) === ".ttf") {
            $arSettings["arTTFFiles"][1][$file] = $file;
        }
    }
    closedir($dh);
}
$aTabs = array(array("DIV" => "fedit1", "TAB" => GetMessage("MAIN_ADM_CAPTCHA_TAB"), "ICON" => "main_settings", "TITLE" => GetMessage("MAIN_ADM_CAPTCHA_TAB_TITLE")));
$tabControl = new CAdminTabControl("tabControl", $aTabs);
if ($REQUEST_METHOD == "POST" && (strlen($save) > 0 || strlen($apply) > 0) && check_bitrix_sessid() && $isAdmin) {
    foreach ($arSettings as $key => $value) {
        if ($key === "letters") {
            $strChars = strtoupper($_POST[$key]);
            $arChars = array();
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:captcha.php


注:本文中的CCaptcha::GetTTFFontsPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。