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


PHP shorten函数代码示例

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


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

示例1: ajax_qsearch

/**
 * Searches for matching pagenames
 *
 * @author Andreas Gohr <andi@splitbrain.org>
 */
function ajax_qsearch()
{
    global $conf;
    global $lang;
    $query = cleanID($_POST['q']);
    if (empty($query)) {
        $query = cleanID($_GET['q']);
    }
    if (empty($query)) {
        return;
    }
    require_once DOKU_INC . 'inc/html.php';
    require_once DOKU_INC . 'inc/fulltext.php';
    $data = array();
    $data = ft_pageLookup($query);
    if (!count($data)) {
        return;
    }
    print '<strong>' . $lang['quickhits'] . '</strong>';
    print '<ul>';
    foreach ($data as $id) {
        print '<li>';
        $ns = getNS($id);
        if ($ns) {
            $name = shorten(noNS($id), ' (' . $ns . ')', 30);
        } else {
            $name = $id;
        }
        print html_wikilink(':' . $id, $name);
        print '</li>';
    }
    print '</ul>';
}
开发者ID:jalemanyf,项目名称:wsnlocalizationscala,代码行数:38,代码来源:ajax.php

示例2: ajax_qsearch

/**
 * Searches for matching pagenames
 *
 * @author Andreas Gohr <andi@splitbrain.org>
 */
function ajax_qsearch()
{
    global $conf;
    global $lang;
    $query = $_POST['q'];
    if (empty($query)) {
        $query = $_GET['q'];
    }
    if (empty($query)) {
        return;
    }
    $data = ft_pageLookup($query, true, useHeading('navigation'));
    if (!count($data)) {
        return;
    }
    print '<strong>' . $lang['quickhits'] . '</strong>';
    print '<ul>';
    foreach ($data as $id => $title) {
        if (useHeading('navigation')) {
            $name = $title;
        } else {
            $ns = getNS($id);
            if ($ns) {
                $name = shorten(noNS($id), ' (' . $ns . ')', 30);
            } else {
                $name = $id;
            }
        }
        echo '<li>' . html_wikilink(':' . $id, $name) . '</li>';
    }
    print '</ul>';
}
开发者ID:stretchyboy,项目名称:dokuwiki,代码行数:37,代码来源:ajax.php

示例3: get_text_for_indexing_ppt

/**
* @param object $resource
* @uses $CFG
*/
function get_text_for_indexing_ppt(&$resource, $directfile = '')
{
    global $CFG;
    $indextext = null;
    // SECURITY : do not allow non admin execute anything on system !!
    if (!has_capability('moodle/site:doanything', get_context_instance(CONTEXT_SYSTEM))) {
        return;
    }
    if ($directfile == '') {
        $text = implode('', file("{$CFG->dataroot}/{$resource->course}/{$resource->reference}"));
    } else {
        $text = implode('', file("{$CFG->dataroot}/{$directfile}"));
    }
    $remains = $text;
    $fragments = array();
    while (preg_match('/\\x00\\x9F\\x0F\\x04.{9}(......)(.*)/s', $remains, $matches)) {
        $unpacked = unpack("ncode/Llength", $matches[1]);
        $sequencecode = $unpacked['code'];
        $length = $unpacked['length'];
        // print "length : ".$length." ; segment type : ".sprintf("%x", $sequencecode)."<br/>";
        $followup = $matches[2];
        // local system encoding sequence
        if ($sequencecode == 0xa80f) {
            $aFragment = substr($followup, 0, $length);
            $remains = substr($followup, $length);
            $fragments[] = $aFragment;
        } elseif ($sequencecode == 0xa00f) {
            $aFragment = substr($followup, 0, $length);
            // $aFragment = mb_convert_encoding($aFragment, 'UTF-16', 'UTF-8');
            $aFragment = preg_replace('/\\xA0\\x00\\x19\\x20/s', "'", $aFragment);
            // some quotes
            $aFragment = preg_replace('/\\x00/s', "", $aFragment);
            $remains = substr($followup, $length);
            $fragments[] = $aFragment;
        } else {
            $remains = $followup;
        }
    }
    $indextext = implode(' ', $fragments);
    $indextext = preg_replace('/\\x19\\x20/', "'", $indextext);
    // some quotes
    $indextext = preg_replace('/\\x09/', '', $indextext);
    // some extra chars
    $indextext = preg_replace('/\\x0D/', "\n", $indextext);
    // some quotes
    $indextext = preg_replace('/\\x0A/', "\n", $indextext);
    // some quotes
    $indextextprint = implode('<hr/>', $fragments);
    // debug code
    // $logppt = fopen("C:/php5/logs/pptlog", "w");
    // fwrite($logppt, $indextext);
    // fclose($logppt);
    if (!empty($CFG->block_search_limit_index_body)) {
        $indextext = shorten($text, $CFG->block_search_limit_index_body);
    }
    $indextext = mb_convert_encoding($indextext, 'UTF8', 'auto');
    return $indextext;
}
开发者ID:arshanam,项目名称:Moodle-ITScholars-LMS,代码行数:62,代码来源:physical_ppt.php

