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


PHP Format::truncate方法代码示例

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


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

示例1:

        ?>
">
                <td width=7px>
                  <input type="checkbox" name="canned[]" value="<?php 
        echo $row['premade_id'];
        ?>
" <?php 
        echo $sel ? 'checked' : '';
        ?>
 
                        onClick="highLight(this.value,this.checked);">
                <td><a href="kb.php?id=<?php 
        echo $row['premade_id'];
        ?>
"><?php 
        echo Format::htmlchars(Format::truncate($row['title'], 60));
        ?>
</a></td>
                <td><b><?php 
        echo $row['isenabled'] ? 'Active' : 'Disabled';
        ?>
</b></td>
                <td><?php 
        echo $row['dept_name'] ? Format::htmlchars($row['dept_name']) : 'All Departments';
        ?>
</td>
                <td><?php 
        echo Format::db_datetime($row['updated']);
        ?>
</td>
            </tr>
开发者ID:amira147,项目名称:omniphics,代码行数:31,代码来源:premade.inc.php

示例2:

">
                <td width=7px>
                  <input type="checkbox" name="ids[]" value="<?php 
        echo $row['category_id'];
        ?>
" class="ckb"
                            <?php 
        echo $sel ? 'checked="checked"' : '';
        ?>
>
                </td>
                <td><a href="categories.php?id=<?php 
        echo $row['category_id'];
        ?>
"><?php 
        echo Format::truncate($row['name'], 200);
        ?>
</a>&nbsp;</td>
                <td><?php 
        echo $row['ispublic'] ? '<b>Public</b>' : 'Internal';
        ?>
</td>
                <td style="text-align:right;padding-right:25px;"><?php 
        echo $faqs;
        ?>
</td>
                <td>&nbsp;<?php 
        echo Format::db_datetime($row['updated']);
        ?>
</td>
            </tr>
开发者ID:pkdevboxy,项目名称:osTicket-1.7,代码行数:31,代码来源:categories.inc.php

示例3: strpos

        echo $row['priority_desc'];
        ?>
</td>
                <td nowrap><?php 
        echo Format::truncate($row['name'], 22, strpos($row['name'], '@'));
        ?>
&nbsp;</td>
		<?php 
        if ($row['assigned_name'] == "") {
            ?>
                <td nowrap>- Unassigned -</td>
		<?php 
        } else {
            ?>
                <td nowrap><?php 
            echo Format::truncate($row['assigned_name'], 22, strpos($row['assigned_name'], '@'));
            ?>
&nbsp;</td>
		<?php 
        }
        ?>
            </tr>
            <?php 
        $class = $class == 'row2' ? 'row1' : 'row2';
    }
    //end of while.
} else {
    //not tickets found!!
    ?>
 
            <tr class="<?php 
开发者ID:amira147,项目名称:omniphics,代码行数:31,代码来源:tickets.inc.php

示例4: strpos

echo $row['attachments'] ? "<span class='Icon file'>&nbsp;</span>" : '';
?>
</td>
                <td nowrap><?php 
echo Format::truncate($row['dept_name'], 30);
?>
</td>
                <td class="nohover" align="center" style="background-color:<?php 
echo $row['priority_color'];
?>
;"><?php 
echo $row['priority_desc'];
?>
</td>
                <td nowrap><?php 
echo Format::truncate($row['name'], 22, strpos($row['name'], '@'));
?>
&nbsp;</td>
            </tr>
            <?
            $class = ($class =='row2') ?'row1':'row2';
            } //end of while.
        else: //not tickets found!! ?> 
            <tr class="<?php 
echo $class;
?>
"><td colspan=8><b>Query returned 0 results.</b></td></tr>
        <?
        endif; ?>
       </table>
    </td></tr>
开发者ID:jeremyweiss,项目名称:osTicket-Beinahe-Zwei,代码行数:31,代码来源:tickets.inc.php

示例5:

echo $row['ticketID'];
?>
"><?php 
echo $subject;
?>
</a>
                    &nbsp;<?php 
echo $row['attachments'] ? "<span class='Icon file'>&nbsp;</span>" : '';
?>
</td>
                <td nowrap>&nbsp;<?php 
echo Format::truncate($dept, 30);
?>
</td>
                <td>&nbsp;<?php 
