本文整理汇总了PHP中EndHtml函数的典型用法代码示例。如果您正苦于以下问题:PHP EndHtml函数的具体用法?PHP EndHtml怎么用?PHP EndHtml使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了EndHtml函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: after_action
protected function after_action($result)
{
if ($this->is_naked) {
return $result;
}
return BeginHtml() . $result . EndHtml();
}
示例2: after_action
/**
*
*/
protected function after_action($result)
{
BeginHtml(NETCAT_MODULE_ROUTING_TITLE, '', '');
echo $result;
EndHtml();
return '';
}
示例3: UninstallationAborted
function UninstallationAborted()
{
global $TMP_FOLDER;
print TOOLS_MODULES_ERR_UNINSTALL . ".<br>\n";
DeleteFilesInDirectory($TMP_FOLDER);
EndHtml();
exit;
}
示例4: after_action
protected function after_action($result)
{
// JSON
if (is_array($result)) {
return json_safe_encode($result);
}
// With template
if (!$this->is_naked) {
return BeginHtml() . $result . EndHtml();
}
return $result;
}
示例5: InstallationAborted
function InstallationAborted($msg = '', $action = '')
{
global $TMP_FOLDER;
switch ($action) {
case 'patch':
nc_print_status(($msg ? $msg . "<br>" : "") . TOOLS_PATCH_ERR_CANTINSTALL, "error");
PatchForm();
PatchList();
break;
case 'module':
nc_print_status(($msg ? $msg . "<br>" : "") . TOOLS_MODULES_ERR_INSTALL, "error");
break;
case 'activation':
nc_print_status($msg ? $msg : TOOLS_PATCH_ERROR, "error");
nc_activation_show_form();
break;
default:
nc_print_status($msg ? $msg : TOOLS_PATCH_ERROR, "error");
break;
}
DeleteFilesInDirectory($TMP_FOLDER);
EndHtml();
exit;
}
示例6: AddClassForm
AddClassForm();
break;
case 2:
# добавим шаблон
if (!$nc_core->token->verify()) {
BeginHtml($Title2, $Title2, "http://" . $DOC_DOMAIN . "/management/class/");
nc_print_status(NETCAT_TOKEN_INVALID, 'error');
EndHtml();
exit;
}
BeginHtml($Title2, $Title2, "http://" . $DOC_DOMAIN . "/management/class/");
$UI_CONFIG = new ui_config_class('import', $ClassID, $ClassGroup);
if (!$FilePatch['tmp_name']) {
nc_print_status(CONTROL_CLASS_IMPORT_ERROR_NOTUPLOADED, 'error');
break;
#InstallationAborted(CONTROL_CLASS_IMPORT_ERROR_NOTUPLOADED);
}
$res = ParseClassFile($FilePatch['tmp_name']);
if ($res) {
$AJAX_SAVER = true;
BeginHtml($Title2, $Title2, "http://" . $DOC_DOMAIN . "/management/class/");
$UI_CONFIG = new ui_config_class('edit', $res, '');
nc_print_status(CONTROL_CONTENT_CLASS_SUCCESS_ADD, 'ok');
ClassForm($res, "index.php", 5, 2, 0);
} else {
nc_print_status(CONTROL_CLASS_IMPORT_ERROR_CANNOTBEINSTALLED, 'error');
}
break;
}
EndHtml();
示例7: print_footer
/**
*
*/
protected function print_footer()
{
print join("\n", $this->add_to_footer);
EndHtml();
}
示例8: show_counters
function show_counters($phase)
{
global $nc_core, $db;
global $counters, $default_templ_id, $UI_CONFIG;
if ($phase == 1) {
// Форма добавления счетчика через API
if (!extension_loaded('curl')) {
nc_print_status(NETCAT_MODULE_STATS_OPENSTAT_NOT_FOUND_CURL, "error");
EndHtml();
exit;
}
$ret = add_api_counter();
if ($ret) {
return;
}
} elseif ($phase == 3 && isset($_POST['DeleteCounter'])) {
// удалить выбранные
global $DeleteCounter, $counters;
$openstat = new nc_Openstat_core_class($nc_core->get_settings('Openstat_Login', 'stats'), $nc_core->get_settings('Openstat_Password', 'stats'));
foreach ($counters as $del_counter) {
//$DeleteCounter as $del_counter_id => $del_counter_flag) {
if ($DeleteCounter[$del_counter->Counter_Id]) {
if (!$del_counter->User_Counter_Code) {
$err_code = $openstat->delete_counter($del_counter->Openstat_Counter_Id);
if ($err_code != 204) {
if ($err_code == 403) {
nc_print_status(NETCAT_MODULE_STATS_OPENSTAT_ERROR_NEW_COUNTER_AUTH_ERROR, "error");
} else {
nc_print_status(NETCAT_MODULE_STATS_OPENSTAT_ERROR_DEL_COUNTER . $err_code, "error");
}
$UI_CONFIG->actionButtons[] = array("id" => "back", "caption" => NETCAT_MODULE_STATS_OPENSTAT_BACK, "align" => "left", "action" => "urlDispatcher.load('module.stats.openstat.counters')");
return;
}
}
$db->query("DELETE FROM `Stats_Openstat_Counters` WHERE `Counter_Id` = '" . $del_counter->Counter_Id . "'");
}
}
nc_print_status(NETCAT_MODULE_STATS_CHANGES_SAVED, "ok");
} elseif ($phase == 4 && isset($_POST['DoAction'])) {
//удалить все
$openstat = new nc_Openstat_core_class($nc_core->get_settings('Openstat_Login', 'stats'), $nc_core->get_settings('Openstat_Password', 'stats'));
foreach ($counters as $del_counter) {
if (!$del_counter->User_Counter_Code) {
$err_code = $openstat->delete_counter($del_counter->Openstat_Counter_Id);
if ($err_code != 204) {
if ($err_code == 403) {
nc_print_status(NETCAT_MODULE_STATS_OPENSTAT_ERROR_NEW_COUNTER_AUTH_ERROR, "error");
} else {
nc_print_status(NETCAT_MODULE_STATS_OPENSTAT_ERROR_DEL_COUNTER . $err_code, "error");
}
$UI_CONFIG->actionButtons[] = array("id" => "back", "caption" => NETCAT_MODULE_STATS_OPENSTAT_BACK, "align" => "left", "action" => "urlDispatcher.load('module.stats.openstat.counters')");
return;
}
}
$db->query("DELETE FROM `Stats_Openstat_Counters` WHERE `Counter_Id` = '" . $db->escape($del_counter->Counter_Id) . "'");
}
nc_print_status(NETCAT_MODULE_STATS_CHANGES_SAVED, "ok");
} elseif ($phase == 5) {
// Форма добавления своего кода счетчика
$ret = add_user_counter();
if ($ret) {
return;
}
} elseif ($phase == 7 && isset($_GET['counter_id'])) {
// вывод формы изменения
global $counter_id;
$counter_id = intval($counter_id);
$counter_params = $counters[$counter_id];
if (!$counter_params) {
nc_print_status(NETCAT_MODULE_STATS_OPENSTAT_INVALID_COUNTER_ID, "error");
} else {
if ($counter_params->User_Counter_Code) {
// свой код счетчика
$GLOBALS['CounterCatalogueId'] = $counter_params->Catalogue_Id;
$GLOBALS['UserCounterCode'] = $counter_params->Counter_Code;
$GLOBALS['CounterCatalogueId'] = $counter_params->Catalogue_Id;
$GLOBALS['CounterInAllTempl'] = 1;
add_user_counter();
} else {
// Автосгенерированный счетчик
$GLOBALS['CounterCatalogueId'] = $counter_params->Catalogue_Id;
$GLOBALS['CounterRating'] = $counter_params->Rating;
$GLOBALS['CounterAdvert'] = $counter_params->Advert;
$GLOBALS['CounterColor'] = $counter_params->Color;
$GLOBALS['CounterPicture'] = $counter_params->Size;
$GLOBALS['CounterTrackLinks'] = $counter_params->TrackLinks;
$GLOBALS['CounterInAllTempl'] = 1;
add_api_counter();
}
}
return;
} elseif ($phase == 8) {
// выбираем тип счетчика
if (!($sites_ddlist = show_sites_without_counter_ddlist($counters))) {
nc_print_status(NETCAT_MODULE_STATS_OPENSTAT_ERROR_ALREADY_COUNTERS_FOR_ALL_SITES, "error");
} else {
echo "<div style='position: absolute; top: 40%; width:95%; text-align: center;'>\n <p><a href='?sub_view=counters&phase=1'>" . NETCAT_MODULE_STATS_OPENSTAT_ADD_API_COUNTER . "</a></p>\n <br />\n <p><a href='?sub_view=counters&phase=5'>" . NETCAT_MODULE_STATS_OPENSTAT_ADD_USER_COUNTER . "</a></p>\n </div>\n";
}
$UI_CONFIG->actionButtons[] = array("id" => "back", "caption" => NETCAT_MODULE_STATS_OPENSTAT_BACK, "align" => "left", "action" => "urlDispatcher.load('module.stats.openstat.counters')");
return;
//.........这里部分代码省略.........
示例9: ShowMenu
function ShowMenu($CatalogueID, $phase1, $action1, $phase2, $action2)
{
global $db, $perm;
global $EDIT_DOMAIN, $HTTP_ROOT_PATH, $DOMAIN_NAME, $ADMIN_PATH, $SUB_FOLDER;
global $UI_CONFIG;
$CatalogueID = intval($CatalogueID);
$is_admin = $perm->isCatalogueAdmin($CatalogueID);
$Array = $db->get_row("SELECT * FROM `Catalogue` WHERE `Catalogue_ID`='" . $CatalogueID . "'");
if (!$Array) {
nc_print_status(CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWCATALOGUELIST_DBERROR, 'error');
EndHtml();
exit;
}
$countChild = HighLevelChildrenNumber($CatalogueID);
$ModerationType = $Array->Moderation_ID == 2 ? CLASSIFICATOR_TYPEOFMODERATION_MODERATION : CLASSIFICATOR_TYPEOFMODERATION_RIGHTAWAY;
$UserGroupName = array(1 => CLASSIFICATOR_USERGROUP_ALL, 2 => CLASSIFICATOR_USERGROUP_REGISTERED, 3 => CLASSIFICATOR_USERGROUP_AUTHORIZED);
// In MySQL 4.1, TIMESTAMP display format changes to be the same as DATETIME.
if (nc_strpos($Array->LastUpdated[4], '-')) {
$Array->LastUpdated = nc_substr($Array->LastUpdated, 0, 4) . "-" . nc_substr($Array->LastUpdated, 4, 2) . "-" . nc_substr($Array->LastUpdated, 6, 2) . " " . nc_substr($Array->LastUpdated, 8, 2) . ":" . nc_substr($Array->LastUpdated, 10, 2) . ":" . nc_substr($Array->LastUpdated, 12, 2);
}
echo "<br />\n\t<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td>\n\t<table border='0' cellpadding='0' cellspacing='1' width='100%'><tr><td>\n \t<table border='0' cellpadding='0' cellspacing='0' width='100%' class='border-bottom'>\n \t<tr><td width='50%'>" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_CREATED . ":</td><td>" . $Array->Created . "</td></tr>\n \t<tr><td>" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_UPDATED . ":</td><td>" . $Array->LastUpdated . "</td></tr>\n \t</table>\n\t</td></tr><tr><td>\n \t<table border='0' cellpadding='0' cellspacing='0' width='100%' class='border-bottom'>\n <tr><td width='50%'>" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_SECTIONSCOUNT . ":</td>";
echo "<td>" . $countChild;
if ($countChild) {
echo " ( <a href='" . $ADMIN_PATH . "subdivision/index.php?CatalogueID=" . $CatalogueID . "&ParentSubID=0'>" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWCATALOGUELIST_LIST . "</a>\n " . ($is_admin ? ", <a href='" . $ADMIN_PATH . "subdivision/index.php?phase=2&ParentSubID=0&CatalogueID=" . $CatalogueID . "'>" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_ADD . "\n </a> )" : ")") . "";
}
echo "</td></tr>\n \t<tr><td>" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_SITESTATUS . ":</td><td>" . ($Array->Checked ? CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_ON : CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_OFF) . "</td></tr>\n \t</table>\n\t</td></tr><tr><td>\n \t<table border='0' cellpadding='0' cellspacing='0' width='100%' class='border-bottom'>\n \t<tr><td width=50%>" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_READACCESS . ":</td><td>" . $UserGroupName[$Array->Read_Access_ID] . " " . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_USERS . "</td></tr>\n <tr><td>" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_ADDACCESS . ":</td><td>" . $UserGroupName[$Array->Write_Access_ID] . " " . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_USERS . "</td></tr>\n \t<tr><td>" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_EDITACCESS . ":</td><td>" . $UserGroupName[$Array->Edit_Access_ID] . " " . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_USERS . "</td></tr>\n \t<tr><td>" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_SUBSCRIBEACCESS . ":</td><td>" . $UserGroupName[$Array->Subscribe_Access_ID] . " " . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_USERS . "</td></tr>\n \t<tr><td>" . CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_PUBLISHACCESS . ":</td><td>" . $ModerationType . "</td></tr>\n \t</table>\n\t</td></tr></table></td></tr></table>";
$UI_CONFIG->actionButtons[] = array("id" => "delete", "caption" => CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_DELETE, "location" => "site.delete(" . $CatalogueID . ")", "red_border" => true);
$UI_CONFIG->actionButtons[] = array("id" => "preview", "caption" => CONTROL_CONTENT_CATALOUGE_FUNCS_SHOWMENU_VIEW, "action" => "urlDispatcher.load('http://" . ($Array->Domain ? strstr($Array->Domain, ".") ? $Array->Domain : $Array->Domain . "." . $DOMAIN_NAME : $DOMAIN_NAME) . $SUB_FOLDER . (nc_strlen(session_id()) > 0 ? "?" . session_name() . "=" . session_id() . "" : "") . "', '1')");
}
示例10: ExitIfNotAccess
/**
* Выйти, если нет права
*
* @param string тип сущности
* @param string действие
* @param int id
* @param string текст выводимой в плашке
* @param int будет ли запись в БД
* @return 1
*/
public function ExitIfNotAccess($instance_type, $action = "", $id = 0, $text = NETCAT_MODERATION_ERROR_NORIGHTS, $posting = 1)
{
if ($this->_guest && !$posting) {
return 1;
}
if ($this->_guest && $posting) {
nc_print_status(NETCAT_MODERATION_ERROR_NORIGHTGUEST, 'error');
EndHtml();
exit;
}
if ($this->_director) {
return 1;
}
if ($this->isAccess($instance_type, $action, $id, $posting)) {
return 1;
}
if (!$text) {
$text = NETCAT_MODERATION_ERROR_NORIGHTS;
}
// Права нет - на выход
nc_print_status($text, 'error');
EndHtml();
exit;
return 1;
}
示例11: UpdateOneClassificator_modal
function UpdateOneClassificator_modal($ClassificatorID, $IdInClassificator)
{
global $UI_CONFIG, $perm;
$nc_core = nc_Core::get_object();
$db = $nc_core->db;
$IdInClassificator = +$IdInClassificator;
$TableName = $db->escape(GetTableNameByID($ClassificatorID));
$Name = GetClassificatorNameByID($ClassificatorID);
$isSystem = IsSystemClassificator($ClassificatorID);
if ($isSystem) {
if (!$perm->isDirectAccessClassificator(NC_PERM_ACTION_VIEW, $ClassificatorID)) {
nc_print_status($NO_RIGHTS_MESSAGE, 'error');
EndHtml();
exit;
}
$edit_element = $perm->isDirectAccessClassificator(NC_PERM_ACTION_EDIT, $ClassificatorID);
} else {
$edit_element = $perm->isAccess(NC_PERM_CLASSIFICATOR, NC_PERM_ACTION_EDIT, $ClassificatorID);
}
echo nc_get_simple_modal_header($Name);
echo "<form method='post' id='adminForm' class='nc-form' action='classificator.php'>";
$SQL = "select `" . $TableName . "_Name`,\n `Value`\n from `Classificator_" . $TableName . "`\n where `" . $TableName . "_ID` = '" . $IdInClassificator . "'";
$Array = $db->get_row($SQL, ARRAY_N);
if (!$edit_element) {
print "" . CONTENT_CLASSIFICATORS_ELEMENT_NAME . ": " . $Array;
return;
}
echo "\n <div>" . CONTENT_CLASSIFICATORS_ELEMENT_NAME . ":</div>\n " . "\n <div>" . nc_admin_input_simple('NameInClassificator', $Array[0], 0, 'width: 30%;', "maxlength='256'") . "</div>\n <div>" . nc_admin_textarea_simple('ValueInClassificator', $Array[1], "\n <div>" . CONTENT_CLASSIFICATORS_ELEMENT_VALUE . ":</div>\n ", 7, 0, "style='width: 30%;'", 'soft') . "\n </div>\n\n <input type='hidden' name='phase' value='11'>\n <input type='hidden' name='ClassificatorID' value='" . $ClassificatorID . "'>\n <input type='hidden' name='IdInClassificator' value='" . $IdInClassificator . "'>\n " . $nc_core->token->get_input() . "\n </form>\n <script>prepare_message_form();</script>";
?>
</div>
<div class='nc_admin_form_buttons'>
<button type='button' class='nc_admin_metro_button nc-btn nc--blue' disable><?php
echo NETCAT_REMIND_SAVE_SAVE;
?>
</button>
<button type='button' class='nc_admin_metro_button_cancel nc-btn nc--red nc--bordered nc--right'><?php
echo CONTROL_BUTTON_CANCEL;
?>
</button>
</div>
<style>
a { color: #1a87c2; }
a:hover { text-decoration: none; }
a img { border: none; }
p { margin: 0px; padding: 0px 0px 18px 0px; }
h2 { font-size: 20px; font-family: 'Segoe UI', SegoeWP, Arial; color: #333333; font-weight: normal; margin: 0px; padding: 20px 0px 10px 0px; line-height: 20px; }
form { margin: 0px; padding: 0px; }
input { outline: none; }
.clear { margin: 0px; padding: 0px; font-size: 0px; line-height: 0px; height: 1px; clear: both; float: none; }
select, input, textarea { border: 1px solid #dddddd; }
:focus { outline: none; }
.input { outline: none; border: 1px solid #dddddd; }
</style>
<?php
}