示例4: search

 /**
  * Search
  *
  * Performs the search and stores results
  *
  * @param string $query
  */
 function search($query = '', $page = 0)
 {
     $this->CI->load->helper('shorten');
     // content search
     $content_types = unserialize(setting('search_content_types'));
     if (!empty($content_types)) {
         $this->CI->load->model('publish/content_model');
         $this->CI->load->model('publish/content_type_model');
         $this->CI->load->model('custom_fields_model');
         foreach ($content_types as $type => $summary_field) {
             $content = $this->CI->content_model->get_contents(array('keyword' => $query, 'type' => $type, 'sort' => 'relevance', 'sort_dir' => 'DESC', 'limit' => '50'));
             if (!empty($content)) {
                 foreach ($content as $item) {
                     // prep summary field
                     if (!empty($summary_field)) {
                         $item['summary'] = shorten(strip_tags($item[$summary_field]), setting('search_trim'), TRUE);
                     }
                     $item['result_type'] = 'content';
                     $this->content_results[$item['id']] = $item;
                     $this->relevance_keys['content|' . $item['id']] = $item['relevance'];
                 }
             }
         }
     }
     // product search
     if (setting('search_products') == '1' and module_installed('store')) {
         $this->CI->load->model('store/products_model');
         $products = $this->CI->products_model->get_products(array('keyword' => $query, 'sort' => 'relevance', 'sort_dir' => 'DESC', 'limit' => '50'));
         if (!empty($products)) {
             foreach ($products as $product) {
                 // prep summary field
                 $product['summary'] = shorten(strip_tags($product['description']), setting('search_trim'), TRUE);
                 $product['result_type'] = 'product';
                 $this->product_results[$product['id']] = $product;
                 $this->relevance_keys['product|' . $product['id']] = $product['relevance'];
             }
         }
     }
     // sort results
     arsort($this->relevance_keys);
     // put together final results array
     foreach ($this->relevance_keys as $item => $relevance) {
         list($type, $id) = explode('|', $item);
         if ($type == 'content') {
             $this->results[] = $this->content_results[$id];
         } elseif ($type == 'product') {
             $this->results[] = $this->product_results[$id];
         }
     }
     // how many total results?
     $this->total_results = count($this->results);
     if ($this->total_results == 0) {
         return array();
     }
     // grab the segment of the array corresponding to our page
     return array_slice($this->results, $page * $this->results_per_page, $this->results_per_page);
 }
开发者ID:Rotron,项目名称:hero,代码行数:64,代码来源:search_results.php

示例5: do_print

