• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP strip_formatting函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中strip_formatting函数的典型用法代码示例。如果您正苦于以下问题:PHP strip_formatting函数的具体用法?PHP strip_formatting怎么用?PHP strip_formatting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了strip_formatting函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: findPairsForSelectForm

 public function findPairsForSelectForm(array $options = array())
 {
     $db = $this->getDb();
     $subquery = new Omeka_Db_Select();
     $subquery->from(array('element_texts' => $db->ElementText), 'id');
     $subquery->joinInner(array('elements' => $db->Element), 'elements.id = element_texts.element_id', array());
     $subquery->joinInner(array('element_sets' => $db->ElementSet), 'element_sets.id = elements.element_set_id', array());
     $subquery->where("element_sets.name = 'Dublin Core'");
     $subquery->where("elements.name = 'Title'");
     $subquery->where("element_texts.record_type = 'Collection'");
     $subquery->where('element_texts.record_id = collections.id');
     $subquery->limit(1);
     $select = $this->getSelectForFindBy($options);
     $select->joinLeft(array('element_texts' => $db->ElementText), "element_texts.id = ({$subquery})", array());
     $select->reset(Zend_Db_Select::COLUMNS);
     $select->from(array(), array('collections.id', 'element_texts.text'));
     $select->order('element_texts.text');
     $pairs = $db->fetchPairs($select);
     foreach ($pairs as $collectionId => &$name) {
         if ($name === null || $name == '') {
             $name = __('[Untitled] #%s', $collectionId);
         } else {
             $name = strip_formatting($name);
         }
     }
     return $pairs;
 }
开发者ID:lchen01,项目名称:STEdwards,代码行数:27,代码来源:Collection.php


示例2: show_untitled_items

function show_untitled_items($title)
{
    // Remove all whitespace and formatting before checking to see if the title
    // is empty.
    $prepTitle = trim(strip_formatting($title));
    if (empty($prepTitle)) {
        return __('[Untitled]');
    }
    return $title;
}
开发者ID:kyfr59,项目名称:cg35,代码行数:10,代码来源:functions.php


示例3: testCanSetValidPropertiesForCollection

 public function testCanSetValidPropertiesForCollection()
 {
     // build the collection
     $this->builder->setRecordMetadata(array('public' => true, 'featured' => false, 'owner_id' => self::USER_ID));
     $elementTexts = array('Dublin Core' => array('Title' => array(array('text' => 'foobar', 'html' => false)), 'Description' => array(array('text' => 'foobar desc', 'html' => false))));
     $this->builder->setElementTexts($elementTexts);
     $collection = $this->builder->build();
     $this->assertEquals('foobar', strip_formatting(metadata($collection, array('Dublin Core', 'Title'))));
     $this->assertEquals('foobar desc', strip_formatting(metadata($collection, array('Dublin Core', 'Description'))));
     $this->assertEquals("1", $collection->public);
     $this->assertEquals("0", $collection->featured);
     $this->assertEquals(self::USER_ID, $collection->owner_id, "Collection's 'owner_id' column should have been set.");
 }
开发者ID:emhoracek,项目名称:Omeka,代码行数:13,代码来源:CollectionTest.php


示例4: exhibit_builder_link_to_exhibit_item

/**
 * Return a link to an item within an exhibit.
 *
 * @param string $text Link text (by default, the item title is used)
 * @param array $props Link attributes
 * @param Item $item If null, will use the current item.
 * @return string
 */
function exhibit_builder_link_to_exhibit_item($text = null, $props = array(), $item = null)
{
    if (!$item) {
        $item = get_current_record('item');
    }
    if (!isset($props['class'])) {
        $props['class'] = 'exhibit-item-link';
    }
    $uri = exhibit_builder_exhibit_item_uri($item);
    $text = !empty($text) ? $text : strip_formatting(metadata($item, array('Dublin Core', 'Title')));
    $html = '<a href="' . html_escape($uri) . '" ' . tag_attributes($props) . '>' . $text . '</a>';
    $html = apply_filters('exhibit_builder_link_to_exhibit_item', $html, array('text' => $text, 'props' => $props, 'item' => $item));
    return $html;
}
开发者ID:regan008,项目名称:WearingGayHistory-Plugins,代码行数:22,代码来源:ExhibitFunctions.php