echo Format::truncate($row['email'], 40);
?>
</td>
            </tr>
            <?
            $class = ($class =='row2') ?'row1':'row2';
            } //end of while.
        else: //not tickets found!! ?> 
            <tr class="<?php 
echo $class;
?>
"><td colspan=7><b>NO tickets found.</b></td></tr>
        <?
        endif; ?>
     </table>
    </td></tr>
开发者ID:supaket,项目名称:helpdesk,代码行数:31,代码来源:tickets.inc.php

示例6: mysqli

</td>
                <td>&nbsp;<?php 
        echo $row['status'];
        ?>
</td>
                <td>
                    <a href="tickets.php?id=<?php 
        echo $row['ticket_id'];
        ?>
"><?php 
        echo $subject;
        ?>
</a>
                </td>
                <td>&nbsp;<?php 
        echo Format::truncate($dept, 30);
        ?>
</td>
<?php 
        $mysqli = new mysqli("localhost", "osticket", "0571ck37", "osticket1911");
        /* check connection */
        if (mysqli_connect_errno()) {
            printf("Connect failed: %s\n", mysqli_connect_error());
            exit;
        }
        $query2 = " SELECT \n                CAST(localizador AS char(100) CHARACTER SET utf8),\n                CAST(status_loc AS char(100) CHARACTER SET utf8) \n            FROM `ost_ticket__cdata` \n            WHERE ticket_id = " . $row['ticket_id'];
        $result2 = $mysqli->query($query2);
        $row2 = $result2->fetch_array();
        ?>
                <td>&nbsp;<?php 
        echo $row2[0];
开发者ID:jmangarret,项目名称:ostickets,代码行数:31,代码来源:tickets_20150916.inc.php

示例7: truncate

function truncate($str, $len = 40)
{
    return Format::truncate($str, $len);
}
开发者ID:brysonian,项目名称:Saint,代码行数:4,代码来源:Format.php

示例8:

        ?>
">
              <td width=7px>
               <input type="checkbox" name="tids[]" value="<?php 
        echo $row['topic_id'];
        ?>
" <?php 
        echo $sel ? 'checked' : '';
        ?>
  onClick="highLight(this.value,this.checked);">
              </td>
              <td><a href="admin.php?t=topics&id=<?php 
        echo $row['topic_id'];
        ?>
"><?php 
        echo Format::htmlchars(Format::truncate($row['topic'], 30));
        ?>
</a></td>
              <td><?php 
        echo $row['isactive'] ? _('Active') : _('<b>Disabled</b>');
        ?>
</td>
              <td>&nbsp;&nbsp;<?php 
        echo $row['noautoresp'] ? _('No') : _('<b>Yes</b>');
        ?>
</td>
              <td><a href="admin.php?t=dept&id=<?php 
        echo $row['dept_id'];
        ?>
"><?php 
        echo $row['dept_name'];
开发者ID:jahanzaibbahadur,项目名称:Katak-support,代码行数:31,代码来源:helptopics.inc.php

