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


PHP ChangesList::insertAction方法代码示例

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


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

示例1: recentChangesBlockGroup


//.........这里部分代码省略.........
             } else {
                 $r .= $this->skin->makeKnownLinkObj($block[0]->getTitle(), $nchanges[$n], $curIdEq . "&diff={$currentRevision}&oldid={$oldid}");
             }
         }
     }
     # History
     if ($allLogs) {
         // don't show history link for logs
     } else {
         if ($namehidden || !$block[0]->getTitle()->exists()) {
             $r .= $this->message['semicolon-separator'] . $this->message['hist'] . ')';
         } else {
             $r .= $this->message['semicolon-separator'] . $this->skin->makeKnownLinkObj($block[0]->getTitle(), $this->message['hist'], $curIdEq . '&action=history') . ')';
         }
     }
     $r .= ' . . ';
     # Character difference (does not apply if only log items)
     if ($wgRCShowChangedSize && !$allLogs) {
         $last = 0;
         $first = count($block) - 1;
         # Some events (like logs) have an "empty" size, so we need to skip those...
         while ($last < $first && $block[$last]->mAttribs['rc_new_len'] === NULL) {
             $last++;
         }
         while ($first > $last && $block[$first]->mAttribs['rc_old_len'] === NULL) {
             $first--;
         }
         # Get net change
         $chardiff = $rcObj->getCharacterDifference($block[$first]->mAttribs['rc_old_len'], $block[$last]->mAttribs['rc_new_len']);
         if ($chardiff == '') {
             $r .= ' ';
         } else {
             $r .= ' ' . $chardiff . ' . . ';
         }
     }
     $r .= $users;
     $r .= $this->numberofWatchingusers($block[0]->numberofWatchingusers);
     $r .= "</td></tr></table>\n";
     # Sub-entries
     $r .= '<div id="mw-rc-subentries-' . $jsid . '" class="mw-changeslist-hidden">';
     $r .= '<table cellpadding="0" cellspacing="0"  border="0" style="background: none">';
     foreach ($block as $rcObj) {
         # Extract fields from DB into the function scope (rc_xxxx variables)
         // FIXME: Would be good to replace this extract() call with something
         // that explicitly initializes variables.
         extract($rcObj->mAttribs);
         #$r .= '<tr><td valign="top">'.$this->spacerArrow();
         $r .= '<tr><td valign="top">';
         $r .= '<tt>' . $this->spacerIndent() . $this->spacerIndent();
         $r .= $this->recentChangesFlags($rc_new, $rc_minor, $rcObj->unpatrolled, '&nbsp;', $rc_bot);
         $r .= '&nbsp;</tt></td><td valign="top">';
         $o = '';
         if ($rc_this_oldid != 0) {
             $o = 'oldid=' . $rc_this_oldid;
         }
         # Log timestamp
         if ($rc_type == RC_LOG) {
             $link = '<tt>' . $rcObj->timestamp . '</tt> ';
             # Revision link
         } else {
             if (!ChangesList::userCan($rcObj, Revision::DELETED_TEXT)) {
                 $link = '<span class="history-deleted"><tt>' . $rcObj->timestamp . '</tt></span> ';
             } else {
                 $rcIdEq = $rcObj->unpatrolled && $rc_type == RC_NEW ? '&rcid=' . $rcObj->mAttribs['rc_id'] : '';
                 $link = '<tt>' . $this->skin->makeKnownLinkObj($rcObj->getTitle(), $rcObj->timestamp, $curIdEq . '&' . $o . $rcIdEq) . '</tt>';
                 if ($this->isDeleted($rcObj, Revision::DELETED_TEXT)) {
                     $link = '<span class="history-deleted">' . $link . '</span> ';
                 }
             }
         }
         $r .= $link;
         if (!$rc_type == RC_LOG || $rc_type == RC_NEW) {
             $r .= ' (';
             $r .= $rcObj->curlink;
             $r .= $this->message['semicolon-separator'];
             $r .= $rcObj->lastlink;
             $r .= ')';
         }
         $r .= ' . . ';
         # Character diff
         if ($wgRCShowChangedSize) {
             $r .= $rcObj->getCharacterDifference() == '' ? '' : $rcObj->getCharacterDifference() . ' . . ';
         }
         # User links
         $r .= $rcObj->userlink;
         $r .= $rcObj->usertalklink;
         // log action
         parent::insertAction($r, $rcObj);
         // log comment
         parent::insertComment($r, $rcObj);
         # Mark revision as deleted
         if (!$rc_log_type && $this->isDeleted($rcObj, Revision::DELETED_TEXT)) {
             $r .= ' <tt>' . wfMsgHtml('deletedrev') . '</tt>';
         }
         $r .= "</td></tr>\n";
     }
     $r .= "</table></div>\n";
     $this->rcCacheIndex++;
     return $r;
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:101,代码来源:ChangesList.php


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