示例5: itemToRSS

 protected function itemToRSS($item)
 {
     $entry = array();
     set_current_record('item', $item, true);
     // Title is a CDATA section, so no need for extra escaping.
     $entry['title'] = strip_formatting(metadata($item, array('Dublin Core', 'Title'), array('no_escape' => true)));
     $entry['description'] = $this->buildDescription($item);
     $entry['link'] = xml_escape(record_url($item, null, true));
     $entry['lastUpdate'] = strtotime($item->added);
     //List the first file as an enclosure (only one per RSS feed)
     if (($files = $item->Files) && ($file = current($files))) {
         $entry['enclosure'] = array();
         $fileDownloadUrl = file_display_url($file);
         $enc['url'] = $fileDownloadUrl;
         $enc['type'] = $file->mime_type;
         $enc['length'] = (int) $file->size;
         $entry['enclosure'][] = $enc;
     }
     return $entry;
 }
开发者ID:lchen01,项目名称:STEdwards,代码行数:20,代码来源:ItemRss2.php


示例6: get_html_lang

<!DOCTYPE html>
<html lang="<?php 
echo get_html_lang();
?>
">
<head>
    <meta charset="utf-8">

    <title><?php 
echo __('Omeka Admin');
?>
: <?php 
echo option('site_title');
echo isset($title) ? ' | ' . strip_formatting($title) : '';
?>
</title>

<?php 
queue_css_file(array('style', 'skeleton', 'jquery-ui'));
queue_css_file('media/960min', 'only screen and (min-width: 960px)');
queue_css_file('media/768min', 'only screen and (min-width: 768px) and (max-width: 959px)');
queue_css_file('media/767max', 'only screen and (max-width: 767px)');
queue_css_file('media/479max', 'only screen and (max-width: 479px)');
queue_css_url('https://fonts.googleapis.com/css?family=Arvo:400,700,400italic,700italic|Cabin:400,700,400italic,700italic');
queue_js_file(array('vendor/respond', 'vendor/modernizr', 'vendor/selectivizr', 'globals'));
?>

<!-- Stylesheets -->
<?php 
echo head_css();
?>
开发者ID:KelvinSmithLibrary,项目名称:playhouse,代码行数:31,代码来源:index.php


示例7: all_element_texts

echo all_element_texts('collection');
?>

<div id="collection-items">
    <!--<h2><?php 
echo link_to_items_browse(__('Items in the %', $collectionTitle), array('collection' => metadata('collection', 'id')));
?>
</h2>-->
    <?php 
