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


PHP PhabricatorApplication::formatStatusCount方法代码示例

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


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

示例1: getTagContent

 protected function getTagContent()
 {
     $application = $this->application;
     require_celerity_resource('phabricator-application-launch-view-css');
     $content = array();
     $icon = null;
     if ($application) {
         $content[] = phutil_tag('span', array('class' => 'phabricator-application-launch-name'), $application->getName());
         $content[] = phutil_tag('span', array('class' => 'phabricator-application-launch-description'), $application->getShortDescription());
         $counts = array();
         $text = array();
         if ($this->status) {
             foreach ($this->status as $status) {
                 $type = $status->getType();
                 $counts[$type] = idx($counts, $type, 0) + $status->getCount();
                 if ($status->getCount()) {
                     $text[] = $status->getText();
                 }
             }
         }
         $attention = PhabricatorApplicationStatusView::TYPE_NEEDS_ATTENTION;
         $warning = PhabricatorApplicationStatusView::TYPE_WARNING;
         if (!empty($counts[$attention]) || !empty($counts[$warning])) {
             $count = idx($counts, $attention, 0);
             $count1 = $count2 = '';
             if ($count > 0) {
                 $count1 = phutil_tag('span', array('class' => 'phabricator-application-attention-count'), PhabricatorApplication::formatStatusCount($count));
             }
             if (!empty($counts[$warning])) {
                 $count2 = phutil_tag('span', array('class' => 'phabricator-application-warning-count'), PhabricatorApplication::formatStatusCount($counts[$warning]));
             }
             if (nonempty($count1) && nonempty($count2)) {
                 $numbers = array($count1, ' / ', $count2);
             } else {
                 $numbers = array($count1, $count2);
             }
             Javelin::initBehavior('phabricator-tooltips');
             $content[] = javelin_tag('span', array('sigil' => 'has-tooltip', 'meta' => array('tip' => implode("\n", $text), 'size' => 300, 'align' => 'E'), 'class' => 'phabricator-application-launch-attention'), $numbers);
         }
         $classes = array();
         $classes[] = 'phabricator-application-launch-icon';
         $styles = array();
         if ($application->getIconURI()) {
             $styles[] = 'background-image: url(' . $application->getIconURI() . ')';
         } else {
             $classes[] = $application->getFontIcon();
             $classes[] = 'phui-icon-view';
             $classes[] = 'phui-font-fa';
         }
         $icon = phutil_tag('span', array('class' => implode(' ', $classes), 'style' => nonempty(implode('; ', $styles), null)), '');
     }
     return array($icon, $content);
 }
开发者ID:fengshao0907,项目名称:phabricator,代码行数:53,代码来源:PhabricatorApplicationLaunchView.php


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