本文整理汇总了PHP中Array_Keys函数的典型用法代码示例。如果您正苦于以下问题:PHP Array_Keys函数的具体用法?PHP Array_Keys怎么用?PHP Array_Keys使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Array_Keys函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: XML_Read
function XML_Read($Object, $Level = 1)
{
#-----------------------------------------------------------------------------
static $Index = 1;
#-----------------------------------------------------------------------------
$Md5 = Md5($Index++);
#-----------------------------------------------------------------------------
$Attribs = $Object->Attribs;
#-----------------------------------------------------------------------------
$Name = isset($Attribs['comment']) ? $Attribs['comment'] : $Object->Name;
#-----------------------------------------------------------------------------
$P = new Tag('P', array('class' => 'NodeName', 'onclick' => SPrintF("TreeSwitch('%s');", $Md5)), new Tag('IMG', array('align' => 'left', 'src' => 'SRC:{Images/Icons/Node.gif}')), new Tag('SPAN', $Name));
#-----------------------------------------------------------------------------
$Node = new Tag('DIV', array('class' => 'Node'), $P);
#-----------------------------------------------------------------------------
if (Count($Attribs)) {
#---------------------------------------------------------------------------
foreach (Array_Keys($Attribs) as $AttribID) {
$Node->AddChild(new Tag('P', array('class' => 'NodeParam'), new Tag('SPAN', SPrintF('%s: ', $AttribID)), new Tag('SPAN', array('class' => 'NodeParam'), $Attribs[$AttribID])));
}
}
#-----------------------------------------------------------------------------
if (Count($Childs = $Object->Childs)) {
#---------------------------------------------------------------------------
$Content = new Tag('DIV', array('style' => 'display:none;'), array('id' => $Md5));
#---------------------------------------------------------------------------
foreach ($Childs as $Child) {
$Content->AddChild(XML_Read($Child, $Level + 1));
}
#---------------------------------------------------------------------------
$Node->AddChild($Content);
}
#-----------------------------------------------------------------------------
return $Node;
}
示例2: TVL_Create
function TVL_Create($TVL)
{
/****************************************************************************/
$__args_types = array('array');
#-----------------------------------------------------------------------------
$__args__ = Func_Get_Args();
eval(FUNCTION_INIT);
/****************************************************************************/
$Result = '';
#-----------------------------------------------------------------------------
foreach (Array_Keys($TVL) as $WordID) {
#---------------------------------------------------------------------------
$Word = $TVL[$WordID];
#---------------------------------------------------------------------------
if (!Is_Array($Word)) {
$Size = StrLen($Word);
} else {
$Word = Bytes_I2B($Size = Next($Word), Prev($Word));
}
#---------------------------------------------------------------------------
$Result .= Bytes_I2B(WORD, HexDec($WordID)) . Bytes_I2B(WORD, $Size) . $Word;
# Значение
}
#-----------------------------------------------------------------------------
return $Result;
}
示例3: __IRM_InitReservation
function __IRM_InitReservation($iblockId)
{
$arResult = array();
$arResult["ALLOWED_FIELDS"] = array("ID" => array("NAME" => GetMessage("INAF_F_ID"), "ORDERABLE" => true, "FILTERABLE" => true, "TYPE" => "int", "IS_FIELD" => true), "NAME" => array("NAME" => GetMessage("INAF_F_NAME"), "ORDERABLE" => true, "FILTERABLE" => true, "TYPE" => "string", "IS_FIELD" => true), "DESCRIPTION" => array("NAME" => GetMessage("INAF_F_DESCRIPTION"), "ORDERABLE" => false, "FILTERABLE" => false, "TYPE" => "text", "IS_FIELD" => true), "UF_FLOOR" => array("NAME" => GetMessage("INAF_F_FLOOR"), "ORDERABLE" => true, "FILTERABLE" => true, "TYPE" => "integer", "IS_FIELD" => false), "UF_PLACE" => array("NAME" => GetMessage("INAF_F_PLACE"), "ORDERABLE" => true, "FILTERABLE" => true, "TYPE" => "integer", "IS_FIELD" => false), "UF_PHONE" => array("NAME" => GetMessage("INAF_F_PHONE"), "ORDERABLE" => false, "FILTERABLE" => false, "TYPE" => "string", "IS_FIELD" => false));
$arUserFields = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("IBLOCK_" . $iblockId . "_SECTION", 0, LANGUAGE_ID);
$arKeys = Array_Keys($arResult["ALLOWED_FIELDS"]);
foreach ($arKeys as $key) {
if (!$arResult["ALLOWED_FIELDS"][$key]["IS_FIELD"]) {
if (!Array_Key_Exists($key, $arUserFields)) {
$arFields = array("ENTITY_ID" => "IBLOCK_" . $iblockId . "_SECTION", "FIELD_NAME" => $key, "USER_TYPE_ID" => $arResult["ALLOWED_FIELDS"][$key]["TYPE"]);
$obUserField = new CUserTypeEntity();
$obUserField->Add($arFields);
}
}
}
$arResult["ALLOWED_ITEM_PROPERTIES"] = array("UF_PERSONS" => array("NAME" => GetMessage("INTASK_C29_UF_PERSONS"), "ACTIVE" => "Y", "SORT" => 300, "CODE" => "UF_PERSONS", "PROPERTY_TYPE" => "N", "USER_TYPE" => false, "ROW_COUNT" => 1, "COL_COUNT" => 5, "LINK_IBLOCK_ID" => 0, "WITH_DESCRIPTION" => "N", "FILTRABLE" => "Y", "SEARCHABLE" => "Y", "MULTIPLE" => "N", "MULTIPLE_CNT" => 5, "IS_REQUIRED" => "N", "FILE_TYPE" => "jpg, gif, bmp, png, jpeg", "LIST_TYPE" => "L", "IBLOCK_ID" => $iblockId), "UF_RES_TYPE" => array("NAME" => GetMessage("INTASK_C29_UF_RES_TYPE"), "ACTIVE" => "Y", "SORT" => 200, "CODE" => "UF_RES_TYPE", "PROPERTY_TYPE" => "L", "USER_TYPE" => false, "ROW_COUNT" => 1, "COL_COUNT" => 30, "LINK_IBLOCK_ID" => 0, "WITH_DESCRIPTION" => "N", "FILTRABLE" => "Y", "SEARCHABLE" => "Y", "MULTIPLE" => "N", "MULTIPLE_CNT" => 5, "IS_REQUIRED" => "Y", "FILE_TYPE" => "jpg, gif, bmp, png, jpeg", "LIST_TYPE" => "L", "IBLOCK_ID" => $iblockId, "VALUES" => array(array("VALUE" => GetMessage("INTASK_C29_UF_RES_TYPEA"), "DEF" => "Y", "SORT" => 100, "XML_ID" => "A"), array("VALUE" => GetMessage("INTASK_C29_UF_RES_TYPEB"), "DEF" => "N", "SORT" => 200, "XML_ID" => "B"), array("VALUE" => GetMessage("INTASK_C29_UF_RES_TYPEC"), "DEF" => "N", "SORT" => 200, "XML_ID" => "C"), array("VALUE" => GetMessage("INTASK_C29_UF_RES_TYPED"), "DEF" => "N", "SORT" => 300, "XML_ID" => "D"))), "UF_PREPARE_ROOM" => array("NAME" => GetMessage("INTASK_C29_UF_PREPARE_ROOM"), "ACTIVE" => "Y", "SORT" => 500, "CODE" => "UF_PREPARE_ROOM", "PROPERTY_TYPE" => "S", "USER_TYPE" => false, "DEFAULT_VALUE" => "Y", "ROW_COUNT" => 1, "COL_COUNT" => 30, "LINK_IBLOCK_ID" => 0, "WITH_DESCRIPTION" => "N", "FILTRABLE" => "N", "SEARCHABLE" => "N", "MULTIPLE" => "N", "MULTIPLE_CNT" => 5, "IS_REQUIRED" => "N", "FILE_TYPE" => "jpg, gif, bmp, png, jpeg", "LIST_TYPE" => "L", "IBLOCK_ID" => $iblockId), "PERIOD_TYPE" => array("NAME" => GetMessage("INTASK_C29_PERIOD_TYPE"), "ACTIVE" => "Y", "SORT" => 500, "CODE" => "PERIOD_TYPE", "PROPERTY_TYPE" => "S", "USER_TYPE" => false, "DEFAULT_VALUE" => "NONE", "ROW_COUNT" => 1, "COL_COUNT" => 30, "LINK_IBLOCK_ID" => 0, "WITH_DESCRIPTION" => "N", "FILTRABLE" => "N", "SEARCHABLE" => "N", "MULTIPLE" => "N", "MULTIPLE_CNT" => 5, "IS_REQUIRED" => "N", "FILE_TYPE" => "jpg, gif, bmp, png, jpeg", "LIST_TYPE" => "L", "IBLOCK_ID" => $iblockId), "PERIOD_COUNT" => array("NAME" => GetMessage("INTASK_C29_PERIOD_COUNT"), "ACTIVE" => "Y", "SORT" => 500, "CODE" => "PERIOD_COUNT", "PROPERTY_TYPE" => "N", "USER_TYPE" => false, "DEFAULT_VALUE" => "", "ROW_COUNT" => 1, "COL_COUNT" => 30, "LINK_IBLOCK_ID" => 0, "WITH_DESCRIPTION" => "N", "FILTRABLE" => "N", "SEARCHABLE" => "N", "MULTIPLE" => "N", "MULTIPLE_CNT" => 5, "IS_REQUIRED" => "N", "FILE_TYPE" => "jpg, gif, bmp, png, jpeg", "LIST_TYPE" => "L", "IBLOCK_ID" => $iblockId), "EVENT_LENGTH" => array("NAME" => GetMessage("INTASK_C29_EVENT_LENGTH"), "ACTIVE" => "Y", "SORT" => 500, "CODE" => "EVENT_LENGTH", "PROPERTY_TYPE" => "N", "USER_TYPE" => false, "DEFAULT_VALUE" => "", "ROW_COUNT" => 1, "COL_COUNT" => 30, "LINK_IBLOCK_ID" => 0, "WITH_DESCRIPTION" => "N", "FILTRABLE" => "N", "SEARCHABLE" => "N", "MULTIPLE" => "N", "MULTIPLE_CNT" => 5, "IS_REQUIRED" => "N", "FILE_TYPE" => "jpg, gif, bmp, png, jpeg", "LIST_TYPE" => "L", "IBLOCK_ID" => $iblockId), "PERIOD_ADDITIONAL" => array("NAME" => GetMessage("INTASK_C29_PERIOD_ADDITIONAL"), "ACTIVE" => "Y", "SORT" => 500, "CODE" => "PERIOD_ADDITIONAL", "PROPERTY_TYPE" => "S", "USER_TYPE" => false, "DEFAULT_VALUE" => "", "ROW_COUNT" => 1, "COL_COUNT" => 30, "LINK_IBLOCK_ID" => 0, "WITH_DESCRIPTION" => "N", "FILTRABLE" => "N", "SEARCHABLE" => "N", "MULTIPLE" => "N", "MULTIPLE_CNT" => 5, "IS_REQUIRED" => "N", "FILE_TYPE" => "jpg, gif, bmp, png, jpeg", "LIST_TYPE" => "L", "IBLOCK_ID" => $iblockId));
$dbIBlockProps = CIBlock::GetProperties($iblockId);
while ($arIBlockProps = $dbIBlockProps->Fetch()) {
if (Array_Key_Exists($arIBlockProps["CODE"], $arResult["ALLOWED_ITEM_PROPERTIES"])) {
$arResult["ALLOWED_ITEM_PROPERTIES"][$arIBlockProps["CODE"]]["ID"] = $arIBlockProps["ID"];
}
}
$keys = Array_Keys($arResult["ALLOWED_ITEM_PROPERTIES"]);
foreach ($keys as $key) {
if (IntVal($arResult["ALLOWED_ITEM_PROPERTIES"][$key]["ID"]) <= 0) {
$ibp = new CIBlockProperty();
$arResult["ALLOWED_ITEM_PROPERTIES"][$key]["ID"] = $ibp->Add($arResult["ALLOWED_ITEM_PROPERTIES"][$key]);
}
}
return $arResult;
}
示例4: Table_Super_Replace
function Table_Super_Replace($Array, $Matches)
{
#---------------------------------------------------------------------------
$Result = array();
#---------------------------------------------------------------------------
if (Is_Array($Array)) {
#-------------------------------------------------------------------------
foreach (Array_Keys($Array) as $ElementID) {
#-----------------------------------------------------------------------
$Element = $Array[$ElementID];
#-----------------------------------------------------------------------
$Result[$ElementID] = Is_Array($Element) ? Table_Super_Replace($Element, $Matches) : Str_Replace(Array_Keys($Matches), Array_Values($Matches), $Element);
}
}
#---------------------------------------------------------------------------
return $Result;
}
示例5: Cache_Delete
function Cache_Delete($Pattern)
{
#-----------------------------------------------------------------------------
$Cache =& Link_Get('Cache', 'array');
#-----------------------------------------------------------------------------
foreach (Array_Keys($Cache) as $Key) {
#---------------------------------------------------------------------------
if (Preg_Match(SPrintF('/%s/', $Pattern), $Key)) {
#-------------------------------------------------------------------------
# Debug(SPrintF('[Cache_Delete]: удаление объекта из кеша (%s)',$Key));
#-------------------------------------------------------------------------
unset($Cache[$Key]);
}
}
#-----------------------------------------------------------------------------
return TRUE;
}
示例6: 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;
#-------------------------------------------------------------------------------
}
示例7: System_XML
}
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Config = System_XML('config/Config.xml', array(HOST_ID));
if (Is_Error($Config)) {
return new gException('ERROR_TEMPLATE_LOAD', 'Ошибка загрузки шаблона');
}
#-------------------------------------------------------------------------------
$Params = Array_ToLine($Config);
#-------------------------------------------------------------------------------
foreach (Array_Keys($Params) as $Key) {
#-------------------------------------------------------------------------------
if (!In_Array($Key, $ShareConfigsParams)) {
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Tasks/GC/CheckConfigParams]: в конфигурационном файле обнаружен не используемый параметр: %s', $Key));
#-------------------------------------------------------------------------------
if ($Settings['IsEvent']) {
#-------------------------------------------------------------------------------
$Event = array('IsReaded' => FALSE, 'PriorityID' => 'System', 'Text' => SPrintF('Обнаружен неиспользуемый параметр конфигурационного файла: %s, со значением (%s). Удалите его, или отключите задачу поиска неиспользуемых параметров. При удалении, будте аккуратны и внимательны, сохраняйте бэкап конфигурационного файла.', $Key, $Params[$Key]));
$Event = Comp_Load('Events/EventInsert', $Event);
if (!$Event) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
示例8: array
#-----------------------------------------------------
@($DOM->Links['Sign']->Childs = array());
#-----------------------------------------------------
$DOM->AddChild('Sign', new Tag('IMG', array('src' => 'SRC:{Images/dSign.bmp}')));
#-----------------------------------------------------
@($DOM->Links['Stamp']->Childs = array());
#-----------------------------------------------------
$DOM->AddChild('Stamp', new Tag('IMG', array('src' => 'SRC:{Images/Stamp.bmp}')));
}
#-------------------------------------------------------
$Document = $DOM->Build();
if (Is_Error($Document)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------
foreach (Array_Keys($Replace) as $LinkID) {
#-----------------------------------------------------
$Text = (string) $Replace[$LinkID];
#-----------------------------------------------------
$Document = Str_Replace(SPrintF('%%%s%%', $LinkID), $Text ? $Text : '-', $Document);
}
#-------------------------------------------------------
$PDF = HTMLDoc_CreatePDF('WorksCompliteReport', $Document);
#-------------------------------------------------------
switch (ValueOf($PDF)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return ERROR | @Trigger_Error(400);
case 'string':
#---------------------------------------------------
示例9: foreach
}
#---------------------------------------------------------------------
$tAttribs = $Template['Attribs'];
#---------------------------------------------------------------------
foreach (Array_Keys($tAttribs) as $AttribID) {
#-------------------------------------------------------------------
if (!isset($pAttribs[$AttribID])) {
$pAttribs[$AttribID] = $tAttribs[$AttribID]['Value'];
}
}
#---------------------------------------------------------------------
$Replace = Array_ToLine($pAttribs, '%');
#---------------------------------------------------------------------
$ProfileName = $Template['ProfileName'];
#---------------------------------------------------------------------
foreach (Array_Keys($Replace) as $Key) {
$ProfileName = Str_Replace($Key, $Replace[$Key], $ProfileName);
}
#---------------------------------------------------------------------
$IProfile = array('CreateDate' => GetTime($Profile['CreateDate']), 'UserID' => $UserID, 'TemplateID' => $Profile['TemplateID'], 'Name' => $ProfileName, 'Attribs' => $pAttribs, 'StatusID' => 'Checked', 'StatusDate' => GetTime($Profile['CreateDate']));
#---------------------------------------------------------------------
$ProfileID = DB_Insert('Profiles', $IProfile);
if (Is_Error($ProfileID)) {
return ERROR | @Trigger_Error(500);
}
}
}
#-------------------------------------------------------------------------
if (Is_Error(DB_Commit($TransactionID))) {
return ERROR | @Trigger_Error(500);
}
示例10: array
#-------------------------------------------------------------------------------
# массив, с элементами выходной XML
$Array = array();
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# настройки сети из которой можно выполнять команды
if ($Settings['xset-up-param']['IsActive']) {
$Array[] = SPrintF('<func name="xset.up.param"><arg name="ip">%s</arg></func>', $Settings['xset-up-param']['LAN']);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# настройки DNS
$Args = array('<arg name="sok">ok</arg><arg name="sync">on</arg>');
#-------------------------------------------------------------------------------
if ($Settings['dnsparam']['IsActive']) {
foreach (Array_Keys($Settings['dnsparam']) as $Name) {
if ($Name != 'IsActive') {
$Args[] = SPrintF('<arg name="%s">%s</arg>', Str_Replace('dnsparam.', '', Str_Replace('-', '.', $Name)), $Name == 'dnsparam-email' ? $Owner[0]['Email'] : $Settings['dnsparam'][$Name]);
}
}
}
#-------------------------------------------------------------------------------
$Array[] = SPrintF('<func name="dnsparam">%s</func>', Implode('', $Args));
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# TODO надо вытянуть номерки автосоздаваемых тарифов, и юзать их заказы
#-------------------------------------------------------------------------------
# по юзеру, которому принадлежит заказ находим заказы на DNSmanager
if ($Settings['slaveserver-edit']['IsActive']) {
#-------------------------------------------------------------------------------
$DNSmanagerOrders = DB_Select('DNSmanagerOrdersOwners', array('ServerID', 'Login', 'Password', '(SELECT `Params` FROM `Servers` WHERE `Servers`.`ID` = `ServerID`) AS `Params`'), array('Where' => SPrintF('`UserID` = %u', $Owner[0]['UserID']), 'IsDesc' => TRUE, 'SortOn' => 'ID'));
示例11: GetMessage
$arResult["FatalError"] = "";
if (!CIBlockRights::UserHasRightTo($iblockId, $iblockId, 'element_read')) {
$arResult["FatalError"] .= GetMessage("INTS_NO_IBLOCK_PERMS") . ".";
}
if (StrLen($arResult["FatalError"]) <= 0) {
$deleteMeetingId = IntVal($_REQUEST["delete_meeting_id"]);
if ($deleteMeetingId > 0 && check_bitrix_sessid() && $GLOBALS["USER"]->IsAuthorized() && ($GLOBALS["USER"]->IsAdmin() || Count(Array_Intersect($GLOBALS["USER"]->GetUserGroupArray(), $arParams["USERGROUPS_MODIFY"])) > 0)) {
$dbMeetingsList = CIBlockSection::GetList(array(), array("IBLOCK_ID" => $iblockId, "ID" => $deleteMeetingId));
if ($arMeeting = $dbMeetingsList->Fetch()) {
CIBlockSection::Delete($arMeeting["ID"]);
}
}
}
$arResult["ALLOWED_FIELDS"] = array("ID" => array("NAME" => GetMessage("INAF_F_ID"), "ORDERABLE" => true, "FILTERABLE" => true, "TYPE" => "int", "IS_FIELD" => true), "NAME" => array("NAME" => GetMessage("INAF_F_NAME"), "ORDERABLE" => true, "FILTERABLE" => true, "TYPE" => "string", "IS_FIELD" => true), "DESCRIPTION" => array("NAME" => GetMessage("INAF_F_DESCRIPTION"), "ORDERABLE" => false, "FILTERABLE" => false, "TYPE" => "text", "IS_FIELD" => true), "UF_FLOOR" => array("NAME" => GetMessage("INAF_F_FLOOR"), "ORDERABLE" => true, "FILTERABLE" => true, "TYPE" => "integer", "IS_FIELD" => false), "UF_PLACE" => array("NAME" => GetMessage("INAF_F_PLACE"), "ORDERABLE" => true, "FILTERABLE" => true, "TYPE" => "integer", "IS_FIELD" => false), "UF_PHONE" => array("NAME" => GetMessage("INAF_F_PHONE"), "ORDERABLE" => false, "FILTERABLE" => false, "TYPE" => "string", "IS_FIELD" => false));
$arUserFields = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("IBLOCK_" . $iblockId . "_SECTION", 0, LANGUAGE_ID);
$arKeys = Array_Keys($arResult["ALLOWED_FIELDS"]);
foreach ($arKeys as $key) {
if (!$arResult["ALLOWED_FIELDS"][$key]["IS_FIELD"]) {
if (!Array_Key_Exists($key, $arUserFields)) {
$arFields = array("ENTITY_ID" => "IBLOCK_" . $iblockId . "_SECTION", "FIELD_NAME" => $key, "USER_TYPE_ID" => $arResult["ALLOWED_FIELDS"][$key]["TYPE"]);
$obUserField = new CUserTypeEntity();
$obUserField->Add($arFields);
}
}
}
if ($arParams["SET_TITLE"] == "Y") {
$APPLICATION->SetTitle(GetMessage("INTASK_C36_PAGE_TITLE"));
}
if ($arParams["SET_NAVCHAIN"] == "Y") {
$APPLICATION->AddChainItem(GetMessage("INTASK_C36_PAGE_TITLE"));
}
示例12: switch
#-----------------------------------------------------------------------
switch (ValueOf($Compile)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return ERROR | @Trigger_Error(400);
case 'array':
#-------------------------------------------------------------------
$Template = System_XML(SPrintF('profiles/%s.xml', $Profile['TemplateID']));
if (Is_Error($Template)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------
$Attribs = $Template['Attribs'];
#-------------------------------------------------------------------
foreach (Array_Keys($Attribs) as $AttribID) {
#-----------------------------------------------------------------
$Attrib = $Attribs[$AttribID];
#-----------------------------------------------------------------
if (isset($Attrib['Title'])) {
$Table[] = $Attrib['Title'];
}
#-----------------------------------------------------------------
$Table[] = $Compile['Attribs'][$AttribID];
}
#-------------------------------------------------------------------
$Table[] = 'Подтверждение введенных данных';
#-------------------------------------------------------------------
$FileLength = GetUploadedFileSize('Profiles', $ProfileID);
#-------------------------------------------------------------------
$Table[] = array('Копия документа подтверждающего достоверность данных', $FileLength ? new Tag('TD', array('class' => 'Standard'), new Tag('SPAN', SPrintF('%01.2f Кб.', $FileLength / 1024)), new Tag('A', array('href' => SPrintF('/FileDownload?TypeID=Profiles&FileID=%s', $Profile['ID'])), '[скачать]')) : 'не загружены');
示例13: System_XML
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Template = System_XML(SPrintF('servers/%s.xml', $TemplateID));
if (Is_Error($Template)) {
return new gException('ERROR_TEMPLATE_LOAD', 'Ошибка загрузки шаблона');
}
#-------------------------------------------------------------------------------
$Errors = $Attribs = array();
#-------------------------------------------------------------------------------
if (isset($Template['Attribs'])) {
#-------------------------------------------------------------------------------
$Params = $Template['Attribs'];
#-------------------------------------------------------------------------------
$Regulars = Regulars();
#-------------------------------------------------------------------------------
foreach (Array_Keys($Params) as $AttribID) {
#-------------------------------------------------------------------------------
$Attrib = $Params[$AttribID];
#-------------------------------------------------------------------------------
$Value = isset($Args[$AttribID]) ? $Args[$AttribID] : $Params[$AttribID]['Value'];
#-------------------------------------------------------------------------------
# костыль для чекбоксов
if (isset($Attrib['Attribs']['type']) && $Attrib['Attribs']['type'] == 'checkbox') {
$Value = (bool) @$Args[$AttribID];
}
#-------------------------------------------------------------------------------
$Attribs[$AttribID] = $Value;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
switch ($Attrib['Type']) {
case 'Input':
示例14: array
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$GLOBALS['TaskReturnInfo'] = array();
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# смотрим количество сообщений в очереди
$Config =& Config();
#-------------------------------------------------------------------------------
$Notifies = $Config['Notifies'];
#-------------------------------------------------------------------------------
$Methods = Explode(',', $Task['Params']['Methods']);
#-------------------------------------------------------------------------------
$iWhere = array();
#-------------------------------------------------------------------------------
foreach (Array_Keys($Notifies['Methods']) as $MethodID) {
if ($Notifies['Methods'][$MethodID]['IsActive'] && In_Array($MethodID, $Methods)) {
$iWhere[] = SPrintF("`TypeID` = '%s'", $MethodID);
}
}
#-------------------------------------------------------------------------------
$Where = SPrintF("(%s) AND `IsExecuted` = 'no'", Implode(' OR ', $iWhere));
$Count = DB_Count('TasksOwners', array('Where' => $Where));
#-------------------------------------------------------------------------------
if (Is_Error($Count)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
if ($Count > $Settings['Limit'] - 1) {
#-------------------------------------------------------------------------------
$GLOBALS['TaskReturnInfo']['Messages In Queue'] = array($Count);
示例15: editRSS
function editRSS()
{
global $cfg;
DisplayHead("Administration - RSS");
// Admin Menu
displayMenu();
echo "<div align=\"center\">";
echo "<table border=1 bordercolor=\"" . $cfg["table_admin_border"] . "\" cellpadding=\"2\" cellspacing=\"0\" bgcolor=\"" . $cfg["table_data_bg"] . "\">";
echo "<tr><td bgcolor=\"" . $cfg["table_header_bg"] . "\" background=\"themes/" . $cfg["theme"] . "/images/bar.gif\">";
echo "<img src=\"images/properties.png\" width=18 height=13 border=0> <font class=\"title\">RSS Feeds</font>";
echo "</td></tr><tr><td align=\"center\">";
?>
<form action="admin.php?op=addRSS" method="post">
<?php
echo _FULLURLLINK;
?>
:
<input type="Text" size="50" maxlength="255" name="newRSS">
<input type="Submit" value="<?php
echo _UPDATE;
?>
"><br>
</form>
<?php
echo "</td></tr>";
$arLinks = GetRSSLinks();
$arRid = Array_Keys($arLinks);
$inx = 0;
foreach ($arLinks as $link) {
$rid = $arRid[$inx++];
echo "<tr><td><a href=\"admin.php?op=deleteRSS&rid=" . $rid . "\"><img src=\"images/delete_on.gif\" width=16 height=16 border=0 title=\"" . _DELETE . " " . $rid . "\" align=\"absmiddle\"></a> ";
echo "<a href=\"" . $link . "\" target=\"_blank\">" . $link . "</a></td></tr>\n";
}
echo "</table></div><br><br><br>";
DisplayFoot(true, true);
}