本文整理汇总了PHP中System_Element函数的典型用法代码示例。如果您正苦于以下问题:PHP System_Element函数的具体用法?PHP System_Element怎么用?PHP System_Element使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了System_Element函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: HTTP_Send
function HTTP_Send($Target, $Settings, $Get = array(), $Post = array(), $Addins = array())
{
/******************************************************************************/
$__args_types = array('string', 'array', 'array', 'string,array', 'array');
#-------------------------------------------------------------------------------
$__args__ = Func_Get_Args();
eval(FUNCTION_INIT);
/******************************************************************************/
$Default = array('Protocol' => 'tcp', 'Address' => 'localhost', 'Port' => 8080, 'Host' => 'localhost', 'Basic' => '', 'Charset' => 'UTF-8', 'Hidden' => '', 'IsLogging' => TRUE);
#-------------------------------------------------------------------------------
Array_Union($Default, $Settings);
#-------------------------------------------------------------------------------
$IsLogging = (bool) $Default['IsLogging'];
#-------------------------------------------------------------------------------
$Tmp = System_Element('tmp');
if (Is_Error($Tmp)) {
return ERROR | @Trigger_Error('[HTTP_Send]: не удалось определить путь временной директории');
}
#-------------------------------------------------------------------------------
$Config = Config();
#-------------------------------------------------------------------------------
$Address = $Default['Address'];
#-------------------------------------------------------------------------------
Debug(SPrintF('[HTTP_Send]: соединяемся с (%s:%u)', $Address, $Default['Port']));
#-------------------------------------------------------------------------------
# https://bugs.php.net/bug.php?id=52913
# пришлось заменить: $Address -> $Default['Host']
$Socket = @FsockOpen(SPrintF('%s://%s', $Protocol = $Default['Protocol'], $Default['Host']), $Port = $Default['Port'], $nError, $sError, $Config['Other']['Libs']['HTTP']['SocketTimeout']);
if (!Is_Resource($Socket)) {
#-------------------------------------------------------------------------------
$IsWrite = IO_Write(SPrintF('%s/logs/http-send.log', $Tmp), SPrintF("%s://%s:%u ошибка соединения\n\n", $Protocol, $Address, $Port));
if (Is_Error($IsWrite)) {
return ERROR | @Trigger_Error('[HTTP_Send]: не удалось записать данные в лог файл');
}
#-------------------------------------------------------------------------------
return ERROR | @Trigger_Error('[HTTP_Send]: не удалось соединиться с удаленным хостом');
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
# added by lissyara, 2012-01-04 in 08:42:54 MSK, for JBS-130
Stream_Set_TimeOut($Socket, $Config['Other']['Libs']['HTTP']['StreamTimeout']);
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Charset = $Default['Charset'];
#-------------------------------------------------------------------------------
$Method = Count($Post) > 0 ? 'POST' : 'GET';
#-------------------------------------------------------------------------------
$Hidden = $Default['Hidden'];
#-------------------------------------------------------------------------------
if (Count($Get)) {
$Target .= SPrintF('?%s', HTTP_Query($Get, $Charset, $Hidden, $IsLogging));
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Headers[] = SPrintF('%s %s HTTP/1.0', $Method, $Target);
#-------------------------------------------------------------------------------
$Headers[] = SPrintF('Host: %s', $Default['Host']);
#-------------------------------------------------------------------------------
$Headers[] = 'Connection: close';
#-------------------------------------------------------------------------------
$Headers = Array_Merge($Headers, $Addins);
#-------------------------------------------------------------------------------
if ($Basic = $Default['Basic']) {
#-------------------------------------------------------------------------------
$Basic = Base64_Encode($Basic);
#-------------------------------------------------------------------------------
$Headers[] = SPrintF('Authorization: Basic %s', $Basic);
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
$Body = '';
#-------------------------------------------------------------------------------
if ($Post) {
#-------------------------------------------------------------------------------
if (Is_Array($Post)) {
#-------------------------------------------------------------------------------
if (Count($Post) > 0) {
#-------------------------------------------------------------------------------
$Headers[] = 'Content-Type: application/x-www-form-urlencoded';
#-------------------------------------------------------------------------------
$Body = HTTP_Query($Post, $Charset, $Hidden, $IsLogging);
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
} else {
#-------------------------------------------------------------------------------
$Body = Mb_Convert_Encoding($Post, $Charset);
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
if ($Length = MB_StrLen($Body, 'ASCII')) {
$Headers[] = SPrintF('Content-Length: %u', $Length);
}
#-------------------------------------------------------------------------------
$Query = SPrintF("%s\r\n\r\n%s", Implode("\r\n", $Headers), $Body);
#-------------------------------------------------------------------------------
Debug(SPrintF("[HTTP_Send]: делаем запрос:\n%s", $Query));
#-------------------------------------------------------------------------------
//.........这里部分代码省略.........
示例2: Upload_Get
function Upload_Get($Name, $Hash = FALSE)
{
/****************************************************************************/
#$__args_types = Array('string');
#-----------------------------------------------------------------------------
$__args__ = Func_Get_Args();
eval(FUNCTION_INIT);
/****************************************************************************/
$Args = Args();
#-----------------------------------------------------------------------------
$Hash = isset($Args[$Name]) ? $Args[$Name] : $Hash;
#-----------------------------------------------------------------------------
if (!$Hash) {
return new gException('HASH_IS_EMPTY', 'Хешь файла загрузки пуст');
}
#-----------------------------------------------------------------------------
$Tmp = System_Element('tmp');
if (Is_Error($Tmp)) {
return ERROR | @Trigger_Error('[Upload_Get]: не удалось получить путь до временной директории');
}
#-----------------------------------------------------------------------------
$Uploads = SPrintF('%s/uploads', $Tmp);
#-----------------------------------------------------------------------------
if (!File_Exists($Uploads)) {
return new gException('HASH_IS_EMPTY', 'Директория файлов загрузки не создана');
}
#-----------------------------------------------------------------------------
$Path = SPrintF('%s/%s', $Uploads, $Hash);
#-----------------------------------------------------------------------------
if (!File_Exists($Path)) {
return new gException('FILE_NOT_FOUND', 'Файл не найден на сервере');
}
#-----------------------------------------------------------------------------
$Data = IO_Read($Path);
if (Is_Error($Data)) {
return ERROR | @Trigger_Error('[Upload_Get]: не удалось прочитать файл');
}
#-----------------------------------------------------------------------------
$Names = IO_Read(SPrintF('%s/names.txt', $Uploads));
if (Is_Error($Names)) {
return ERROR | @Trigger_Error('[Upload_Get]: не удалось прочитать файл имен');
}
#-----------------------------------------------------------------------------
$Names = JSON_Decode($Names, TRUE);
#-----------------------------------------------------------------------------
$Name = isset($Names[$Hash]) ? $Names[$Hash] : 'Default';
#-----------------------------------------------------------------------------
return array('Name' => $Name, 'Data' => $Data);
}
示例3: TemplateReplace
function TemplateReplace($Text, $Params = array(), $NoBody = TRUE)
{
#-------------------------------------------------------------------------------
$Text = Trim($Text);
#-------------------------------------------------------------------------------
# проверяем что нам сунули - текст или файл
if (!Preg_Match('/\\s/', $Text)) {
#-------------------------------------------------------------------------------
# достаём текст из файла
$Path = System_Element(SPrintF('templates/modules/%s.html', $Text));
#-------------------------------------------------------------------------------
if (Is_Error($Path)) {
#-------------------------------------------------------------------------------
$Text = SprintF('Отсутствует шаблон сообщения (templates/modules/%s.html)', $Text);
#-------------------------------------------------------------------------------
} else {
#-------------------------------------------------------------------------------
$Text = Trim(IO_Read($Path));
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if ($NoBody) {
$Text = SPrintF('<NOBODY><SPAN>%s</SPAN></NOBODY>', $Text);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Replace = Array_ToLine($Params, '%');
#-------------------------------------------------------------------------------
foreach (Array_Keys($Replace) as $Key) {
$Text = Str_Replace($Key, $Replace[$Key], $Text);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return $Text;
#-------------------------------------------------------------------------------
}
示例4: initLang
private function initLang()
{
if (isset($_GET['lang'])) {
$this->currentLang = $_GET['lang'];
} else {
if (isset($_COOKIE['lang'])) {
$this->currentLang = $_COOKIE['lang'];
} else {
$this->currentLang = self::DFLT_LANG;
}
}
if (!in_array($this->currentLang, $this->supportedLang)) {
$this->currentLang = self::DFLT_LANG;
}
setcookie('lang', $this->currentLang);
$langPath = System_Element('templates/lang/' . $this->currentLang . '.php');
$langMsgs = (include_once $langPath);
//die(print_r($langMsgs,true));
if (count($langMsgs) > 0) {
$this->assign('a', "2.5.2");
$this->assign('LANG', $langMsgs);
}
}
示例5: Debug
continue;
#-------------------------------------------------------------------------------
} else {
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Triggers/GLOBAL]: цена на услугу ноль (%s) или IsZeroPricePay = FALSE', $CostPay));
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# оплачиваем услугу на минимальное число дней (или юзать параметры? или юзать срок оплаты основной услуги?)
$Array = array($OrderID => $ExistsOrderID, 'DaysPay' => $Scheme['MinDaysPay'], 'IsNoBasket' => TRUE, 'PayMessage' => SPrintF('Автоматическая оплата зависимой услуги, группа серверов #%u, "%s"', $ServersGroup['ID'], $ServersGroup['Name']));
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Path = SPrintF('www/API/%sOrderPay', $Service['Code']);
#-------------------------------------------------------------------------------
if (Is_Error(System_Element(SPrintF('comp/%s.comp.php', $Path)))) {
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Triggers/GLOBAL]: API для заказа сервиса не найдено: %s', $Path));
#-------------------------------------------------------------------------------
continue;
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$OrderPay = Comp_Load($Path, $Array);
#-------------------------------------------------------------------------------
switch (ValueOf($OrderPay)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
# No more...
示例6: array
<?php
#-------------------------------------------------------------------------------
/** @author Великодный В.В. (Joonte Ltd.) */
/******************************************************************************/
/******************************************************************************/
$__args_list = array('Element');
/******************************************************************************/
eval(COMP_INIT);
/******************************************************************************/
/******************************************************************************/
$Path = System_Element($Element);
if (Is_Error($Path)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$File = IO_Read($Path);
if (Is_Error($File)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
return $File;
#-------------------------------------------------------------------------------
示例7: SPrintF
} else {
$Where = SPrintF("`Partition` = '%s'", addslashes($__URI));
#-------------------------------------------------------------------------------
$Clauses = DB_Select('Clauses', 'ID', array('Where' => $Where));
#-------------------------------------------------------------------------------
if (Is_Array($Clauses)) {
#-----------------------------------------------------------------------------
$Clause = Current($Clauses);
#-----------------------------------------------------------------------------
$Args['ClauseID'] = $Clause['ID'];
#-----------------------------------------------------------------------------
$__URI = '/Clause';
}
}
#-------------------------------------------------------------------------------
$IsElement = System_Element(SPrintF('comp/www%s.comp.php', $__URI));
#-------------------------------------------------------------------------------
if (Is_Error($IsElement)) {
#-----------------------------------------------------------------------------
$__URI =& $GLOBALS['__URI'];
#-----------------------------------------------------------------------------
$__URI = '/404';
}
#-------------------------------------------------------------------------------
if (!In_Array($__URI, array('/Update', '/Patches'))) {
#-----------------------------------------------------------------------------
$Session = new Session((string) @$_COOKIE['SessionID']);
#-----------------------------------------------------------------------------
$IsLoad = $Session->Load();
if (!Is_Error($IsLoad)) {
#---------------------------------------------------------------------------
示例8: System_Read
function System_Read($Element)
{
#-----------------------------------------------------------------------------
$Path = System_Element($Element);
if (Is_Error($Path)) {
return ERROR | @Trigger_Error('[System_Read]: не удалось найти элемент');
}
#-----------------------------------------------------------------------------
$Result = IO_Read($Path);
if (Is_Error($Result)) {
return ERROR | @Trigger_Error('[System_Read]: не удалось прочитать данные');
}
#-----------------------------------------------------------------------------
return $Result;
}
示例9: Build
/**
* Формирует объект
*
* Сформировывает объект класса DOM и подготавливает к выводу в браузер. После
* вызова этой функции переменная, куда записывался результат выполнения функции
* выводится с помощью оператора echo.
*
* @param boolean <необходимость преобразования в XML строку>
*/
public function Build($IsToXML = TRUE)
{
#-----------------------------------------------------------------------------
if ($this->TemplateID) {
#---------------------------------------------------------------------------
$Trigger = SPrintF('Triggers/DOM/After/%s', $this->TemplateID);
#---------------------------------------------------------------------------
if (!Is_Error(System_Element(SPrintF('comp/%s.comp.php', $Trigger)))) {
#-------------------------------------------------------------------------
$LinkID = UniqID('DOM-');
#-------------------------------------------------------------------------
$Links =& Links();
# Коллекция ссылок
$Links[$LinkID] =& $this;
#-------------------------------------------------------------------------
if (Is_Error(Comp_Load($Trigger, $LinkID, COMP_ALL_HOSTS))) {
return ERROR | @Trigger_Error('[DOM->Build]: ошибка загрузки предобработчика');
}
#-------------------------------------------------------------------------
unset($Links[$LinkID]);
}
}
#-----------------------------------------------------------------------------
# Номализация документа
$this->Normalize();
#-----------------------------------------------------------------------------
$this->Apply('Sources');
#-----------------------------------------------------------------------------
if ($IsToXML) {
#---------------------------------------------------------------------------
$Result = $this->Object->ToXMLString();
if (Is_Error($Result)) {
return ERROR | Trigger_Error('[DOM->Build]: не удалось преобразовать DOM в строку');
}
#---------------------------------------------------------------------------
return SPrintF("<!-- Joonte Billing System http://www.joonte.com -->\n%s", $Result);
}
#-----------------------------------------------------------------------------
return TRUE;
}
示例10: DB_Select
#---------------------------------------------------------------------------
$Items = DB_Select('InvoicesItems', $Columns, array('SortOn' => 'Summ', 'IsDesc' => TRUE, 'Where' => SPrintF('`InvoiceID` = %u', $Invoice['ID'])));
#---------------------------------------------------------------------------
switch (ValueOf($Items)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
# No more...
break;
case 'array':
#-----------------------------------------------------------------------
foreach ($Items as $Item) {
#---------------------------------------------------------------------
$Path = SPrintF('Services/%u', $Item['ServiceID']);
#---------------------------------------------------------------------
$Element = System_Element(SPrintF('comp/%s.comp.php', $Path));
if (!Is_Error($Element)) {
#-------------------------------------------------------------------
$Comp = Comp_Load($Path, $Item);
#-------------------------------------------------------------------
switch (ValueOf($Comp)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
#---------------------------------------------------------------
$Number = Comp_Load('Formats/Order/Number', $Item['OrderID']);
if (Is_Error($Number)) {
return ERROR | @Trigger_Error(500);
}
#---------------------------------------------------------------
$Event = array('UserID' => $Invoice['UserID'], 'PriorityID' => 'Error', 'Text' => SPrintF('Не удалось произвести автоматическую оплату заказа №%s, причина (%s)', $Number, $Comp->String));
示例11: HTMLDoc_CreatePDF
function HTMLDoc_CreatePDF($ModeID, $HTML, $Prefix = '/')
{
/****************************************************************************/
$__args_types = array('string', 'string,object', 'string');
#-----------------------------------------------------------------------------
$__args__ = Func_Get_Args();
eval(FUNCTION_INIT);
/****************************************************************************/
if (Is_Object($HTML)) {
#---------------------------------------------------------------------------
$Tables = $HTML->GetByTagName('TABLE');
#---------------------------------------------------------------------------
for ($i = 0; $i < Count($Tables); $i++) {
#-------------------------------------------------------------------------
$Table =& $Tables[$i];
#-------------------------------------------------------------------------
switch (@$Table->Attribs['class']) {
case 'Standard':
$Table->AddAttribs(array('border' => 2, 'cellspacing' => 0, 'cellpadding' => 5), TRUE);
break;
default:
# No more...
}
}
#---------------------------------------------------------------------------
$Tds = $HTML->GetByTagName('TD');
#---------------------------------------------------------------------------
for ($i = 0; $i < Count($Tds); $i++) {
#-------------------------------------------------------------------------
$Td =& $Tds[$i];
#-------------------------------------------------------------------------
switch (@$Td->Attribs['class']) {
case 'Head':
$Td->AddAttribs(array('bgcolor' => '#ADC1F0'), TRUE);
break;
case 'Separator':
$Td->AddAttribs(array('bgcolor' => '#EAEAEA'), TRUE);
break;
default:
# No more...
}
}
#---------------------------------------------------------------------------
$Imgs = $HTML->GetByTagName('IMG');
#---------------------------------------------------------------------------
for ($i = 0; $i < Count($Imgs); $i++) {
#-------------------------------------------------------------------------
$Img =& $Imgs[$i];
#-------------------------------------------------------------------------
$Img->AddAttribs(array('src' => SPrintF('%s/%s', $Prefix, $Img->Attribs['src'])), TRUE);
}
#---------------------------------------------------------------------------
$HTML = $HTML->Build();
}
#-----------------------------------------------------------------------------
$Config = Config();
#-----------------------------------------------------------------------------
$Settings = $Config['HTMLDOC'];
#-----------------------------------------------------------------------------
$Modes = $Settings['Modes'];
#-----------------------------------------------------------------------------
$Mode = isset($Modes[$ModeID]) ? $Modes[$ModeID] : $ModeID;
#-----------------------------------------------------------------------------
$Tmp = System_Element('tmp');
if (Is_Error($Tmp)) {
return ERROR | @Trigger_Error('[HTMLDoc_CreatePDF]: временная папка не найдена');
}
#-----------------------------------------------------------------------------
$Logs = SPrintF('%s/logs', $Tmp);
#-----------------------------------------------------------------------------
if (!File_Exists($Logs)) {
#---------------------------------------------------------------------------
if (!@MkDir($Logs, 0777, TRUE)) {
return ERROR | @Trigger_Error(500);
}
}
#-----------------------------------------------------------------------------
$HTML = @Mb_Convert_Encoding($HTML, $Settings['ConvertToCharset']);
if (!$HTML) {
return ERROR | @Trigger_Error('[HTMLDoc_CreatePDF]: не удалось преобразовать кодировку');
}
#-----------------------------------------------------------------------------
$UniqID = UniqID('HTMLDOC');
#-----------------------------------------------------------------------------
$File = IO_Write($Path = SPrintF('%s/%s', $Tmp, $UniqID), $HTML);
Debug($File);
if (Is_Error($File)) {
return ERROR | @Trigger_Error('[HTMLDoc_CreatePDF]: не удалось создать временный файл');
}
#-----------------------------------------------------------------------------
$Command = SPrintF('htmldoc %s %s', $Mode, $Path);
#-----------------------------------------------------------------------------
Debug($Command);
#-----------------------------------------------------------------------------
if (!PutENV('HTMLDOC_NOCGI=1')) {
return ERROR | @Trigger_Error('[HTMLDoc_CreatePDF]: не удалось установить переменную окружения HTMLDOC_NOCGI');
}
#-----------------------------------------------------------------------------
$HTMLDOC = @Proc_Open($Command, array(array('pipe', 'r'), array('pipe', 'w'), array('file', $Log = SPrintF('%s/HTMLDOC.log', $Logs), 'a')), $Pipes);
if (!Is_Resource($HTMLDOC)) {
//.........这里部分代码省略.........
示例12: Debug
$Task['Result'] = NULL;
$TaskResult = NULL;
}
#-------------------------------------------------------------------------------
Debug(SPrintF("[Tasks/GC]: Массив задач: %s", Implode(', ', $TasksArray)));
#-------------------------------------------------------------------------------
if ($NowTask) {
$TaskCount = 0;
# Формируем массив параметров для передачи в задачу
# $TaskParams = Array();
# foreach(Array_Keys($Settings) as $Key){
# if(!Is_Array($Settings[$Key]))
# $TaskParams[$Key] = $Settings[$Key];
#-----------------------------------------------------------------------------
# Ищем обработчик и если он есть вызываем его
if (!Is_Error(System_Element(SPrintF('comp/Tasks/GC/%s.comp.php', $NowTask)))) {
#---------------------------------------------------------------------------
Debug(SPrintF("[Tasks/GC]: Выполняем %s", $NowTask));
$GLOBALS['TaskReturnInfo'] = $NowTask;
#---------------------------------------------------------------------------
$__SYSLOG =& $GLOBALS['__SYSLOG'];
#---------------------------------------------------------------------------
$Index = Count($__SYSLOG);
#---------------------------------------------------------------------------
# $Params = (array)$TaskParams;
# Array_UnShift($Params,$TaskParams);
# Array_UnShift($Params,$Path = SPrintF('Tasks/GC/%s',$NowTask));
$Params = $Settings;
Array_UnShift($Params, $Settings);
Array_UnShift($Params, $Path = SPrintF('Tasks/GC/%s', $NowTask));
#---------------------------------------------------------------------------
示例13: Delete
public function Delete()
{
#-----------------------------------------------------------------------------
$SessionID = $this->SessionID;
#-----------------------------------------------------------------------------
if (!$SessionID) {
return ERROR | @Trigger_Error('[Session->Delete]: пустой идентификатор сессии');
}
#-----------------------------------------------------------------------------
$Tmp = System_Element('tmp');
if (Is_Error($Tmp)) {
return ERROR | @Trigger_Error('[Session->Delete]: не удалось найти временную папку');
}
#-----------------------------------------------------------------------------
if (!UnLink(SPrintF('%s/sessions/%s', $Tmp, $SessionID))) {
return ERROR | @Trigger_Error('[Session->Delete]: не удалось удалить файл сессии');
}
#-----------------------------------------------------------------------------
return TRUE;
}
示例14: array
$Links['DOM'] =& $DOM;
#-------------------------------------------------------------------------------
if (Is_Error($DOM->Load('Base'))) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$DOM->AddAttribs('MenuLeft', array('args' => 'Administrator/AddIns'));
#-------------------------------------------------------------------------------
$DOM->AddText('Title', 'Дополнения → Мастера настройки → Базовый шаблон');
#-------------------------------------------------------------------------------
$Script = new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/Pages/Administrator/BaseEdit.js}'));
#-------------------------------------------------------------------------------
$DOM->AddChild('Head', $Script);
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Element = System_Element('templates/Base.xml');
if (Is_Error($Element)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Base = IO_Read($Element);
if (Is_Error($Base)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
$Table = array();
#-------------------------------------------------------------------------------
$Comp = Comp_Load('CodePress', 'Base', 'html', $Base);
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error(500);
}
示例15: gException
#-------------------------------------------------------------------------------
if (!$Partition) {
return new gException('PARTITION_IS_EMPTY', 'Введите раздел статьи');
}
#-------------------------------------------------------------------------------
if (!$Title) {
return new gException('TITLE_IS_EMPTY', 'Введите заголовок статьи');
}
#-------------------------------------------------------------------------------
$Text = Str_Replace('<p>\\s{1,}</p>', '', Str_Replace(' ', '', $Text));
#-------------------------------------------------------------------------------
if ($IsXML) {
#-----------------------------------------------------------------------------
if (Function_Exists('Tidy_Repair_String')) {
#---------------------------------------------------------------------------
$Config = System_Element('config/tidy.conf');
if (Is_Error($Config)) {
return ERROR | @Trigger_Error(500);
}
#---------------------------------------------------------------------------
$Tidy = @Tidy_Repair_String($Text, $Config, 'UTF8');
#---------------------------------------------------------------------------
if ($Tidy) {
$Text = $Tidy;
}
}
#-----------------------------------------------------------------------------
if ($IsDOM) {
#---------------------------------------------------------------------------
$Text = SPrintF('<NOBODY>%s</NOBODY>', $Text);
#---------------------------------------------------------------------------