本文整理汇总了PHP中is_html函数的典型用法代码示例。如果您正苦于以下问题:PHP is_html函数的具体用法?PHP is_html怎么用?PHP is_html使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_html函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index_immagini
function index_immagini()
{
$peer = new ImmagineProdottoServizioPeer();
ActiveRecordUtils::updateFilters($peer);
$elenco_immagini_prodotti_servizi = $peer->find();
$data = ActiveRecordUtils::toArray($elenco_immagini_prodotti_servizi);
if (is_html()) {
$data[Block::MARKER_KEY] = "vetrine/prodotti_servizi/select_immagine_prodotto_servizio";
}
return $data;
}
示例2: modify_image
function modify_image()
{
$peer = new GalleryImagePeer();
$do = $peer->updateByParams();
$peer->save($do);
if (is_html()) {
return Redirect::success();
} else {
return Redirect::failure();
}
}
示例3: modify_collection
function modify_collection()
{
$peer = new GalleryCollectionPeer();
$do = $peer->updateByParams();
$peer->save($do);
if (is_html()) {
return Redirect::success();
} else {
return Result::ok();
}
}
示例4: delete
function delete()
{
$peer = new DocumentiPeer();
$do = $peer->find_by_id(Params::get("id"));
$final_path = $do->save_folder . $do->hash_name;
$f = new File($final_path);
$f->delete();
$peer->delete($do);
if (is_html()) {
Flash::ok("Documento eliminato con successo.");
return Redirect::success();
} else {
return Result::ok();
}
}
示例5: delete_banner_group
function delete_banner_group()
{
$peer = new BannerPeer();
$peer->id_banner_group__EQUAL(Params::get("id_banner_group"));
$all_banners = $peer->find();
foreach ($all_banners as $banner) {
call("sponsor_banner", "delete_banner", array("id_banner" => $banner->id_banner));
}
$peer_group = new BannerGroupPeer();
$peer_group->delete_by_id(Params::get("id_banner_group"));
if (is_html()) {
Flash::ok("Contenuto testuale eliminato con successo!!");
return Redirect::success();
} else {
return Result::ok();
}
}
示例6: onCompleted
public function onCompleted(ProxyEvent $event)
{
$request = $event['request'];
$response = $event['response'];
$url = $request->getUri();
// we attach url_form only if this is a html response
if (!is_html($response->headers->get('content-type'))) {
return;
}
// this path would be relative to index.php that included it?
$url_form = render_template("./templates/url_form.php", array('url' => $url));
$output = $response->getContent();
// does the html page contain <body> tag, if so insert our form right after <body> tag starts
$output = preg_replace('@<body.*?>@is', '$0' . PHP_EOL . $url_form, $output, 1, $count);
// <body> tag was not found, just put the form at the top of the page
if ($count == 0) {
$output = $url_form . $output;
}
$response->setContent($output);
}
示例7: delete
function delete()
{
$peer = new FolderPeer();
$result = $peer->find_by_id(Params::get("id"));
$path = $result["path"];
$nome = $result["nome"];
$full_path = $path . $nome . "/";
$tipo = $result["tipo"];
$tipo_tokens = explode("_", $tipo);
$controller_name = $tipo_tokens[1];
call($controller_name, "delete_by_path", array("path" => $full_path));
$peer->delete($result);
if (is_html()) {
Flash::ok("Cartella eliminata con successo.");
return Redirect::success();
} else {
return Result::ok();
}
}
示例8: text
echo $lang["termsandconditions"];
?>
</h1>
<p><?php
echo text("introtext");
?>
</p>
<div class="Question">
<label><?php
echo $lang["termsandconditions"];
?>
</label>
<div class="Terms"><?php
$termstext = text("terms");
if (is_html($termstext)) {
echo $termstext;
} else {
echo txt2html($termstext);
}
?>
</div>
<div class="clearerleft"> </div>
</div>
<form method="post" action="<?php
echo $baseurl_short;
?>
pages/terms.php?k=<?php
echo urlencode($k);
?>
示例9: renderAdminMenu
function renderAdminMenu($menu, $level = 0, $current_rt = '')
{
$result = '';
if ($level) {
$result .= "<ul class=\"children child{$level}\">\r\n";
}
foreach ($menu as $item) {
$id = empty($item['id']) ? '' : ' id="menu_' . $item['id'] . '" ';
// li ID
$class = $level != 0 ? empty($item['children']) ? '' : ' class="parent" ' : ' class="top" ';
//a class
$href = empty($item['href']) ? '' : ' href="' . $item['href'] . '" ';
//a href
$onclick = empty($item['onclick']) ? '' : ' onclick="' . $item['onclick'] . '" ';
//a href
$child_class = "level{$level} ";
if (!empty($item['children'])) {
$child_class .= 'nav-parent ';
}
if ($item['rt'] && $current_rt == $item['rt']) {
$child_class .= 'active ';
}
if ($child_class) {
$child_class = ' class="' . $child_class . '"';
}
$result .= '<li' . $id . $child_class . '>';
$result .= '<a ' . $class . $href . $onclick . '>';
//check icon rl type html, image or none.
if (is_html($item['icon'])) {
$result .= $item['icon'];
} else {
if ($item['icon']) {
$result .= '<img class="menu_image" src="' . HTTPS_DIR_RESOURCE . $item['icon'] . '" alt="" />';
} else {
$result .= '<i class="fa fa-caret-right"></i> ';
}
}
$result .= '<span class="menu_text">' . $item['text'] . '</span></a>';
//if children build inner clild trees
if (!empty($item['children'])) {
$result .= "\r\n" . renderAdminMenu($item['children'], $level + 1, $current_rt);
}
$result .= "</li>\r\n";
}
if ($level) {
$result .= "</ul>\r\n";
}
return $result;
}
示例10: url_is_html
function url_is_html($url, $login = false, $pass = false)
{
return is_html(fetch_file_contents($url, false, $login, $pass));
}
示例11: buildStoreFrontMenuTree
function buildStoreFrontMenuTree($menu_array, $level = 0)
{
$menu_array = (array) $menu_array;
if (!$menu_array) {
return '';
}
$result = '';
//for submenus build new UL node
if ($level > 0) {
$result .= "<ul class='sub_menu dropdown-menu'>\r\n";
}
$registry = Registry::getInstance();
$logged = $registry->get('customer')->isLogged();
foreach ($menu_array as $item) {
if ($logged && $item['id'] == 'login' || !$logged && $item['id'] == 'logout') {
continue;
}
//build appropriate menu id and classes for css controll
$id = empty($item['id']) ? '' : ' data-id="menu_' . $item['id'] . '" ';
// li ID
if ($level != 0) {
if (empty($item['children'])) {
$class = $item['icon'] ? ' class="top nobackground"' : ' class="sub menu_' . $item['id'] . '" ';
} else {
$class = $item['icon'] ? ' class="parent nobackground" ' : ' class="parent menu_' . $item['id'] . '" ';
}
} else {
$class = $item['icon'] ? ' class="top nobackground"' : ' class="top menu_' . $item['id'] . '" ';
}
$href = empty($item['href']) ? '' : ' href="' . $item['href'] . '" ';
//construct HTML
$result .= '<li ' . $id . ' class="dropdown hover">';
$result .= '<a ' . $class . $href . '>';
//check icon rl type html, image or none.
if (is_html($item['icon'])) {
$result .= $item['icon'];
} else {
if ($item['icon']) {
$result .= '<img class="menu_image" src="' . HTTP_DIR_RESOURCE . $item['icon'] . '" alt="" />';
}
}
$result .= '<span class="menu_text">' . $item['text'] . '</span></a>';
//if children build inner clild tree
if (!empty($item['children'])) {
$result .= "\r\n" . buildStoreFrontMenuTree($item['children'], $level + 1);
}
$result .= "</li>\r\n";
}
if ($level > 0) {
$result .= "</ul>\r\n";
}
return $result;
}
示例12: subscribe2
function subscribe2()
{
$feed_url = $this->dbh->escape_string(trim($_REQUEST["feed_url"]));
$cat_id = $this->dbh->escape_string($_REQUEST["cat_id"]);
$from = $this->dbh->escape_string($_REQUEST["from"]);
$feed_urls = array();
/* only read authentication information from POST */
$auth_login = $this->dbh->escape_string(trim($_POST["auth_login"]));
$auth_pass = $this->dbh->escape_string(trim($_POST["auth_pass"]));
$rc = subscribe_to_feed($feed_url, $cat_id, $auth_login, $auth_pass);
switch ($rc) {
case 1:
print_notice(T_sprintf("Subscribed to <b>%s</b>.", $feed_url));
break;
case 2:
print_error(T_sprintf("Could not subscribe to <b>%s</b>.", $feed_url));
break;
case 3:
print_error(T_sprintf("No feeds found in <b>%s</b>.", $feed_url));
break;
case 0:
print_warning(T_sprintf("Already subscribed to <b>%s</b>.", $feed_url));
break;
case 4:
print_notice(__("Multiple feed URLs found."));
$contents = @fetch_file_contents($url, false, $auth_login, $auth_pass);
if (is_html($contents)) {
$feed_urls = get_feeds_from_html($url, $contents);
}
break;
case 5:
print_error(T_sprintf("Could not subscribe to <b>%s</b>.<br>Can't download the Feed URL.", $feed_url));
break;
}
if ($feed_urls) {
print "<form action=\"backend.php\">";
print "<input type=\"hidden\" name=\"op\" value=\"pref-feeds\">";
print "<input type=\"hidden\" name=\"quiet\" value=\"1\">";
print "<input type=\"hidden\" name=\"method\" value=\"add\">";
print "<select name=\"feed_url\">";
foreach ($feed_urls as $url => $name) {
$url = htmlspecialchars($url);
$name = htmlspecialchars($name);
print "<option value=\"{$url}\">{$name}</option>";
}
print "<input type=\"submit\" value=\"" . __("Subscribe to selected feed") . "\">";
print "</form>";
}
$tp_uri = get_self_url_prefix() . "/prefs.php";
$tt_uri = get_self_url_prefix();
if ($rc <= 2) {
$result = $this->dbh->query("SELECT id FROM ttrss_feeds WHERE\n\t\t\t\tfeed_url = '{$feed_url}' AND owner_uid = " . $_SESSION["uid"]);
$feed_id = $this->dbh->fetch_result($result, 0, "id");
} else {
$feed_id = 0;
}
print "<p>";
if ($feed_id) {
print "<form method=\"GET\" style='display: inline'\n\t\t\t\taction=\"{$tp_uri}\">\n\t\t\t\t<input type=\"hidden\" name=\"tab\" value=\"feedConfig\">\n\t\t\t\t<input type=\"hidden\" name=\"method\" value=\"editFeed\">\n\t\t\t\t<input type=\"hidden\" name=\"methodparam\" value=\"{$feed_id}\">\n\t\t\t\t<input type=\"submit\" value=\"" . __("Edit subscription options") . "\">\n\t\t\t\t</form>";
}
print "<form style='display: inline' method=\"GET\" action=\"{$tt_uri}\">\n\t\t\t<input type=\"submit\" value=\"" . __("Return to Tiny Tiny RSS") . "\">\n\t\t\t</form></p>";
print "</body></html>";
}
示例13: sanitize
/**
* MÈtodo Para la aplicación de seguridad
* a bajo nivel, recibe un array de datos
* y limpia sus elementos de manera b·sica
* pero efectiva
* @param array $data
* @param sanitiser $sanitiser: el sanitizador de html purify
* @param bool $is_cookie: identifica si el elemento a identificar es una cookie
*/
function sanitize($data, $sanitiser, $is_cookie = false)
{
//recorro todos los datos que me pasan
foreach ($data as $key => $data_element) {
//si es una cookie, sanitizo una cookie
if ($is_cookie) {
$data[$key] = filter_var($data_element, FILTER_SANITIZE_STRING);
//caracteres que no gustan a php
} else {
//si el dato es un array, recursión
if (is_array($data_element)) {
sanitize($data_element, $sanitiser);
} else {
//en caso contrario, sanitizo mínimamente
//si contiene cualquier etiqueta html /javascript
if (is_html($data[$key])) {
$data[$key] = $sanitiser->purify($data[$key]);
//protección contra xss
} else {
//si es una variable "normal"
$data[$key] = filter_var($data_element, FILTER_SANITIZE_STRING);
//caracteres que no gustan a php
$data[$key] = prevent_sqlinjection($data[$key]);
//protección contra sql injection
}
}
}
}
return $data;
}
示例14: import
function import()
{
$data = Params::get("import_data");
$peer = new TestiPeer();
$import_export = DB::newTableDataImportExport();
$import_export->import_data($data);
if (is_html()) {
return Redirect::success();
} else {
return Result::ok();
}
}
示例15: function
} else {
if (class_exists('\\Proxy\\Plugin\\' . $plugin_class)) {
// does the native plugin from php-proxy package with such name exist?
$plugin_class = '\\Proxy\\Plugin\\' . $plugin_class;
}
}
// otherwise plugin_class better be loaded already and match namespace exactly \\Vendor\\Plugin\\SuperPlugin
$proxy->getEventDispatcher()->addSubscriber(new $plugin_class());
}
// provide URL form
$proxy->getEventDispatcher()->addListener('request.complete', function ($event) {
$request = $event['request'];
$response = $event['response'];
$url = $request->getUri();
// we attach url_form only if this is a html response
if (!is_html($response->headers->get('content-type'))) {
return;
}
# $url_form = render_template("./templates/url_form.php", array(
# 'url' => $url
# ));
$output = $response->getContent();
// does the html page contain <body> tag, if so insert our form right after <body> tag starts
$output = preg_replace('@<body.*?>@is', '$0' . PHP_EOL . $url_form, $output, 1, $count);
// <body> tag was not found, just put the form at the top of the page
if ($count == 0) {
$output = $url_form . $output;
}
$response->setContent($output);
});
try {