示例9: is_array

     $total=0;
     $ids=($errors && is_array($_POST['ids']))?$_POST['ids']:null;
     if($res && db_num_rows($res)):
         while ($row = db_fetch_array($res)) {
             $sel=false;
             if($ids && in_array($row['canned_id'],$ids))
                 $sel=true;
             $files=$row['files']?'<span class="Icon file">&nbsp;</span>':'';
             ?>
         <tr id="<?php echo $row['canned_id']; ?>">
             <td width=7px>
               <input type="checkbox" name="ids[]" value="<?php echo $row['canned_id']; ?>" class="ckb"
                         <?php echo $sel?'checked="checked"':''; ?> />
             </td>
             <td>
                 <a href="canned.php?id=<?php echo $row['canned_id']; ?>"><?php echo Format::truncate($row['title'],200); echo "&nbsp;$files"; ?></a>&nbsp;
             </td>
             <td><?php echo $row['isenabled']?__('Active'):'<b>'.__('Disabled').'</b>'; ?></td>
             <td><?php echo $row['department']?$row['department']:'&mdash; '.__('All Departments').' &mdash;'; ?></td>
             <td>&nbsp;<?php echo Format::db_datetime($row['updated']); ?></td>
         </tr>
         <?php
         } //end of while.
     endif; ?>
 <tfoot>
  <tr>
     <td colspan="5">
         <?php if($res && $num){ ?>
         <?php echo __('Select');?>:&nbsp;
         <a id="selectAll" href="#ckb"><?php echo __('All');?></a>&nbsp;&nbsp;
         <a id="selectNone" href="#ckb"><?php echo __('None');?></a>&nbsp;&nbsp;
开发者ID:CarlosAvilesMx,项目名称:CarlosAviles.Mx,代码行数:31,代码来源:cannedresponses.inc.php

示例10: array

$types = array('M', 'R');
if ($thread = $ticket->getThreadEntries($types)) {
    $threadTypes = array('M' => 'message', 'R' => 'response', 'N' => 'note');
    foreach ($thread as $entry) {
        ?>
        <div class="thread-entry <?php 
        echo $threadTypes[$entry->type];
        ?>
">
            <table class="header"><tr><td>
                    <span><?php 
        echo Format::datetime($entry->created);
        ?>
</span>
                    <span style="padding:0 1em" class="faded title"><?php 
        echo Format::truncate($entry->title, 100);
        ?>
</span>
                </td>
                <td class="flush-right faded title" style="white-space:no-wrap">
                    <?php 
        echo Format::htmlchars($entry->getName());
        ?>
</span>
                </td>
            </tr></table>
            <div class="thread-body">
                <div><?php 
        echo $entry->getBody()->display('pdf');
        ?>
</div>
开发者ID:majklovec,项目名称:osticket-bootstrap-theme,代码行数:31,代码来源:ticket-print.tmpl.php

示例11: _print


//.........这里部分代码省略.........
             $closedby = (string) $staff->getName();
         }
         $this->WriteCell($l, 7, __('Closed By'), 1, 0, 'L', true);
         $this->SetFont('');
         $this->WriteCell($c, 7, $closedby, 1, 0, 'L', true);
     }
     $this->SetFont('Arial', 'B', 11);
     $this->WriteCell($l, 7, __('Help Topic'), 1, 0, 'L', true);
     $this->SetFont('');
     $this->WriteCell($c, 7, $ticket->getHelpTopic(), 1, 1, 'L', true);
     $this->SetFont('Arial', 'B', 11);
     $this->WriteCell($l, 7, __('SLA Plan'), 1, 0, 'L', true);
     $this->SetFont('');
     $sla = $ticket->getSLA();
     $this->WriteCell($c, 7, $sla ? $sla->getName() : ' -- ', 1, 0, 'L', true);
     $this->SetFont('Arial', 'B', 11);
     $this->WriteCell($l, 7, __('Last Response'), 1, 0, 'L', true);
     $this->SetFont('');
     $this->WriteCell($c, 7, Format::db_datetime($ticket->getLastRespDate()), 1, 1, 'L', true);
     $this->SetFont('Arial', 'B', 11);
     if ($ticket->isOpen()) {
         $this->WriteCell($l, 7, __('Due Date'), 1, 0, 'L', true);
         $this->SetFont('');
         $this->WriteCell($c, 7, Format::db_datetime($ticket->getEstDueDate()), 1, 0, 'L', true);
     } else {
         $this->WriteCell($l, 7, __('Close Date'), 1, 0, 'L', true);
         $this->SetFont('');
         $this->WriteCell($c, 7, Format::db_datetime($ticket->getCloseDate()), 1, 0, 'L', true);
     }
     $this->SetFont('Arial', 'B', 11);
     $this->WriteCell($l, 7, __('Last Message'), 1, 0, 'L', true);
     $this->SetFont('');
     $this->WriteCell($c, 7, Format::db_datetime($ticket->getLastMsgDate()), 1, 1, 'L', true);
     $this->SetFillColor(255, 255, 255);
     foreach (DynamicFormEntry::forTicket($ticket->getId()) as $form) {
         $idx = 0;
         foreach ($form->getAnswers() as $a) {
             if (in_array($a->getField()->get('name'), array('email', 'name', 'subject', 'phone', 'priority'))) {
                 continue;
             }
             $this->SetFont('Arial', 'B', 11);
             if ($idx++ === 0) {
                 $this->Ln(5);
                 $this->SetFillColor(244, 250, 255);
                 $this->WriteCell(($l + $c) * 2, 7, $a->getForm()->get('title'), 1, 0, 'L', true);
                 $this->SetFillColor(255, 255, 255);
             }
             if ($val = $a->toString()) {
                 $this->Ln(7);
                 $this->WriteCell($l * 2, 7, $a->getField()->get('label'), 1, 0, 'L', true);
                 $this->SetFont('');
                 $this->WriteCell($c * 2, 7, $val, 1, 0, 'L', true);
             }
         }
     }
     $this->SetFillColor(244, 250, 255);
     $this->Ln(10);
     $this->SetFont('Arial', 'B', 11);
     $this->cMargin = 0;
     $this->SetTextColor(10, 86, 142);
     $this->WriteCell($w, 7, trim($ticket->getSubject()), 0, 0, 'L');
     $this->Ln(7);
     $this->SetTextColor(0);
     $this->cMargin = 3;
     //Table header colors (RGB)
     $colors = array('M' => array(195, 217, 255), 'R' => array(255, 224, 179), 'N' => array(250, 250, 210));
     //Get ticket thread
     $types = array('M', 'R');
     if ($this->includenotes) {
         $types[] = 'N';
     }
     if ($entries = $ticket->getThreadEntries($types)) {
         foreach ($entries as $entry) {
             $color = $colors[$entry['thread_type']];
             $this->SetFillColor($color[0], $color[1], $color[2]);
             $this->SetFont('Arial', 'B', 11);
             $this->WriteCell($w / 2, 7, Format::db_datetime($entry['created']), 'LTB', 0, 'L', true);
             $this->SetFont('Arial', '', 10);
             $this->WriteCell($w, 7, Format::truncate($entry['title'], 50), 'TB', 0, 'L', true);
             $this->WriteCell($w / 2, 7, $entry['name'] ?: $entry['poster'], 'TBR', 1, 'L', true);
             $this->SetFont('');
             $text = $entry['body']->display('pdf');
             if ($entry['attachments'] && ($tentry = $ticket->getThreadEntry($entry['id'])) && ($attachments = $tentry->getAttachments())) {
                 $files = array();
                 foreach ($attachments as $attachment) {
                     if (!$attachment['inline']) {
                         $files[] = $attachment['name'];
                     }
                 }
                 if ($files) {
                     $text .= "<div>Files Attached: [" . implode(', ', $files) . "]</div>";
                 }
                 $text .= "<div>" . sprintf(__('Files Attached: [%s]'), implode(', ', $files)) . "</div>";
             }
             $this->WriteHtml('<div class="thread-body">' . $text . '</div>', 2, false, false);
             $this->Ln(5);
         }
     }
     $this->WriteHtml('', 2, false, true);
 }
