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


PHP GFCommon::truncate_middle方法代码示例

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


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

示例1: get_mapped_field_list

 private static function get_mapped_field_list($variable_name, $selected_field, $fields)
 {
     $field_name = "paypal_customer_field_" . $variable_name;
     $str = "<select name='{$field_name}' id='{$field_name}'><option value=''></option>";
     foreach ($fields as $field) {
         $field_id = $field[0];
         $field_label = esc_html(GFCommon::truncate_middle($field[1], 40));
         $selected = $field_id == $selected_field ? "selected='selected'" : "";
         $str .= "<option value='" . $field_id . "' " . $selected . ">" . $field_label . "</option>";
     }
     $str .= "</select>";
     return $str;
 }
开发者ID:bryanmonzon,项目名称:jenjonesdirect,代码行数:13,代码来源:paypal.php

示例2: get_mapped_field_list

 public static function get_mapped_field_list($variable_name, $selected_field, $fields)
 {
     $field_name = "campaignmonitor_map_field_" . $variable_name;
     $str = "<select name='{$field_name}' id='{$field_name}'><option value=''>" . __("", "gravityformscampaignmonitor") . "</option>";
     foreach ($fields as $field) {
         $field_id = $field[0];
         $field_label = esc_html(GFCommon::truncate_middle($field[1], 40));
         $selected = $field_id == $selected_field ? "selected='selected'" : "";
         $str .= "<option value='" . $field_id . "' " . $selected . ">" . $field_label . "</option>";
     }
     $str .= "</select>";
     return $str;
 }
开发者ID:hypenotic,项目名称:slowfood,代码行数:13,代码来源:campaignmonitor.php

示例3: get_field_drop_down_items

 private static function get_field_drop_down_items($fields, $selected_field, $empty_option = true)
 {
     $str = '';
     if ($empty_option == true) {
         $str = '<option value=""></option>';
     }
     if (is_array($fields)) {
         foreach ($fields as $field) {
             $field_id = $field[0];
             $field_label = $field[1];
             $selected = $field_id == $selected_field ? "selected='selected'" : "";
             $str .= "<option value='" . $field_id . "' " . $selected . ">" . GFCommon::truncate_middle($field_label, 25) . "</option>";
         }
     }
     return $str;
 }
开发者ID:Inteleck,项目名称:hwc,代码行数:16,代码来源:userregistration.php

示例4: insert_field_variable

    public static function insert_field_variable($field, $max_label_size = 40)
    {
        if (is_array($field["inputs"])) {
            foreach ($field["inputs"] as $input) {
                ?>
                <option value='<?php 
                echo "{" . esc_html(GFCommon::get_label($field, $input["id"])) . ":" . $input["id"] . "}";
                ?>
'><?php 
                echo esc_html(GFCommon::truncate_middle(GFCommon::get_label($field, $input["id"]), $max_label_size));
                ?>
</option>
                <?php 
            }
        } else {
            ?>
            <option value='<?php 
            echo "{" . esc_html(GFCommon::get_label($field)) . ":" . $field["id"] . "}";
            ?>
'><?php 
            echo esc_html(GFCommon::truncate_middle(GFCommon::get_label($field), $max_label_size));
            ?>
</option>
            <?php 
        }
    }
开发者ID:novuscory,项目名称:ACH,代码行数:26,代码来源:common.php

示例5: get_field_values

 private static function get_field_values($form, $field_id, $selected_value, $max_field_length = 16)
 {
     if (empty($field_id)) {
         $field_id = self::get_first_routing_field($form);
     }
     if (empty($field_id)) {
         return "";
     }
     $field = RGFormsModel::get_field($form, $field_id);
     $is_any_selected = false;
     foreach ($field["choices"] as $choice) {
         $is_selected = $choice["value"] == $selected_value;
         $selected = $is_selected ? "selected='selected'" : "";
         if ($is_selected) {
             $is_any_selected = true;
         }
         $str .= "<option value='" . esc_attr($choice["value"]) . "' " . $selected . ">" . GFCommon::truncate_middle($choice["text"], $max_field_length) . "</option>";
     }
     //adding current selected field value to the list
     if (!$is_any_selected && !empty($selected_value)) {
         $str .= "<option value='" . esc_attr($selected_value) . "' selected='selected'>" . GFCommon::truncate_middle($selected_value, $max_field_length) . "</option>";
     }
     return $str;
 }
