本文整理汇总了PHP中is_html函数的典型用法代码示例。如果您正苦于以下问题:PHP is_html函数的具体用法?PHP is_html怎么用?PHP is_html使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_html函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:mbcraft,项目名称:frozen,代码行数:11,代码来源:ProdottoServizioController.class.php
示例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();
}
}
开发者ID:mbcraft,项目名称:frozen,代码行数:11,代码来源:GalleryImageController.class.php
示例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();
}
}
开发者ID:mbcraft,项目名称:frozen,代码行数:11,代码来源:GalleryCollectionController.class.php
示例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();
}
}
开发者ID:mbcraft,项目名称:frozen,代码行数:15,代码来源:DocumentiController.class.php
示例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();
}
}
开发者ID:mbcraft,项目名称:frozen,代码行数:17,代码来源:SponsorBannerController.class.php
示例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);
}
开发者ID:TylerWolfe,项目名称:php-proxy-app,代码行数:20,代码来源:UrlFormPlugin.php
示例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();
}
}
开发者ID:mbcraft,项目名称:frozen,代码行数:19,代码来源:FoldersController.class.php
示例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);
?>
开发者ID:chandradrupal,项目名称:resourcespace,代码行数:31,代码来源:terms.php
示例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;
}
开发者ID:siddht1,项目名称:abantecart-src,代码行数:49,代码来源:html.php
示例10: url_is_html
function url_is_html($url, $login = false, $pass = false)
{
return is_html(fetch_file_contents($url, false, $login, $pass));
}
开发者ID:rclsilver,项目名称:openshift-tt-rss,代码行数:4,代码来源:functions.php
示例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;
}
开发者ID:harshzalavadiya,项目名称:fatak,代码行数:53,代码来源:html.php
示例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>";
}
开发者ID:cs-team,项目名称:tiny_tiny_rss-openshift-quickstart,代码行数:63,代码来源:public.php
示例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;
}
开发者ID:migumuno,项目名称:Core,代码行数:39,代码来源:functions.php
示例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();
}
}
开发者ID:mbcraft,项目名称:frozen,代码行数:12,代码来源:TestiController.class.php
示例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 {
开发者ID:HomeAutomationViaPi,项目名称:Server,代码行数:31,代码来源:index.php
示例16: send_mail_phpmailer
//.........这里部分代码省略.........
$mail->Username = $smtp_username;
// username
$mail->Password = $smtp_password;
// password
}
$reply_tos = explode(",", $reply_to);
// only one from address is possible, so only use the first one:
if (strstr($reply_tos[0], "<")) {
$rtparts = explode("<", $reply_tos[0]);
$mail->From = str_replace(">", "", $rtparts[1]);
$mail->FromName = $rtparts[0];
} else {
$mail->From = $reply_tos[0];
$mail->FromName = $from_name;
}
// if there are multiple addresses, that's what replyto handles.
for ($n = 0; $n < count($reply_tos); $n++) {
if (strstr($reply_tos[$n], "<")) {
$rtparts = explode("<", $reply_tos[$n]);
$mail->AddReplyto(str_replace(">", "", $rtparts[1]), $rtparts[0]);
} else {
$mail->AddReplyto($reply_tos[$n], $from_name);
}
}
# modification to handle multiple comma delimited emails
# such as for a multiple $email_notify
$emails = $email;
$emails = explode(',', $emails);
$emails = array_map('trim', $emails);
foreach ($emails as $email) {
if (strstr($email, "<")) {
$emparts = explode("<", $email);
$mail->AddAddress(str_replace(">", "", $emparts[1]), $emparts[0]);
} else {
$mail->AddAddress($email);
}
}
if ($cc != "") {
# modification for multiple is also necessary here, though a broken cc seems to be simply removed by phpmailer rather than breaking it.
$ccs = $cc;
$ccs = explode(',', $ccs);
$ccs = array_map('trim', $ccs);
global $userfullname;
foreach ($ccs as $cc) {
if (strstr($cc, "<")) {
$ccparts = explode("<", $cc);
$mail->AddCC(str_replace(">", "", $ccparts[1]), $ccparts[0]);
} else {
$mail->AddCC($cc, $userfullname);
}
}
}
if ($bcc != "") {
# modification for multiple is also necessary here, though a broken cc seems to be simply removed by phpmailer rather than breaking it.
$bccs = $bcc;
$bccs = explode(',', $bccs);
$bccs = array_map('trim', $bccs);
global $userfullname;
foreach ($bccs as $bccemail) {
if (strstr($bccemail, "<")) {
$bccparts = explode("<", $bccemail);
$mail->AddBCC(str_replace(">", "", $bccparts[1]), $bccparts[0]);
} else {
$mail->AddBCC($bccemail, $userfullname);
}
}
}
$mail->CharSet = "utf-8";
if (is_html($body)) {
$mail->IsHTML(true);
} else {
$mail->IsHTML(false);
}
$mail->Subject = $subject;
$mail->Body = $body;
if (isset($embed_thumbnail) && isset($templatevars['thumbnail'])) {
$mail->AddEmbeddedImage($templatevars['thumbnail'], $thumbcid, $thumbcid, 'base64', 'image/jpeg');
}
if (isset($images)) {
foreach ($images as $image) {
$mail->AddEmbeddedImage($image, basename($image), basename($image), 'base64', 'image/gif');
}
}
if (isset($attachments)) {
foreach ($attachments as $attachment) {
$mail->AddAttachment($attachment, basename($attachment));
}
}
if (is_html($body)) {
$h2t = new html2text($body);
$text = $h2t->get_text();
$mail->AltBody = $text;
}
if (!$mail->Send()) {
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
hook("aftersendmailphpmailer", "", $email);
}
开发者ID:artsmia,项目名称:mia_resourcespace,代码行数:101,代码来源:general.php
示例17: __defaultReturn
function __defaultReturn($success_message, $error_messages)
{
if (is_html()) {
if (!$error_messages) {
Flash::ok($success_message);
return Redirect::success();
} else {
foreach ($error_messages as $error_msg) {
Flash::error($error_msg);
}
return Redirect::failure();
}
} else {
if (!$error_messages) {
return Result::ok();
} else {
return Result::error($error_messages);
}
}
}
开发者ID:mbcraft,项目名称:frozen,代码行数:20,代码来源:AbstractEntityController.class.php
示例18: elimina_prodotto_servizio_vetrina
function elimina_prodotto_servizio_vetrina()
{
$peer = new ProdottoServizioVetrinaPeer();
$do = $peer->find_by_id(Params::get("id_prodotto_servizio_vetrina"));
$peer->delete($do);
if (is_html()) {
return Redirect::success();
} else {
return Result::ok();
}
}
开发者ID:mbcraft,项目名称:frozen,代码行数:11,代码来源:VetrineController.class.php
示例19: delete
function delete()
{
$peer = new FolderPeer();
$result = $peer->find_by_id(Params::get("id"));
self::delete_attributes($result);
$peer->delete($result);
if (is_html()) {
Flash::ok("Cartella eliminata con successo.");
return Redirect::success();
} else {
return Result::ok();
}
}
开发者ID:mbcraft,项目名称:frozen,代码行数:13,代码来源:FoldersController.class.php
示例20: subscribe_to_feed
/**
* @return array (code => Status code, message => error message if available)
*
* 0 - OK, Feed already exists
* 1 - OK, Feed added
* 2 - Invalid URL
* 3 - URL content is HTML, no feeds available
* 4 - URL content is HTML which contains multiple feeds.
* Here you should call extractfeedurls in rpc-backend
* to get all possible feeds.
* 5 - Couldn't download the URL content.
* 6 - Content is an invalid XML.
*/
function subscribe_to_feed($url, $cat_id = 0, $auth_login = '', $auth_pass = '')
{
global $fetch_last_error;
require_once "include/rssfuncs.php";
$url = fix_url($url);
if (!$url || !validate_feed_url($url)) {
return array("code" => 2);
}
$contents = @fetch_file_contents($url, false, $auth_login, $auth_pass);
if (!$contents) {
return array("code" => 5, "message" => $fetch_last_error);
}
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SUBSCRIBE_FEED) as $plugin) {
$contents = $plugin->hook_subscribe_feed($contents, $url, $auth_login, $auth_pass);
}
if (is_html($contents)) {
$feedUrls = get_feeds_from_html($url, $contents);
if (count($feedUrls) == 0) {
return array("code" => 3);
} else {
if (count($feedUrls) > 1) {
return array("code" => 4, "feeds" => $feedUrls);
}
}
//use feed url as new URL
$url = key($feedUrls);
}
if ($cat_id == "0" || !$cat_id) {
$cat_qpart = "NULL";
} else {
$cat_qpart = "'{$cat_id}'";
}
$result = db_query("SELECT id FROM ttrss_feeds\n\t\t\tWHERE feed_url = '{$url}' AND owner_uid = " . $_SESSION["uid"]);
if (strlen(FEED_CRYPT_KEY) > 0) {
require_once "crypt.php";
$auth_pass = substr(encrypt_string($auth_pass), 0, 250);
$auth_pass_encrypted = 'true';
} else {
$auth_pass_encrypted = 'false';
}
$auth_pass = db_escape_string($auth_pass);
if (db_num_rows($result) == 0) {
$result = db_query("INSERT INTO ttrss_feeds\n\t\t\t\t\t(owner_uid,feed_url,title,cat_id, auth_login,auth_pass,update_method,auth_pass_encrypted)\n\t\t\t\tVALUES ('" . $_SESSION["uid"] . "', '{$url}',\n\t\t\t\t'[Unknown]', {$cat_qpart}, '{$auth_login}', '{$auth_pass}', 0, {$auth_pass_encrypted})");
$result = db_query("SELECT id FROM ttrss_feeds WHERE feed_url = '{$url}'\n\t\t\t\t\tAND owner_uid = " . $_SESSION["uid"]);
$feed_id = db_fetch_result($result, 0, "id");
if ($feed_id) {
set_basic_feed_info($feed_id);
}
return array("code" => 1);
} else {
return array("code" => 0);
}
}
开发者ID:nota-ja,项目名称:tt-rss,代码行数:66,代码来源:functions.php
注:本文中的is_html函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论