本文整理汇总了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();