当前位置: 首页>>代码示例>>PHP>>正文


PHP FunctionsPrint::highlightSearchHits方法代码示例

本文整理汇总了PHP中Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits方法的典型用法代码示例。如果您正苦于以下问题:PHP FunctionsPrint::highlightSearchHits方法的具体用法?PHP FunctionsPrint::highlightSearchHits怎么用?PHP FunctionsPrint::highlightSearchHits使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Fisharebest\Webtrees\Functions\FunctionsPrint的用法示例。


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

示例1: renderContent


//.........这里部分代码省略.........
                echo I18N::translate('%1$d/%2$d', $sosa, ($sosa + 1) % 10);
                ?>
</td>
        			<td class="transparent"><?php 
                echo $sosa;
                ?>
</td>
        			<!--  HUSBAND -->
        			<td colspan="2">
        			<?php 
                foreach ($husb->getAllNames() as $num => $name) {
                    if ($name['type'] == 'NAME') {
                        $title = '';
                    } else {
                        $title = 'title="' . strip_tags(GedcomTag::getLabel($name['type'], $husb)) . '"';
                    }
                    if ($num == $husb->getPrimaryName()) {
                        $class = ' class="name2"';
                        $sex_image = $husb->getSexImage();
                        list($surn, $givn) = explode(',', $name['sort']);
                    } else {
                        $class = '';
                        $sex_image = '';
                    }
                    ?>
        				<a <?php 
                    echo $title . ' ' . $class;
                    ?>
 href="<?php 
                    echo $husb->getHtmlUrl();
                    ?>
">
        					<?php 
                    echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($name['full']);
                    ?>
        				</a>
        				<?php 
                    echo $sex_image . FunctionsPrint::formatSosaNumbers($dhusb->getSosaNumbers(), 1, 'smaller');
                    ?>
        				<br/>
            		<?php 
                }
                echo $husb->getPrimaryParentsNames('parents details1', 'none');
                ?>
            		</td>
            		<!-- Dummy column to match colspan in header -->
            		<td style="display:none;"></td>
            		<td>
            			<?php 
                echo Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)) . 'AAAA' . Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn));
                ?>
            		</td>
            		<td>
            			<?php 
                echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)) . 'AAAA' . Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn));
                ?>
            		</td>
            		<?php 
                $hdate = $husb->getBirthDate();
                ?>
            		<td><?php 
                Date::getAge($hdate, $mdate, 2);
                ?>
</td>
            		<td><?php 
                Date::getAge($hdate, $mdate, 1);
开发者ID:jon48,项目名称:webtrees-lib,代码行数:67,代码来源:SosaListFamView.php

示例2: renderContent


//.........这里部分代码省略.........
        			<td class="transparent"><?php 
                echo $sosa;
                ?>
</td>
        			<td class="transparent"><?php 
                echo $person->getXref();
                ?>