开发者ID:KingsleyGU,项目名称:osticket,代码行数:101,代码来源:class.pdf.php

示例12: if

            <td><?php echo $status; ?></td>
            <td><a <?php if ($flag) { ?> class="Icon <?php echo $flag; ?>Ticket" title="<?php echo ucfirst($flag); ?> Ticket" <?php } ?>
                href="tickets.php?id=<?php echo $row['ticket_id']; ?>"><?php echo $subject; ?></a>
                 <?php
                    if ($threadcount>1)
                        echo "<small>($threadcount)</small>&nbsp;".'<i
                            class="icon-fixed-width icon-comments-alt"></i>&nbsp;';
                    if ($row['collaborators'])
                        echo '<i class="icon-fixed-width icon-group faded"></i>&nbsp;';
                    if ($row['attachments'])
                        echo '<i class="icon-fixed-width icon-paperclip"></i>&nbsp;';
                ?>
            </td>
            <?php
            if ($user) { ?>
            <td><?php echo Format::truncate($row['dept_name'], 40); ?></td>
            <td>&nbsp;<?php echo $assigned; ?></td>
            <?php
            } else { ?>
            <td>&nbsp;<?php echo sprintf('<a href="users.php?id=%d">%s <em> &lt;%s&gt;</em></a>',
                    $row['user_id'], $row['name'], $row['email']); ?></td>
            <?php
            } ?>
        </tr>
   <?php
    }
    ?>
    </tbody>
</table>
</form>
<?php
开发者ID:KingsleyGU,项目名称:osticket,代码行数:31,代码来源:tickets.tmpl.php