function do_print($row_in)
{
    global $today, $today_ref, $line_ctr, $units_str, $severities;
    if (empty($today)) {
        $today_ref = date("z", $row_in['problemstart']);
        $today = substr(format_date($row_in['problemstart']), 0, 5);
    } else {
        if (!($today_ref == date("z", $row_in['problemstart']))) {
            // date change?
            $today_ref = date("z", $row_in['problemstart']);
            $today = substr(format_date($row_in['problemstart']), 0, 5);
        }
    }
    $def_city = get_variable('def_city');
    $def_st = get_variable('def_st');
    print "<TR CLASS= ''>\n";
    print "<TD>{$today}</TD>\n";
    //		Date -
    $problemstart = format_date($row_in['problemstart']);
    $problemstart_sh = short_ts($problemstart);
    print "<TD onMouseover=\"Tip('{$problemstart}');\" onmouseout='UnTip();'>{$problemstart_sh}</TD>\n";
    //		start
    $problemend = format_date($row_in['problemend']);
    $problemend_sh = short_ts($problemend);
    print "<TD onMouseover=\"Tip('{$problemend}');\" onmouseout='UnTip();'>{$problemend_sh}</TD>\n";
    //		end
    $elapsed = my_date_diff($row_in['problemstart'], $row_in['problemend']);
    print "<TD>{$elapsed}</TD>\n";
    //		Ending time
    print "<TD ALIGN='center'>{$severities[$row_in['severity']]}</TD>\n";
    $scope = $row_in['tick_scope'];
    $scope_sh = shorten($row_in['tick_scope'], 20);
    print "<TD onMouseover=\"Tip('{$scope}');\" onmouseout='UnTip();'>{$scope_sh}</TD>\n";
    //		Call type
    $comment = $row_in['comments'];
    $short_comment = shorten($row_in['comments'], 50);
    print "<TD onMouseover=\"Tip('{$comment}');\" onMouseout='UnTip();'>{$short_comment}</TD>\n";
    //		Comments/Disposition
    $facility = $row_in['facy_name'];
    $facility_sh = shorten($row_in['facy_name'], 16);
    print "<TD onMouseover=\"Tip('{$facility}');\" onmouseout='UnTip();'>{$facility_sh}</TD>\n";
    //		Facility
    $city = $row_in['tick_city'] == $def_city ? "" : ", {$row_in['tick_city']}";
    $st = $row_in['tick_state'] == $def_st ? "" : ", {$row_in['tick_state']}";
    $addr = "{$row_in['tick_street']}{$city}{$st}";
    $addr_sh = shorten($row_in['tick_street'] . $city . $st, 20);
    print "<TD onMouseover=\"Tip('{$addr}');\" onMouseout='UnTip();'>{$addr_sh}</TD>\n";
    //		Street addr
    print "<TD>{$units_str}</TD>\n";
    //		Units responding
    print "</TR>\n\n";
    $line_ctr++;
}
开发者ID:sharedgeo,项目名称:TicketsCAD-SharedGeo-Dev,代码行数:53,代码来源:daily_rpt.php

示例6: register

 /** {@inheritdoc} */
 public function register()
 {
     if (empty($this->provides)) {
         return;
     }
     foreach ($this->provides as $v) {
         if (false !== strpos($v, '\\')) {
             $this->container->add($v);
             if (false === stripos($v, '\\events\\')) {
                 $this->container->add(shorten($v), $v);
             }
         }
     }
 }
开发者ID:ntd1712,项目名称:common,代码行数:15,代码来源:AbstractLeagueServiceProvider.php

示例7: get_text_for_indexing_txt

/**
* Global Search Engine for Moodle
* add-on 1.8+ : Valery Fremaux [valery.fremaux@club-internet.fr] 
* 2007/08/02
*
* this is a format handler for getting text out of a proprietary binary format 
* so it can be indexed by Lucene search engine
*/
function get_text_for_indexing_txt(&$resource)
{
    global $CFG, $USER;
    // SECURITY : do not allow non admin execute anything on system !!
    if (!isadmin($USER->id)) {
        return;
    }
    // just try to get text empirically from ppt binary flow
    $text = implode('', file("{$CFG->dataroot}/{$resource->course}/{$resource->reference}"));
    if (!empty($CFG->block_search_limit_index_body)) {
        $text = shorten($text, $CFG->block_search_limit_index_body);
    }
    return $text;
}
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:22,代码来源:physical_txt.php

示例8: get_text_for_indexing_xml