开发者ID:novuscory,项目名称:ACH,代码行数:24,代码来源:notification.php

示例6: insert_field_variable

    public static function insert_field_variable($field, $max_label_size = 40, $args = "")
    {
        $tag_args = RGFormsModel::get_input_type($field) == "list" ? ":{$args}" : "";
        //args currently only supported by list field
        if (is_array($field["inputs"])) {
            if (RGFormsModel::get_input_type($field) == "checkbox") {
                ?>
                <option value='<?php 
                echo "{" . esc_html(GFCommon::get_label($field, $field["id"])) . ":" . $field["id"] . "{$tag_args}}";
                ?>
'><?php 
                echo esc_html(GFCommon::truncate_middle(GFCommon::get_label($field, $field["id"]), $max_label_size));
                ?>
</option>
                <?php 
            }
            foreach ($field["inputs"] as $input) {
                ?>
                <option value='<?php 
                echo "{" . esc_html(GFCommon::get_label($field, $input["id"])) . ":" . $input["id"] . "{$tag_args}}";
                ?>
'><?php 
                echo esc_html(GFCommon::truncate_middle(GFCommon::get_label($field, $input["id"]), $max_label_size));
                ?>
</option>
                <?php 
            }
        } else {
            ?>
            <option value='<?php 
            echo "{" . esc_html(GFCommon::get_label($field)) . ":" . $field["id"] . "{$tag_args}}";
            ?>
'><?php 
            echo esc_html(GFCommon::truncate_middle(GFCommon::get_label($field), $max_label_size));
            ?>
</option>
            <?php 
        }
    }
开发者ID:Blueprint-Marketing,项目名称:interoccupy.net,代码行数:39,代码来源:common.php

示例7: setting_get_mapped_field_list

 private static function setting_get_mapped_field_list($selected_field, $fields, $selectname_arr, $c)
 {
     $str = "<select name='name_form_field[]' id='name_form_field_{$c}' data-c='{$c}' required><option value=''>Select Form Field</option>";
     foreach ($fields as $field) {
         $field_id = $field[0];
         $field_label = esc_html(GFCommon::truncate_middle($field[1], 50));
         $selected = $field_id == $selected_field ? "selected='selected'" : "";
         $str .= "<option value='" . $field_id . "' " . $selected . ">" . $field_label . "</option>";
     }
     $str .= "</select>";
     $str1 = "<select name='email_form_field[]' id='email_form_field_{$c}' data-c='{$c}' required><option value=''>Select Form Field</option>";
     foreach ($fields as $field) {
         $field_id = $field[0];
         $field_label = esc_html(GFCommon::truncate_middle($field[1], 50));
         $selected = $field_id == $selected_field ? "selected='selected'" : "";
         $str1 .= "<option value='" . $field_id . "' " . $selected . ">" . $field_label . "</option>";
     }
     $str1 .= "</select>";
     $select_array['name'] = $str;
     $select_array['email'] = $str1;
     return json_encode($select_array);
 }
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:22,代码来源:templatemerge.php

示例8: get_field_variable

 public static function get_field_variable($field, $max_label_size = 40)
 {
     $str = "";
     if (is_array($field["inputs"])) {
         foreach ($field["inputs"] as $input) {
             $str .= "<option value='{" . esc_attr(GFCommon::get_label($field, $input["id"])) . ":" . $input["id"] . "}'>" . esc_html(GFCommon::truncate_middle(GFCommon::get_label($field, $input["id"]), $max_label_size)) . "</option>";
         }
     } else {
         $str .= "<option value='{" . esc_html(GFCommon::get_label($field)) . ":" . $field["id"] . "}'>" . esc_html(GFCommon::truncate_middle(GFCommon::get_label($field), $max_label_size)) . "</option>";
     }
     return $str;
 }
开发者ID:hscale,项目名称:webento,代码行数:12,代码来源:twilio.php


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