示例13:

         <tr class="<?=$class?> " id="<?=$row['ticket_id']?>">
             <?if($canDelete || $canClose) {?>
             <td align="center" class="nohover">
                 <input type="checkbox" name="tids[]" value="<?=$row['ticket_id']?>" onClick="highLight(this.value,this.checked);">
             </td>
             <?}?>
             <td align="center" title="<?=$row['email']?>" nowrap>
               <a class="Icon <?=strtolower($row['source'])?>Ticket" title="<?=$row['source']?> Ticket: <?=$row['email']?>" 
                 href="tickets.php?id=<?=$row['ticket_id']?>"><?=$tid?></a></td>
             <td align="center" nowrap><?=Format::db_date($row['created'])?></td>
             <td><a <?if($flag) { ?> class="Icon <?=$flag?>Ticket" title="<?=ucfirst($flag)?> Ticket" <?}?> 
                 href="tickets.php?id=<?=$row['ticket_id']?>"><?=$subject?></a>
                 &nbsp;<?=$row['attachments']?"<span class='Icon file'>&nbsp;</span>":''?></td>
             <td nowrap><?=Format::truncate($row['dept_name'],30)?></td>
             <td class="nohover" align="center" style="background-color:<?=$row['priority_color']?>;"><?=$row['priority_desc']?></td>
             <td nowrap><?=Format::truncate($row['name'],22,strpos($row['name'],'@'))?>&nbsp;</td>
         </tr>
         <?
         $class = ($class =='row2') ?'row1':'row2';
         } //end of while.
     else: //not tickets found!! ?> 
         <tr class="<?=$class?>"><td colspan=8><b>Query returned 0 results.</b></td></tr>
     <?
     endif; ?>
    </table>
 </td></tr>
 <?
 if($num>0){ //if we actually had any tickets returned.
 ?>
     <tr><td style="padding-left:20px">
         <?if($canDelete || $canClose) { ?>
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:tickets.inc.php

示例14: while

        if($res && db_num_rows($res)):
            while ($row = db_fetch_array($res)) {
                $sel=false;
                if($ids && in_array($row['category_id'],$ids))
                    $sel=true;

                $faqs=0;
                if($row['faqs'])
                    $faqs=sprintf('<a href="faq.php?cid=%d">%d</a>',$row['category_id'],$row['faqs']);
                ?>
            <tr id="<?php echo $row['category_id']; ?>">
                <td width=7px>
                  <input type="checkbox" name="ids[]" value="<?php echo $row['category_id']; ?>" class="ckb"
                            <?php echo $sel?'checked="checked"':''; ?>>
                </td>
                <td><a href="categories.php?id=<?php echo $row['category_id']; ?>"><?php echo Format::truncate($row['name'],200); ?></a>&nbsp;</td>
                <td><?php echo $row['ispublic']?'<b>'.__('Public').'</b>':__('Internal'); ?></td>
                <td style="text-align:right;padding-right:25px;"><?php echo $faqs; ?></td>
                <td>&nbsp;<?php echo Format::db_datetime($row['updated']); ?></td>
            </tr>
            <?php
            } //end of while.
        endif; ?>
    <tfoot>
     <tr>
        <td colspan="5">
            <?php if($res && $num){ ?>
            <?php echo __('Select');?>:&nbsp;
            <a id="selectAll" href="#ckb"><?php echo __('All');?></a>&nbsp;&nbsp;
            <a id="selectNone" href="#ckb"><?php echo __('None');?></a>&nbsp;&nbsp;
            <a id="selectToggle" href="#ckb"><?php echo __('Toggle');?></a>&nbsp;&nbsp;
开发者ID:KingsleyGU,项目名称:osticket,代码行数:31,代码来源:categories.inc.php

示例15: strpos

        echo $row['ticket_id'];
        ?>
"><?php 
        echo $subject;
        ?>
</a>
                &nbsp;<?php 
        echo $row['attachments'] ? "<span class='Icon file'>&nbsp;</span>" : '';
        ?>
</td>
            <td nowrap><?php 
        echo Format::truncate($row['name'], 22, strpos($row['name'], '@'));
        ?>
&nbsp;</td>
            <td nowrap><?php 
        echo Format::truncate($row['dept_name'], 30);
        ?>
</td>
            <td class="nohover" align="center" style="color:<?php 
        echo $row['priority_color'];
        ?>
;"><?php 
        echo $row['priority_desc'];
        ?>
</td>
        </tr>
        <?php 
        $class = $class == 'row2' ? 'row1' : 'row2';
    }
    //end of while.
} else {
开发者ID:jahanzaibbahadur,项目名称:Katak-support,代码行数:31,代码来源:tickets.inc.php


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