/**
* Global Search Engine for Moodle
* add-on 1.8+ : Valery Fremaux [valery.fremaux@club-internet.fr] 
* 2007/08/02
*
* this is a format handler for getting text out of a proprietary binary format 
* so it can be indexed by Lucene search engine
*/
function get_text_for_indexing_xml(&$resource)
{
    global $CFG, $USER;
    // SECURITY : do not allow non admin execute anything on system !!
    if (!isadmin($USER->id)) {
        return;
    }
    // just get text
    $text = implode('', file("{$CFG->dataroot}/{$resource->course}/({$resource->reference})"));
    // filter out all xml tags
    $text = preg_replace("/<[^>]*>/", ' ', $text);
    if (!empty($CFG->block_search_limit_index_body)) {
        $text = shorten($text, $CFG->block_search_limit_index_body);
    }
    return $text;
}
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:24,代码来源:physical_xml.php

示例9: ajax_qsearch

/**
 * Searches for matching pagenames
 *
 * @author Andreas Gohr <andi@splitbrain.org>
 */
function ajax_qsearch()
{
    global $lang;
    global $INPUT;
    $maxnumbersuggestions = 50;
    $query = $INPUT->post->str('q');
    if (empty($query)) {
        $query = $INPUT->get->str('q');
    }
    if (empty($query)) {
        return;
    }
    $query = urldecode($query);
    $data = ft_pageLookup($query, true, useHeading('navigation'));
    if (!count($data)) {
        return;
    }
    print '<strong>' . $lang['quickhits'] . '</strong>';
    print '<ul>';
    $counter = 0;
    foreach ($data as $id => $title) {
        if (useHeading('navigation')) {
            $name = $title;
        } else {
            $ns = getNS($id);
            if ($ns) {
                /* Displays the Header of the Namespace-Page or of namespace:start as the Name of the NS */
                $ns_name = p_get_first_heading(getNS($id));
                if (!$ns_name) {
                    $ns_name = p_get_first_heading(getNS($id) . ':start');
                }
                $name = shorten(' [' . $ns_name . ']', 30);
            } else {
                $name = $id;
            }
        }
        echo '<li>' . html_wikilink(':' . $id, $name) . '</li>';
        $counter++;
        if ($counter > $maxnumbersuggestions) {
            echo '<li>...</li>';
            break;
        }
    }
    print '</ul>';
}
开发者ID:s-blu,项目名称:dokuwiki,代码行数:50,代码来源:ajax.php

示例10: get_text_for_indexing_txt

/**
* @param object $resource
* @uses $CFG
*/
function get_text_for_indexing_txt(&$resource, $directfile = '')
{
    global $CFG;
    // SECURITY : do not allow non admin execute anything on system !!
    if (!has_capability('moodle/site:doanything', get_context_instance(CONTEXT_SYSTEM))) {
        return;
    }
    // just try to get text empirically from ppt binary flow
    if ($directfile == '') {
        $text = implode('', file("{$CFG->dataroot}/{$resource->course}/{$resource->reference}"));
    } else {
        $text = implode('', file("{$CFG->dataroot}/{$directfile}"));
    }
    if (!empty($CFG->block_search_limit_index_body)) {
        $text = shorten($text, $CFG->block_search_limit_index_body);
    }
    return $text;
}
开发者ID:kai707,项目名称:ITSA-backup,代码行数:22,代码来源:physical_txt.php

