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