</td>
        			<td colspan="2">
        			<?php 
                foreach ($person->getAllNames() as $num => $name) {
                    if ($name['type'] == 'NAME') {
                        $title = '';
                    } else {
                        $title = 'title="' . strip_tags(GedcomTag::getLabel($name['type'], $person)) . '"';
                    }
                    if ($num == $person->getPrimaryName()) {
                        $class = ' class="name2"';
                        $sex_image = $person->getSexImage();
                        list($surn, $givn) = explode(',', $name['sort']);
                    } else {
                        $class = '';
                        $sex_image = '';
                    }
                    ?>
        				<a <?php 
                    echo $title . ' ' . $class;
                    ?>
 href="<?php 
                    echo $person->getHtmlUrl();
                    ?>
">
        					<?php 
                    echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($name['full']);
                    ?>
        				</a>
        				<?php 
                    echo $sex_image . FunctionsPrint::formatSosaNumbers($dperson->getSosaNumbers(), 1, 'smaller');
                    ?>
        				<br/>
            		<?php 
                }
                echo $person->getPrimaryParentsNames('parents details1', 'none');
                ?>
            		</td>
            		<td style="display:none;"></td>
            		<td>
            			<?php 
                echo Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)) . 'AAAA' . Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn));
                ?>
            		</td>
            		<td>
            			<?php 
                echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)) . 'AAAA' . Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn));
                ?>
            		</td>
            		<td>
            		<?php 
                if ($birth_dates = $person->getAllBirthDates()) {
                    foreach ($birth_dates as $num => $birth_date) {
                        if ($num) {
                            ?>
<br/><?php 
                        }
                        ?>
    						<?php 
开发者ID:jon48,项目名称:webtrees-lib,代码行数:67,代码来源:SosaListIndiView.php

示例3: renderContent


//.........这里部分代码省略.........
                			<td class="transparent"><?php 
                    echo $missing_tab['sosa'];
                    ?>
</td>
                			<td class="transparent"><?php 
                    echo $person->getXref();
                    ?>
</td>
                			<td colspan="2">
                			<?php 
                    foreach ($person->getAllNames() as $num => $name) {
                        if ($name['type'] == 'NAME') {
                            $title = '';
                        } else {
                            $title = 'title="' . strip_tags(GedcomTag::getLabel($name['type'], $person)) . '"';
                        }
                        if ($num == $person->getPrimaryName()) {
                            $class = ' class="name2"';
                            $sex_image = $person->getSexImage();
                            list($surn, $givn) = explode(',', $name['sort']);
                        } else {
                            $class = '';
                            $sex_image = '';
                        }
                        ?>
                				<a <?php 
                        echo $title . ' ' . $class;
                        ?>
 href="<?php 
                        echo $person->getHtmlUrl();
                        ?>
">
                					<?php 
                        echo \Fisharebest\Webtrees\Functions\FunctionsPrint::highlightSearchHits($name['full']);
                        ?>
                				</a>
                				<?php 
                        echo $sex_image . FunctionsPrint::formatSosaNumbers($dperson->getSosaNumbers(), 1, 'smaller');
                        ?>
                				<br/>
                    		<?php 
                    }
                    echo $person->getPrimaryParentsNames('parents details1', 'none');
                    ?>
                    		</td>
                    		<td style="display:none;"></td>
                    		<td>
                    			<?php 
                    echo Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn)) . 'AAAA' . Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn));
                    ?>
                    		</td>
                    		<td>
                    			<?php 
                    echo Filter::escapeHtml(str_replace('@N.N.', 'AAAA', $surn)) . 'AAAA' . Filter::escapeHtml(str_replace('@P.N.', 'AAAA', $givn));
                    ?>
                    		</td>                    		
                			<?php 
                    if (ModuleManager::getInstance()->isOperational(Constants::MODULE_MAJ_ISSOURCED_NAME)) {
                        $isISourced = $dperson->isSourced();
                        ?>
        				   	<td><?php 
                        echo FunctionsPrint::formatIsSourcedIcon('R', $isISourced, 'INDI', 1, 'medium');
                        ?>
</td>
        					<td><?php 
                        echo $isISourced;
开发者ID:jon48,项目名称:webtrees-lib,代码行数:67,代码来源:SosaListMissingView.php

示例4: mediaTable

    /**
     * Print a table of media objects
     *
     * @param Media[] $media_objects
     *
     * @return string
     */
    public static function mediaTable($media_objects)
    {
        global $WT_TREE, $controller;
        $html = '';
        $table_id = 'table-obje-' . Uuid::uuid4();
        // lists requires a unique ID in case there are multiple lists per page
        $controller->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL)->addInlineJavascript('
				jQuery.fn.dataTableExt.oSort["unicode-asc" ]=function(a,b) {return a.replace(/<[^<]*>/, "").localeCompare(b.replace(/<[^<]*>/, ""))};
				jQuery.fn.dataTableExt.oSort["unicode-desc"]=function(a,b) {return b.replace(/<[^<]*>/, "").localeCompare(a.replace(/<[^<]*>/, ""))};
				jQuery("#' . $table_id . '").dataTable({
					dom: \'<"H"pf<"dt-clear">irl>t<"F"pl>\',
					' . I18N::datatablesI18N() . ',
					jQueryUI: true,
					autoWidth:false,
					processing: true,
					columns: [
						/* 0 media     */ { sortable: false },
						/* 1 title     */ { type: "unicode" },
						/* 2 #indi     */ { dataSort: 3, class: "center" },
						/* 3 #INDI     */ { type: "num", visible: false },
						/* 4 #fam      */ { dataSort: 5, class: "center" },
						/* 5 #FAM      */ { type: "num", visible: false },
						/* 6 #sour     */ { dataSort: 7, class: "center" },
						/* 7 #SOUR     */ { type: "num", visible: false },
						/* 8 CHAN      */ { dataSort: 9, visible: ' . ($WT_TREE->getPreference('SHOW_LAST_CHANGE') ? 'true' : 'false') . ' },
						/* 9 CHAN_sort */ { visible: false },
					],
					displayLength: 20,
					pagingType: "full_numbers"
				});
				jQuery(".media-list").css("visibility", "visible");
				jQuery(".loading-image").css("display", "none");
			');
        //--table wrapper
        $html .= '<div class="loading-image">&nbsp;</div>';
        $html .= '<div class="media-list">';
        //-- table header
        $html .= '<table id="' . $table_id . '"><thead><tr>';
        $html .= '<th>' . I18N::translate('Media') . '</th>';
        $html .= '<th>' . GedcomTag::getLabel('TITL') . '</th>';
        $html .= '<th>' . I18N::translate('Individuals') . '</th>';
        $html .= '<th>#INDI</th>';
        $html .= '<th>' . I18N::translate('Families') . '</th>';
        $html .= '<th>#FAM</th>';
        $html .= '<th>' . I18N::translate('Sources') . '</th>';
        $html .= '<th>#SOUR</th>';
        $html .= '<th' . ($WT_TREE->getPreference('SHOW_LAST_CHANGE') ? '' : '') . '>' . GedcomTag::getLabel('CHAN') . '</th>';
        $html .= '<th' . ($WT_TREE->getPreference('SHOW_LAST_CHANGE') ? '' : '') . '>CHAN</th>';
        $html .= '</tr></thead>';
        //-- table body
        $html .= '<tbody>';
        foreach ($media_objects as $media_object) {
            if ($media_object->canShow()) {
                $name = $media_object->getFullName();
                if ($media_object->isPendingAddtion()) {
                    $class = ' class="new"';
                } elseif ($media_object->isPendingDeletion()) {
                    $class = ' class="old"';
                } else {
                    $class = '';
                }
                $html .= '<tr' . $class . '>';
                //-- Object thumbnail
                $html .= '<td>' . $media_object->displayImage() . '</td>';
                //-- Object name(s)
                $html .= '<td>';
                $html .= '<a href="' . $media_object->getHtmlUrl() . '" class="list_item name2">';
                $html .= FunctionsPrint::highlightSearchHits($name) . '</a>';
                if (Auth::isEditor($media_object->getTree())) {
                    $html .= '<br><a href="' . $media_object->getHtmlUrl() . '">' . basename($media_object->getFilename()) . '</a>';
                }
                $html .= '</td>';
                //-- Linked INDIs
                $num = count($media_object->linkedIndividuals('OBJE'));
                $html .= '<td>' . I18N::number($num) . '</td><td>' . $num . '</td>';
                //-- Linked FAMs
                $num = count($media_object->linkedfamilies('OBJE'));
                $html .= '<td>' . I18N::number($num) . '</td><td>' . $num . '</td>';
                //-- Linked SOURces
                $num = count($media_object->linkedSources('OBJE'));
                $html .= '<td>' . I18N::number($num) . '</td><td>' . $num . '</td>';
                //-- Last change
                if ($WT_TREE->getPreference('SHOW_LAST_CHANGE')) {
                    $html .= '<td>' . $media_object->LastChangeTimestamp() . '</td>';
                } else {
                    $html .= '<td></td>';
                }
                //-- Last change hidden sort column
                if ($WT_TREE->getPreference('SHOW_LAST_CHANGE')) {
                    $html .= '<td>' . $media_object->LastChangeTimestamp(true) . '</td>';
                } else {
                    $html .= '<td></td>';
                }
//.........这里部分代码省略.........
开发者ID:tunandras,项目名称:webtrees,代码行数:101,代码来源:FunctionsPrintLists.php

示例5: mediaTable

    /**
     * Print a table of media objects
     *
     * @param Media[] $media_objects
     *
     * @return string
     */
    public static function mediaTable($media_objects)
    {
        global $WT_TREE, $controller;
        $html = '';
        $table_id = 'table-obje-' . Uuid::uuid4();
        // lists requires a unique ID in case there are multiple lists per page
        $controller->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL)->addInlineJavascript('
				jQuery.fn.dataTableExt.oSort["text-asc"] = textCompareAsc;
				jQuery.fn.dataTableExt.oSort["text-desc"] = textCompareDesc;
				jQuery("#' . $table_id . '").dataTable({
					dom: \'<"H"pf<"dt-clear">irl>t<"F"pl>\',
					' . I18N::datatablesI18N() . ',
					jQueryUI: true,
					autoWidth:false,
					processing: true,
					columns: [
						/* Thumbnail   */ { sortable: false },
						/* Title       */ { type: "text" },
						/* Individuals */ { type: "num" },
						/* Families    */ { type: "num" },
						/* Sources     */ { type: "num" },
						/* Last change */ { visible: ' . ($WT_TREE->getPreference('SHOW_LAST_CHANGE') ? 'true' : 'false') . ' },
					],
					displayLength: 20,
					pagingType: "full_numbers"
				});
				jQuery(".media-list").css("visibility", "visible");
				jQuery(".loading-image").css("display", "none");
			');
        $html .= '<div class="loading-image"></div>';
        $html .= '<div class="media-list">';
        $html .= '<table id="' . $table_id . '"><thead><tr>';
        $html .= '<th>' . I18N::translate('Media') . '</th>';
        $html .= '<th>' . GedcomTag::getLabel('TITL') . '</th>';
        $html .= '<th>' . I18N::translate('Individuals') . '</th>';
        $html .= '<th>' . I18N::translate('Families') . '</th>';
        $html .= '<th>' . I18N::translate('Sources') . '</th>';
        $html .= '<th>' . GedcomTag::getLabel('CHAN') . '</th>';
        $html .= '</tr></thead>';
        $html .= '<tbody>';
        foreach ($media_objects as $media_object) {
            if ($media_object->canShow()) {
                $name = $media_object->getFullName();
                if ($media_object->isPendingAddtion()) {
                    $class = ' class="new"';
                } elseif ($media_object->isPendingDeletion()) {
                    $class = ' class="old"';
                } else {
                    $class = '';
                }
                $html .= '<tr' . $class . '>';
                // Media object thumbnail
                $html .= '<td>' . $media_object->displayImage() . '</td>';
                // Media object name(s)
                $html .= '<td data-sort="' . Filter::escapeHtml($media_object->getSortName()) . '">';
                $html .= '<a href="' . $media_object->getHtmlUrl() . '" class="list_item name2">';
                $html .= FunctionsPrint::highlightSearchHits($name) . '</a>';
                if (Auth::isEditor($media_object->getTree())) {
                    $html .= '<br><a href="' . $media_object->getHtmlUrl() . '">' . basename($media_object->getFilename()) . '</a>';
                }
                $html .= '</td>';
                // Count of linked individuals
                $num = count($media_object->linkedIndividuals('OBJE'));
                $html .= '<td class="center" data-sort="' . $num . '">' . I18N::number($num) . '</td>';
                // Count of linked families
                $num = count($media_object->linkedFamilies('OBJE'));
                $html .= '<td class="center" data-sort="' . $num . '">' . I18N::number($num) . '</td>';
                // Count of linked sources
                $num = count($media_object->linkedSources('OBJE'));
                $html .= '<td class="center" data-sort="' . $num . '">' . I18N::number($num) . '</td>';
                // Last change
                $html .= '<td data-sort="' . $media_object->lastChangeTimestamp(true) . '">' . $media_object->lastChangeTimestamp() . '</td>';
                $html .= '</tr>';
            }
        }
        $html .= '</tbody></table></div>';
        return $html;
    }
开发者ID:fisharebest,项目名称:webtrees,代码行数:85,代码来源:FunctionsPrintLists.php


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