示例11: index

 function index()
 {
     $this->navigation->PageTitle('Transactions');
     $this->load->model('cp/dataset', 'dataset');
     // prepare gateway select
     $this->load->model('gateway_model');
     $gateways = $this->gateway_model->GetGateways($this->user->Get('client_id'));
     // we're gonna short gateway names
     $this->load->helper('shorten');
     $gateway_options = array();
     $gateway_values = array();
     if (is_array($gateways) && count($gateways)) {
         foreach ($gateways as $gateway) {
             $gateway_options[$gateway['id']] = $gateway['gateway'];
             $gateway_values[$gateway['id']] = shorten($gateway['gateway'], 15);
         }
     }
     // now get deleted gateways and add them in so that, when viewing the
     // transactions table, we have names for each gateway in this array
     $gateways = $this->gateway_model->GetGateways($this->user->Get('client_id'), array('deleted' => '1'));
     if (!empty($gateways)) {
         foreach ($gateways as $gateway) {
             $gateway['gateway_short'] = shorten($gateway['gateway'], 15);
             $gateway_values[$gateway['id']] = $gateway['gateway_short'];
         }
     }
     $columns = array(array('name' => 'ID #', 'sort_column' => 'id', 'type' => 'id', 'width' => '10%', 'filter' => 'id'), array('name' => 'Status', 'sort_column' => 'status', 'type' => 'select', 'options' => array('1' => 'ok', '2' => 'refunded', '0' => 'failed', '3' => 'failed-repeat'), 'width' => '4%', 'filter' => 'status'), array('name' => 'Date', 'sort_column' => 'timestamp', 'type' => 'date', 'width' => '20%', 'filter' => 'timestamp', 'field_start_date' => 'start_date', 'field_end_date' => 'end_date'), array('name' => 'Amount', 'sort_column' => 'amount', 'type' => 'text', 'width' => '10%', 'filter' => 'amount'), array('name' => 'Customer Name', 'sort_column' => 'customers.last_name', 'type' => 'text', 'width' => '20%', 'filter' => 'customer_last_name'), array('name' => 'Card', 'sort_column' => 'card_last_four', 'type' => 'text', 'width' => '10%', 'filter' => 'card_last_four'), array('name' => 'Gateway', 'type' => 'select', 'width' => '10%', 'options' => $gateway_options, 'filter' => 'gateway_id'), array('name' => 'Recurring', 'width' => '10%', 'type' => 'text', 'filter' => 'recurring_id'));
     // set total rows by hand to reduce database load
     $result = $this->db->select('COUNT(order_id) AS total_rows', FALSE)->from('orders')->where('client_id', $this->user->Get('client_id'))->get();
     $this->dataset->total_rows((int) $result->row()->total_rows);
     if ($this->dataset->total_rows > 5000) {
         // we're going to have a memory error with this much data
         $this->dataset->use_total_rows();
     }
     $this->dataset->Initialize('charge_model', 'GetCharges', $columns);
     $this->load->model('charge_model');
     // get total charges
     $total_amount = $this->charge_model->GetTotalAmount($this->user->Get('client_id'), $this->dataset->params);
     // sidebar
     $this->navigation->SidebarButton('Recurring Charges', 'transactions/all_recurring');
     $this->navigation->SidebarButton('New Charge', 'transactions/create');
     $data = array('total_amount' => $total_amount, 'gateways' => $gateway_values);
     $this->load->view(branded_view('cp/transactions.php'), $data);
 }
开发者ID:carriercomm,项目名称:opengateway,代码行数:44,代码来源:transactions.php

示例12: get_text_for_indexing_xml

/**
* @param object $resource
* @uses $CFG
*/
function get_text_for_indexing_xml(&$resource, $directfile = '')
{
    global $CFG;
    // SECURITY : do not allow non admin execute anything on system !!
    if (!has_capability('moodle/site:doanything', get_context_instance(CONTEXT_SYSTEM))) {
        return;
    }
    // just get text
    if ($directfile == '') {
        $text = implode('', file("{$CFG->dataroot}/{$resource->course}/{$resource->reference}"));
    } else {
        $text = implode('', file("{$CFG->dataroot}/{$directfile}"));
    }
    // filter out all xml tags
    $text = preg_replace("/<[^>]*>/", ' ', $text);
    if (!empty($CFG->block_search_limit_index_body)) {
        $text = shorten($text, $CFG->block_search_limit_index_body);
    }
    return $text;
}
开发者ID:kai707,项目名称:ITSA-backup,代码行数:24,代码来源:physical_xml.php

示例13: get_text_for_indexing_htm