if (metadata('collection', 'total_items') > 0) {
    ?>
        <?php 
    foreach (loop('items') as $item) {
        ?>
        <?php 
        $itemTitle = strip_formatting(metadata('item', array('Dublin Core', 'Title')));
        ?>
        <div class="item hentry">
            <h3><?php 
        echo link_to_item($itemTitle, array('class' => 'permalink'));
        ?>
</h3>

            <?php 
        if (metadata('item', 'has thumbnail')) {
            ?>
            <div class="item-img">
                <?php 
            echo link_to_item(item_image('square_thumbnail', array('alt' => $itemTitle)));
            ?>
            </div>
开发者ID:HCDigitalScholarship,项目名称:peacetestimonies,代码行数:31,代码来源:show.php


示例8: hookPublicCollectionsShow

 public function hookPublicCollectionsShow()
 {
     if (get_option(SocialBookmarkingPlugin::ADD_TO_OMEKA_COLLECTIONS_OPTION) == '1') {
         $collection = get_current_record('collection');
         $url = record_url($collection, 'show', true);
         $title = strip_formatting(metadata($collection, array('Dublin Core', 'Title')));
         $description = strip_formatting(metadata($collection, array('Dublin Core', 'Description')));
         echo '<h2>' . __('Social Bookmarking') . '</h2>';
         echo social_bookmarking_toolbar($url, $title, $description);
     }
 }
开发者ID:regan008,项目名称:WearingGayHistory-Plugins,代码行数:11,代码来源:SocialBookmarkingPlugin.php


示例9: getProperty

 /**
  * Get a property or special value of this record.
  *
  * @param string $property
  * @return mixed
  */
 public function getProperty($property)
 {
     switch ($property) {
         case 'uri':
             return $this->getWebPath('original');
         case 'fullsize_uri':
             return $this->getWebPath('fullsize');
         case 'thumbnail_uri':
             return $this->getWebPath('thumbnail');
         case 'square_thumbnail_uri':
             return $this->getWebPath('square_thumbnail');
         case 'permalink':
             return absolute_url(array('controller' => 'files', 'action' => 'show', 'id' => $this->id));
         case 'display_title':
             $titles = $this->getElementTexts('Dublin Core', 'Title');
             if ($titles) {
                 $title = strip_formatting($titles[0]->text);
             } else {
                 $title = $this->original_filename;
             }
             return $title;
         default:
             return parent::getProperty($property);
     }
 }
开发者ID:kwiliarty,项目名称:Omeka,代码行数:31,代码来源:File.php


示例10: metadata

<?php

$fileTitle = metadata('file', array('Dublin Core', 'Title')) ? strip_formatting(metadata('file', array('Dublin Core', 'Title'))) : metadata('file', 'original filename');
if ($fileTitle != '') {
    $fileTitle = ': &quot;' . $fileTitle . '&quot; ';
} else {
    $fileTitle = '';
}
$fileTitle = __('File #%s', metadata('file', 'id')) . $fileTitle;
echo head(array('title' => $fileTitle, 'bodyclass' => 'files show primary-secondary'));
?>

<div class="container single-item">
    <div class="content-block">
        <h1><?php 
echo $fileTitle;
?>
</h1>
        <div class="row">
            <div class="col-sm-5">
                <?php 
echo file_markup($file, array('imageSize' => 'original'));
?>
            </div>
            <div class="col-sm-7">
                <?php 
echo all_element_texts('file');
?>
                <div id="original-filename" class="element">
                    <h6><?php 
echo __('Original Filename');
开发者ID:pyscajor,项目名称:cornishmemory-omeka,代码行数:31,代码来源:show.php


示例11: metadata

<?php

/**
 * The edit query view for a specific Timeline.
 */
$timelineTitle = metadata($neatline_time_timeline, 'title');
$title = __('Neatline Time | Edit "%s" Items Query', strip_formatting($timelineTitle));
$head = array('bodyclass' => 'timelines primary', 'title' => $title);
echo head($head);
?>
<script type="text/javascript" charset="utf-8">
    jQuery(window).load(function(){
       Omeka.Search.activateSearchButtons; 
    });
</script>
    <?php 
$query = unserialize($neatline_time_timeline->query);
if ($query && is_array($query)) {
    ?>
    <p><strong><?php 
    echo __('The &#8220;%s&#8221; timeline displays items that match the following query:', $timelineTitle);
    ?>
</strong></p>
<?php 
    echo item_search_filters($query);
}
echo items_search_form(array(), current_url());
echo foot();
开发者ID:rameysar,项目名称:Omeka-Grinnell-RomanCiv,代码行数:28,代码来源:query.php


示例12: getDisplayTitle

 /**
  * Get a title suitable for display through metadata()
  *
  * @return string
  */
 public function getDisplayTitle()
 {
     $titles = $this->getElementTexts('Dublin Core', 'Title');
     if ($titles) {
         $title = $titles[0]->text;
         if ($titles[0]->html) {
             $title = html_entity_decode(strip_formatting($title), ENT_QUOTES, 'UTF-8');
         }
     } else {
         $title = $this->original_filename;
     }
     return $title;
 }
开发者ID:emhoracek,项目名称:Omeka,代码行数:18,代码来源:File.php


示例13: _linkToFile

 /**
  * Add a link for the file based on the given set of options.
  * 
  * If the 'linkToMetadata' option is true, then link to the file
  * metadata page (files/show).  If 'linkToFile' is true,
  * link to the original file, and if 'linkToFile' is a string, try
  * to link to that specific derivative. Otherwise just return the
  * $html without wrapping in a link.
  * 
  * The attributes for the link will be based off the 'linkAttributes' 
  * option, which should be an array.
  * 
  * If $html is null, it defaults to original filename of the file.
  * 
  * @param File $file
  * @param array $options
  * @param string $html
  * @return string
  */
 protected function _linkToFile($file, $options, $html = null)
 {
     if ($html === null) {
         $fileTitle = strip_formatting(metadata($file, array('Dublin Core', 'Title')));
         $html = $fileTitle ? $fileTitle : metadata($file, 'Original Filename');
     }
     if ($options['linkToMetadata']) {
         $html = link_to_file_show((array) $options['linkAttributes'], $html, $file);
     } else {
         if ($linkToFile = $options['linkToFile']) {
             // If you've manually specified a derivative type to link
             // to, and this file actually has derivatives, we'll use
             // that, otherwise, the link is to the "original" file.
             if (is_string($linkToFile) && $file->hasThumbnail()) {
                 $derivative = $linkToFile;
             } else {
                 $derivative = 'original';
             }
             // Wrap in a link that will download the file directly.
             $defaultLinkAttributes = array('class' => 'download-file', 'href' => $file->getWebPath($derivative));
             $linkAttributes = array_key_exists('linkAttributes', $options) ? $options['linkAttributes'] : array();
             $linkAttributes = array_merge($defaultLinkAttributes, $linkAttributes);
             $html = '<a ' . tag_attributes($linkAttributes) . '>' . $html . '</a>';
         }
     }
     return $html;
 }
开发者ID:rameysar,项目名称:Omeka-Grinnell-RomanCiv,代码行数:46,代码来源:FileMarkup.php


示例14: hookPublicItemsShow

 /**
  * Display the links to the catalogs on the public item page.
  */
 public function hookPublicItemsShow()
 {
     $item = get_current_record('item');
     $subject_full = strip_formatting(metadata($item, array('Dublin Core', 'Subject')));
     $subject_simple = cleanSubjectString($subject_full);
     /* Only display the links if the item has a subject */
     if ($subject_full !== "") {
         echo "<div id='catalog-search' class='element'>";
         echo "<h3>" . __("Catalog Search") . "</h3>";
         echo "<p>" . __("Search for related records in these catalogs:") . "</p>";
         $searches = get_db()->getTable('CatalogSearchSearch')->getAllCatalogSearches();
         foreach ($searches as $search) {
             // Decide whether to use full or simple query terms.
             if ($search->query_type == '0') {
                 $subject_use = $subject_full;
             } elseif ($search->query_type == '1') {
                 $subject_use = $subject_simple;
             }
             // Echo the search link to the catalog.
             echo "<div class='element-text'><a href='" . getCatalogSearchUrl($search->query_string, $subject_use) . "'>" . $search->catalog_name . "</a></div>";
         }
         echo "</div>";
     }
 }
开发者ID:sgbalogh,项目名称:peddler_clone5,代码行数:27,代码来源:CatalogSearchPlugin.php


示例15: strip_formatting

<?php

$userTitle = strip_formatting($user->username);
if ($userTitle != '') {
    $userTitle = ': &quot;' . html_escape($userTitle) . '&quot; ';
} else {
    $userTitle = '';
}
$userTitle = __('Edit User #%s', $user->id) . $userTitle;
echo head(array('title' => $userTitle, 'bodyclass' => 'users'));
echo common('users-nav', array('user' => $user));
echo flash();
?>
<form method="post" action="">
<h3><?php 
echo __('API Keys');
?>
</h3>
<div class="field">
    <div class="two columns alpha">
        <label for="search_record_types"><?php 
echo __('New key label');
?>
</label>
    </div>
    <div class="inputs five columns omega">
        <p class="explanation"><?php 
echo __('To create a new API key, enter a label for the key below. For example, ' . 'describe for what purpose it will be used. This key will have all your ' . 'permissions; treat it as you would your password.');
?>
</p>
        <?php 
开发者ID:lchen01,项目名称:STEdwards,代码行数:31,代码来源:api-keys.php


示例16: metadata

<div class="collection record">
    <?php 
$title = metadata($collection, array('Dublin Core', 'Title'));
$description = metadata($collection, array('Dublin Core', 'Description'), array('snippet' => 150));
?>
    <h3><?php 
echo link_to($this->collection, 'show', strip_formatting($title));
?>
</h3>
    <?php 
if ($collectionImage = record_image($collection, 'square_thumbnail')) {
    ?>
        <?php 
    echo link_to($this->collection, 'show', $collectionImage, array('class' => 'image'));
    ?>
    <?php 
}
?>
    <?php 
if ($description) {
    ?>
        <p class="collection-description"><?php 
    echo $description;
    ?>
</p>
    <?php 
}
?>
</div>
开发者ID:lchen01,项目名称:STEdwards,代码行数:29,代码来源:single.php


示例17: filterItemSearchFilters

 public function filterItemSearchFilters($displayArray, $args)
 {
     $request_array = $args['request_array'];
     if (isset($request_array['multi-collection'])) {
         $collection = $this->_db->getTable('Collection')->find($request_array['multi-collection']);
         $displayValue = strip_formatting(metadata($collection, array('Dublin Core', 'Title')));
         $displayArray['collection'] = $displayValue;
     }
     return $displayArray;
 }
开发者ID:kent-state-university-libraries,项目名称:MultiCollections,代码行数:10,代码来源:MultiCollectionsPlugin.php


示例18: metadata

<div class="item record">
    <?php 
$title = metadata($item, array('Dublin Core', 'Title'));
$description = metadata($item, array('Dublin Core', 'Description'), array('snippet' => 150));
?>
    <h3><?php 
echo link_to($item, 'show', strip_formatting($title));
?>
</h3>
    <?php 
if (metadata($item, 'has files')) {
    echo link_to_item(item_image('square_thumbnail', array(), 0, $item), array('class' => 'image'), 'show', $item);
}
?>
    <?php 
if ($description) {
    ?>
        <p class="item-description"><?php 
    echo $description;
    ?>
</p>
    <?php 
}
?>
</div>
开发者ID:KelvinSmithLibrary,项目名称:playhouse,代码行数:25,代码来源:single.php


示例19: getCitation

 /**
  * Return a valid citation for this item.
  *
  * Generally follows Chicago Manual of Style note format for webpages. 
  * Implementers can use the item_citation filter to return a customized 
  * citation.
  *
  * @return string
  */
 function getCitation()
 {
     $citation = '';
     $creators = metadata($this, array('Dublin Core', 'Creator'), array('all' => true));
     // Strip formatting and remove empty creator elements.
     $creators = array_filter(array_map('strip_formatting', $creators));
     if ($creators) {
         switch (count($creators)) {
             case 1:
                 $creator = $creators[0];
                 break;
             case 2:
                 /// Chicago-style item citation: two authors
                 $creator = __('%1$s and %2$s', $creators[0], $creators[1]);
                 break;
             case 3:
                 /// Chicago-style item citation: three authors
                 $creator = __('%1$s, %2$s, and %3$s', $creators[0], $creators[1], $creators[2]);
                 break;
             default:
                 /// Chicago-style item citation: more than three authors
                 $creator = __('%s et al.', $creators[0]);
         }
         $citation .= "{$creator}, ";
     }
     $title = strip_formatting(metadata($this, array('Dublin Core', 'Title')));
     if ($title) {
         $citation .= "&#8220;{$title},&#8221; ";
     }
     $siteTitle = strip_formatting(option('site_title'));
     if ($siteTitle) {
         $citation .= "<em>{$siteTitle}</em>, ";
     }
     $accessed = format_date(time(), Zend_Date::DATE_LONG);
     $url = '<span class="citation-url">' . html_escape(record_url($this, null, true)) . '</span>';
     /// Chicago-style item citation: access date and URL
     $citation .= __('accessed %1$s, %2$s.', $accessed, $url);
     return apply_filters('item_citation', $citation, array('item' => $this));
 }
开发者ID:lchen01,项目名称:STEdwards,代码行数:48,代码来源:Item.php


示例20: filterItemCitation

 public function filterItemCitation($cite, $args)
 {
     $item = $args['item'];
     if (!$item) {
         return $cite;
     }
     $contribItem = $this->_db->getTable('ContributionContributedItem')->findByItem($item);
     if (!$contribItem) {
         return $cite;
     }
     $title = metadata('item', array('Dublin Core', 'Title'));
     $siteTitle = strip_formatting(option('site_title'));
     $itemId = $item->id;
     $accessDate = date('F j, Y');
     $uri = html_escape(record_url($item, 'show', true));
     if ($contribItem->anonymous) {
         $cite = __("Anonymous, ");
     } else {
         $cite = $contribItem->Contributor->name . ", ";
     }
     $cite .= "&#8220;{$title},&#8221; ";
     if ($siteTitle) {
         $cite .= "<em>{$siteTitle}</em>, ";
     }
     $cite .= "accessed {$accessDate}, ";
     $cite .= "{$uri}.";
     return $cite;
 }
开发者ID:sgbalogh,项目名称:peddler_clone5,代码行数:28,代码来源:ContributionPlugin.php



注:本文中的strip_formatting函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP strip_html函数代码示例发布时间:2022-05-23
下一篇:
PHP strip_escape_custom函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap