本文整理汇总了PHP中CAdminMessage类的典型用法代码示例。如果您正苦于以下问题:PHP CAdminMessage类的具体用法?PHP CAdminMessage怎么用?PHP CAdminMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CAdminMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showProgress
public static function showProgress($text, $title, $v)
{
$v = $v >= 0 ? $v : 0;
if ($v < 100) {
$msg = new \CAdminMessage(array("TYPE" => "PROGRESS", "HTML" => true, "MESSAGE" => $title, "DETAILS" => "#PROGRESS_BAR#<div style=\"width: " . self::PROGRESS_WIDTH . "px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 20px;\">" . Converter::getHtmlConverter()->encode($text) . "</div>", "PROGRESS_TOTAL" => 100, "PROGRESS_VALUE" => $v, "PROGRESS_TEMPLATE" => '#PROGRESS_PERCENT#', "PROGRESS_WIDTH" => self::PROGRESS_WIDTH));
} else {
$msg = new \CAdminMessage(array("TYPE" => "OK", "MESSAGE" => $title, "DETAILS" => $text));
}
return $msg->show();
}
示例2: ShowForm
private function ShowForm($type, $message, $buttonName = '')
{
$keys = array_keys($GLOBALS);
for ($i = 0; $i < count($keys); $i++) {
if ($keys[$i] != 'i' && $keys[$i] != 'GLOBALS' && $keys[$i] != 'strTitle' && $keys[$i] != 'filepath') {
global ${$keys[$i]};
}
}
$PathInstall = str_replace('\\', '/', __FILE__);
$PathInstall = substr($PathInstall, 0, strlen($PathInstall) - strlen('/index.php'));
IncludeModuleLangFile($PathInstall . '/install.php');
$APPLICATION->SetTitle(GetMessage('ASD_MODULE_MONEY_NAME'));
include $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_admin_after.php';
echo CAdminMessage::ShowMessage(array('MESSAGE' => $message, 'TYPE' => $type));
?>
<form action="<?php
echo $APPLICATION->GetCurPage();
?>
" method="get">
<p>
<input type="hidden" name="lang" value="<?php
echo LANG;
?>
" />
<input type="submit" value="<?php
echo strlen($buttonName) ? $buttonName : GetMessage('MOD_BACK');
?>
" />
</p>
</form>
<?php
include $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/epilog_admin.php';
die;
}
示例3: DoInstall
function DoInstall()
{
global $APPLICATION, $step;
if (!$this->InstallFiles()) {
CAdminMessage::ShowMessage('Failed to copy files. Catalog /bitrix/ must be writable');
}
$this->InstallDB(false);
$this->InstallEvents();
$this->InstallPublic();
$APPLICATION->IncludeAdminFile(GetMessage("BEONO_MODULE_BASKET_INSTALL_TITLE"), dirname(__FILE__)."/step.php");
}
示例4: DoInstall
public function DoInstall()
{
global $APPLICATION;
if (version_compare(SM_VERSION, '15.0.2') < 0) {
$APPLICATION->IncludeAdminFile(GetMessage('NIK_GLVRD_INSTALL_TITLE'), __DIR__ . '/old_bitrix.php');
} else {
CopyDirFiles(__DIR__ . '/images', $_SERVER['DOCUMENT_ROOT'] . BX_ROOT . '/images/' . $this->MODULE_ID, true, true);
CopyDirFiles(__DIR__ . '/js', $_SERVER['DOCUMENT_ROOT'] . BX_ROOT . '/js/' . $this->MODULE_ID, true, true);
RegisterModule('nik.glvrd');
$this->DoDependences(true);
CAdminMessage::ShowNote(GetMessage('NIK_GLVRD_INSTALL_COMPLETE_TITLE'));
}
}
示例5: outError
public static function outError($msg, $var1 = null, $var2 = null)
{
if (func_num_args() > 1) {
$params = func_get_args();
$msg = call_user_func_array('sprintf', $params);
}
if (self::canOutAsAdminMessage()) {
$msg = self::prepareToHtml($msg);
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
\CAdminMessage::ShowMessage(array("MESSAGE" => $msg, 'HTML' => true, 'TYPE' => 'ERROR'));
} elseif (self::canOutAsHtml()) {
self::outToHtml('[red]' . $msg . '[/]');
} else {
self::outToConsole($msg);
}
}
示例6: unlock_export
function unlock_export()
{
global $APPLICATION, $profileID;
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/bitrix/tools/acrit.exportpro/export_{$profileID}_run.lock")) {
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
unlink($_SERVER['DOCUMENT_ROOT'] . "/bitrix/tools/acrit.exportpro/export_{$profileID}_run.lock");
ob_start();
echo '<td colspan="2" align="center">';
CAdminMessage::ShowMessage(array('MESSAGE' => GetMessage('ACRIT_EXPORTPRO_EXPORT_UNLOCK'), 'TYPE' => 'OK', 'HTML' => 'TRUE'));
echo '</td>';
$data = ob_get_clean();
$APPLICATION->RestartBuffer();
echo Bitrix\Main\Web\Json::encode(array('result' => 'ok', 'blocks' => array(array('id' => '#unlock-container', 'html' => $data))));
}
die;
}
示例7: IncludeModuleLangFile
<?php
if (!check_bitrix_sessid()) {
return;
}
IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/form/install/install.php");
if (is_array($errors) && count($errors) > 0) {
foreach ($errors as $val) {
$alErrors .= $val . "<br>";
}
echo CAdminMessage::ShowMessage(array("TYPE" => "ERROR", "MESSAGE" => GetMessage("MOD_INST_ERR"), "DETAILS" => $alErrors, "HTML" => true));
} else {
echo CAdminMessage::ShowNote(GetMessage("MOD_INST_OK"));
}
/*
if (strlen($public_dir)>0) :
?>
<p><?=GetMessage("MOD_DEMO_DIR")?></p>
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td align="center"><p><b><?=GetMessage("MOD_DEMO_SITE")?></b></p></td>
<td align="center"><p><b><?=GetMessage("MOD_DEMO_LINK")?></b></p></td>
</tr>
<?
$sites = CSite::GetList($by, $order, Array("ACTIVE"=>"Y"));
while($site = $sites->Fetch())
{
?>
<tr>
<td width="0%"><p>[<?=$site["ID"]?>] <?=$site["NAME"]?></p></td>
<td width="0%"><p><a href="<?if(strlen($site["SERVER_NAME"])>0) echo "http://".$site["SERVER_NAME"];?><?=$site["DIR"].$public_dir?>/result_list.php?WEB_FORM_NAME=ANKETA"><?=$site["DIR"].$public_dir?>/result_list.php?WEB_FORM_NAME=ANKETA</a></p></td>
示例8: ShowDataSaveForm
private function ShowDataSaveForm() {
$keys = array_keys($GLOBALS);
for($i=0; $i<count($keys); $i++) {
if($keys[$i]!='i' && $keys[$i]!='GLOBALS' && $keys[$i]!='strTitle' && $keys[$i]!='filepath') {
global ${$keys[$i]};
}
}
$PathInstall = str_replace('\\', '/', __FILE__);
$PathInstall = substr($PathInstall, 0, strlen($PathInstall)-strlen('/index.php'));
IncludeModuleLangFile($PathInstall.'/install.php');
$APPLICATION->SetTitle(GetMessage('ASD_MODULE_NAME'));
include($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/prolog_admin_after.php');
?>
<form action="<?= $APPLICATION->GetCurPage()?>" method="get">
<?= bitrix_sessid_post()?>
<input type="hidden" name="lang" value="<?= LANG?>" />
<input type="hidden" name="id" value="<?= $this->MODULE_ID?>" />
<input type="hidden" name="uninstall" value="Y" />
<input type="hidden" name="step" value="2" />
<?CAdminMessage::ShowMessage(GetMessage('MOD_UNINST_WARN'))?>
<input type="submit" name="inst" value="<?echo GetMessage('MOD_UNINST_DEL')?>" />
</form>
<?
include($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/epilog_admin.php');
die();
}
示例9: foreach
}
}
\Bitrix\Sender\MailingGroupTable::delete(array('MAILING_ID' => $ID));
foreach ($GROUP as $arGroup) {
\Bitrix\Sender\MailingGroupTable::add($arGroup);
}
}
if ($res) {
if ($apply != "") {
LocalRedirect("/bitrix/admin/sender_mailing_edit.php?ID=" . $ID . "&lang=" . LANG . "&" . $tabControl->ActiveTabParam());
} else {
LocalRedirect("/bitrix/admin/sender_mailing_admin.php?lang=" . LANG);
}
} else {
if (!empty($arError)) {
$message = new CAdminMessage(implode("<br>", $arError));
}
$bVarsFromForm = true;
}
} else {
$GROUP_EXCLUDE = $GROUP_INCLUDE = array();
$groupDb = \Bitrix\Sender\MailingGroupTable::getList(array('select' => array('ID' => 'GROUP_ID', 'INCLUDE'), 'filter' => array('MAILING_ID' => $ID)));
while ($arGroup = $groupDb->fetch()) {
if ($arGroup['INCLUDE']) {
$GROUP_INCLUDE[] = $arGroup['ID'];
} else {
$GROUP_EXCLUDE[] = $arGroup['ID'];
}
}
}
//Edit/Add part
示例10: ShowNote
function ShowNote($message)
{
if(!empty($message))
CAdminMessage::ShowMessage(array("MESSAGE"=>$message, "TYPE"=>"OK"));
}
示例11: Array
<td colspan="2" align="center">
<?$ml_res = CMailLog::GetList(Array("ID"=>"ASC"), Array("MESSAGE_ID"=>$ID));?>
<select style="width:80%;" size="5">
<?while($arr_log = $ml_res->GetNext()):?>
<option>(<?=$arr_log["DATE_INSERT"]?>) <?=$arr_log["MESSAGE_TEXT"]?></option>
<?endwhile;?>
</select>
</td>
</tr>
<?$tabControl->Buttons();?>
<input type="hidden" name="save_form" value="Y">
<input <?if ($MOD_RIGHT<"W") echo "disabled" ?> type="submit" name="save" class="adm-btn-save" value="<?echo GetMessage("MAIL_MSG_VIEW_SAVE")?>">
<input <?if ($MOD_RIGHT<"W") echo "disabled" ?> type="submit" name="apply" value="<?echo GetMessage("MAIL_MSG_VIEW_APPLY")?>">
<input <?if ($MOD_RIGHT<"W") echo "disabled" ?> type="submit" name="prev" value="<<" title="<?echo GetMessage("MAIL_MSG_VIEW_SAVE_PREV")?>">
<input <?if ($MOD_RIGHT<"W") echo "disabled" ?> type="submit" name="next" value=">>" title="<?echo GetMessage("MAIL_MSG_VIEW_SAVE_NEXT")?>">
<?$tabControl->End();?>
</form>
<?
else:
$APPLICATION->SetTitle(GetMessage("MAIL_MSG_VIEW_TITLE"));
require($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/main/include/prolog_admin_after.php");
CAdminMessage::ShowMessage(GetMessage("MAIL_MSG_NOTFOUND"));
endif;
require($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/main/include/epilog_admin.php");?>
示例12: array
break;
}
}
}
$banner["SETTINGS"]["Phrases"][] = array(
'Phrase' => $phrase,
'AutoBudgetPriority' => $request["PhrasePriority"][$key],
'StatusPhraseModerate' => $phraseStatus,
);
}
}
$message = new CAdminMessage(array(
"TYPE" => "ERROR",
"MESSAGE" => Loc::getMessage('SEO_BANNER_ERROR'),
"DETAILS" => implode('<br>', $result->getErrorMessages()),
));
}
}
$APPLICATION->SetTitle(
$ID > 0
? Loc::getMessage("SEO_BANNER_EDIT_TITLE", array(
"#ID#" => $ID,
"#XML_ID#" => $banner["XML_ID"],
))
: Loc::getMessage("SEO_BANNER_NEW_TITLE")
);
require($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/main/include/prolog_admin_after.php");
示例13: elseif
$STEP = 5;
} elseif ($STEP == 5) {
$STEP = LastStep21($arIBlock);
}
} else {
$arErrors[] = GetMessage("IBCONV_WRONG_VERSION");
}
} else {
$arErrors[] = GetMessage("IBCONV_WRONG_IBLOCK");
}
}
foreach ($arErrors as $strError) {
CAdminMessage::ShowMessage($strError);
}
foreach ($arMessages as $strMessage) {
CAdminMessage::ShowMessage(array("MESSAGE" => $strMessage, "TYPE" => "OK"));
}
if (count($arErrors) == 0) {
?>
<?php
if ($STEP == 0) {
?>
<p><span class="required"><?php
echo GetMessage("IBCONV_ATTENTION");
?>
</span> <?php
echo GetMessage("IBCONV_WARNING_MESSAGE", array("#IBLOCK_NAME#" => htmlspecialcharsbx($arIBlock["NAME"])));
?>
<input type="button" name="START" value="<?php
echo GetMessage("IBCONV_MOVE");
?>
示例14: array
?>
<?php
$aMenu = array(array("TEXT" => GetMessage("SPSN_2FLIST"), "LINK" => "/bitrix/admin/sale_pay_system.php?lang=" . LANG . GetFilterParams("filter_"), "ICON" => "btn_list"));
if ($ID > 0 && $saleModulePermissions >= "W") {
$aMenu[] = array("SEPARATOR" => "Y");
$aMenu[] = array("TEXT" => GetMessage("SPSN_NEW_PAYSYS"), "LINK" => "/bitrix/admin/sale_pay_system_edit.php?lang=" . LANG . GetFilterParams("filter_"), "ICON" => "btn_new");
$aMenu[] = array("TEXT" => GetMessage("SPSN_DELETE_PAYSYS"), "LINK" => "javascript:if(confirm('" . GetMessage("SPSN_DELETE_PAYSYS_CONFIRM") . "')) window.location='/bitrix/admin/sale_pay_system.php?action=delete&ID[]=" . $ID . "&lang=" . LANG . "&" . bitrix_sessid_get() . "#tb';", "WARNING" => "Y", "ICON" => "btn_delete");
}
$context = new CAdminContextMenu($aMenu);
$context->Show();
?>
<?php
if (strlen($errorMessage) > 0) {
echo CAdminMessage::ShowMessage(array("DETAILS" => $errorMessage, "TYPE" => "ERROR", "MESSAGE" => GetMessage("SPSN_ERROR"), "HTML" => true));
}
?>
<script language="JavaScript">
<!--
function SetActLinkText(ind, flag)
{
var paySysActSwitch = document.getElementById("pay_sys_switch_" + ind);
if (flag)
{
paySysActSwitch.innerHTML = "<br><?php
echo GetMessage("SPS_HIDE_PROPS");
?>
";
}
示例15: RaiseErrorAndDie
function RaiseErrorAndDie($strError, $bRepeat = false)
{
if ($bRepeat) {
$strError .= '<br><input type=button value="' . GetMessage('DUMP_RETRY') . '" onclick="RetryRequest()" id="retry_button">
<script>window.setTimeout(RetryRequest, 60000);</script>';
}
CAdminMessage::ShowMessage(array("MESSAGE" => GetMessage("MAIN_DUMP_ERROR"), "DETAILS" => $strError, "TYPE" => "ERROR", "HTML" => true));
echo '<script>EndDump();</script>';
die;
}