/**
* @param object $resource
* @uses $CFG
*/
function get_text_for_indexing_htm(&$resource, $directfile = '')
{
    global $CFG;
    // SECURITY : do not allow non admin execute anything on system !!
    if (!has_capability('moodle/site:doanything', get_context_instance(CONTEXT_SYSTEM))) {
        return;
    }
    // just get text
    if ($directfile == '') {
        $text = implode('', file("{$CFG->dataroot}/{$resource->course}/{$resource->reference}"));
    } else {
        $text = implode('', file("{$CFG->dataroot}/{$directfile}"));
    }
    // extract keywords and other interesting meta information and put it back as real content for indexing
    if (preg_match('/(.*)<meta ([^>]*)>(.*)/is', $text, $matches)) {
        $prefix = $matches[1];
        $meta_attributes = $matches[2];
        $suffix = $matches[3];
        if (preg_match('/name="(keywords|description)"/i', $meta_attributes)) {
            preg_match('/content="([^"]+)"/i', $meta_attributes, $matches);
            $text = $prefix . ' ' . $matches[1] . ' ' . $suffix;
        }
    }
    // brutally filters all html tags
    $text = preg_replace("/<[^>]*>/", '', $text);
    $text = preg_replace("/<!--[^>]*-->/", '', $text);
    $text = html_entity_decode($text, ENT_COMPAT, 'UTF-8');
    $text = mb_convert_encoding($text, 'UTF-8', 'auto');
    /*
    * debug code for tracing input
    echo "<hr/>";
    $FILE = fopen("filetrace.log", 'w');
    fwrite($FILE, $text);
    fclose($FILE);
    echo "<hr/>";
    */
    if (!empty($CFG->block_search_limit_index_body)) {
        $text = shorten($text, $CFG->block_search_limit_index_body);
    }
    return $text;
}
开发者ID:kai707,项目名称:ITSA-backup,代码行数:45,代码来源:physical_htm.php

示例14: __toString

 /** @return string */
 public function __toString()
 {
     return str_replace('Entity', '', shorten(get_class($this)));
 }
开发者ID:ntd1712,项目名称:common,代码行数:5,代码来源:AbstractBaseObject.php

示例15: popup_ticket


//.........这里部分代码省略.........

function createfacMarker(fac_point, fac_name, id, fac_icon) {
	var fac_marker = new GMarker(fac_point, fac_icon);
	// Show this markers index in the info window when it is clicked
	var fac_html = fac_name;
	fmarkers[id] = fac_marker;
	GEvent.addListener(fac_marker, "click", function() {fac_marker.openInfoWindowHtml(fac_html);});
	return fac_marker;
}

<?php 
    $query_fac = "SELECT *,UNIX_TIMESTAMP(updated) AS updated, `{$GLOBALS['mysql_prefix']}facilities`.id AS fac_id, `{$GLOBALS['mysql_prefix']}facilities`.description AS facility_description, `{$GLOBALS['mysql_prefix']}fac_types`.name AS fac_type_name, `{$GLOBALS['mysql_prefix']}facilities`.name AS facility_name FROM `{$GLOBALS['mysql_prefix']}facilities` LEFT JOIN `{$GLOBALS['mysql_prefix']}fac_types` ON `{$GLOBALS['mysql_prefix']}facilities`.type = `{$GLOBALS['mysql_prefix']}fac_types`.id LEFT JOIN `{$GLOBALS['mysql_prefix']}fac_status` ON `{$GLOBALS['mysql_prefix']}facilities`.status_id = `{$GLOBALS['mysql_prefix']}fac_status`.id ORDER BY `{$GLOBALS['mysql_prefix']}facilities`.type ASC";
    $result_fac = mysql_query($query_fac) or do_error($query_fac, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
    while ($row_fac = mysql_fetch_array($result_fac)) {
        $eols = array("\r\n", "\n", "\r");
        // all flavors of eol
        while ($row_fac = stripslashes_deep(mysql_fetch_array($result_fac))) {
            //
            $fac_name = $row_fac['facility_name'];
            //	10/8/09
            $fac_temp = explode("/", $fac_name);
            $fac_index = substr($fac_temp[count($fac_temp) - 1], -6, strlen($fac_temp[count($fac_temp) - 1]));
            // 3/19/11
            print "\t\tvar fac_sym = '{$fac_index}';\n";
            // for sidebar and icon 10/8/09
            $fac_id = $row_fac['id'];
            $fac_type = $row_fac['icon'];
            $f_disp_name = $row_fac['facility_name'];
            //	10/8/09
            $f_disp_temp = explode("/", $f_disp_name);
            $facility_display_name = $f_disp_temp[0];
            if (my_is_float($row_fac['lat']) && my_is_float($row_fac['lng'])) {
                $fac_tab_1 = "<TABLE CLASS='infowin'  width='{$iw_width}' >";
                $fac_tab_1 .= "<TR CLASS='even'><TD COLSPAN=2 ALIGN='center'><B>" . addslashes(shorten($facility_display_name, 48)) . "</B></TD></TR>";
                $fac_tab_1 .= "<TR CLASS='odd'><TD COLSPAN=2 ALIGN='center'><B>" . addslashes(shorten($row_fac['fac_type_name'], 48)) . "</B></TD></TR>";
                $fac_tab_1 .= "<TR CLASS='even'><TD ALIGN='right'>Description:&nbsp;</TD><TD ALIGN='left'>" . addslashes(str_replace($eols, " ", $row_fac['facility_description'])) . "</TD></TR>";
                $fac_tab_1 .= "<TR CLASS='odd'><TD ALIGN='right'>Status:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row_fac['status_val']) . " </TD></TR>";
                $fac_tab_1 .= "<TR CLASS='even'><TD ALIGN='right'>Contact:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row_fac['contact_name']) . "&nbsp;&nbsp;&nbsp;Email: " . addslashes($row_fac['contact_email']) . "</TD></TR>";
                $fac_tab_1 .= "<TR CLASS='odd'><TD ALIGN='right'>Phone:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row_fac['contact_phone']) . " </TD></TR>";
                $fac_tab_1 .= "<TR CLASS='even'><TD ALIGN='right'>As of:&nbsp;</TD><TD ALIGN='left'>" . format_date($row_fac['updated']) . "</TD></TR>";
                $fac_tab_1 .= "</TABLE>";
                $fac_tab_2 = "<TABLE CLASS='infowin'  width='{$iw_width}' >";
                $fac_tab_2 .= "<TR CLASS='odd'><TD ALIGN='right'>Security contact:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row_fac['security_contact']) . " </TD></TR>";
                $fac_tab_2 .= "<TR CLASS='even'><TD ALIGN='right'>Security email:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row_fac['security_email']) . " </TD></TR>";
                $fac_tab_2 .= "<TR CLASS='odd'><TD ALIGN='right'>Security phone:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row_fac['security_phone']) . " </TD></TR>";
                $fac_tab_2 .= "<TR CLASS='even'><TD ALIGN='right'>Access rules:&nbsp;</TD><TD ALIGN='left'>" . addslashes(str_replace($eols, " ", $row_fac['access_rules'])) . "</TD></TR>";
                $fac_tab_2 .= "<TR CLASS='odd'><TD ALIGN='right'>Security reqs:&nbsp;</TD><TD ALIGN='left'>" . addslashes(str_replace($eols, " ", $row_fac['security_reqs'])) . "</TD></TR>";
                $fac_tab_2 .= "<TR CLASS='even'><TD ALIGN='right'>Opening hours:&nbsp;</TD><TD ALIGN='left'>" . addslashes(str_replace($eols, " ", $row_fac['opening_hours'])) . "</TD></TR>";
                $fac_tab_2 .= "<TR CLASS='odd'><TD ALIGN='right'>Prim pager:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row_fac['pager_p']) . " </TD></TR>";
                $fac_tab_2 .= "<TR CLASS='even'><TD ALIGN='right'>Sec pager:&nbsp;</TD><TD ALIGN='left'>" . addslashes($row_fac['pager_s']) . " </TD></TR>";
                $fac_tab_2 .= "</TABLE>";
                ?>
//			var fac_sym = (g+1).toString();
			var myfacinfoTabs = [
				new GInfoWindowTab("<?php 
                print nl2brr(addslashes(shorten($row_fac['facility_name'], 10)));
                ?>
", "<?php 
                print $fac_tab_1;
                ?>
"),
				new GInfoWindowTab("More ...", "<?php 
                print str_replace($eols, " ", $fac_tab_2);
                ?>
")
				];
开发者ID:sharedgeo,项目名称:TicketsCAD-SharedGeo-Dev,代码行数:67,代码来源:functions_major.inc.php


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