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


PHP UploadBase::userCanReUpload方法代码示例

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


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

示例1: onSkinTemplateNavigation

 /**
  * Add "replace" button to File pages
  * Add "remove" action to MenuButtons on premium video file pages
  * This button will remove a video from a wiki but keep it on the Video Wiki.
  */
 public static function onSkinTemplateNavigation($skin, &$tabs)
 {
     global $wgUser;
     $app = F::app();
     $title = $app->wg->Title;
     if ($title instanceof Title && $title->getNamespace() == NS_FILE && $title->exists()) {
         $file = wfFindFile($title);
         if ($file instanceof File && UploadBase::userCanReUpload($wgUser, $file->getName())) {
             if (WikiaFileHelper::isFileTypeVideo($file)) {
                 $uploadTitle = SpecialPage::getTitleFor('WikiaVideoAdd');
                 $href = $uploadTitle->getFullURL(array('name' => $file->getName()));
             } else {
                 $uploadTitle = SpecialPage::getTitleFor('Upload');
                 $href = $uploadTitle->getFullURL(array('wpDestFile' => $file->getName(), 'wpForReUpload' => 1));
             }
             $tabs['actions']['replace-file'] = array('class' => 'replace-file', 'text' => wfMessage('file-page-replace-button'), 'href' => $href);
         }
     }
     // Ignore Video Wiki videos beyond this point
     if ($app->wg->CityId == self::VIDEO_WIKI) {
         return true;
     }
     if (WikiaFileHelper::isFileTypeVideo($title)) {
         $file = wfFindFile($title);
         if (!$file->isLocal()) {
             // Prevent move tab being shown.
             unset($tabs['actions']['move']);
         }
     }
     return true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:36,代码来源:FilePageHooks.class.php

示例2: uploadLinksBox

 /**
  * Print out the various links at the bottom of the image page, e.g. reupload,
  * external editing (and instructions link) etc.
  */
 protected function uploadLinksBox()
 {
     global $wgEnableUploads;
     if (!$wgEnableUploads) {
         return;
     }
     $this->loadFile();
     if (!$this->mPage->getFile()->isLocal()) {
         return;
     }
     $out = $this->getContext()->getOutput();
     $out->addHTML("<ul>\n");
     # "Upload a new version of this file" link
     $canUpload = $this->getTitle()->userCan('upload', $this->getContext()->getUser());
     if ($canUpload && UploadBase::userCanReUpload($this->getContext()->getUser(), $this->mPage->getFile()->name)) {
         $ulink = Linker::makeExternalLink($this->getUploadUrl(), wfMessage('uploadnewversion-linktext')->text());
         $out->addHTML("<li id=\"mw-imagepage-reupload-link\"><div class=\"plainlinks\">{$ulink}</div></li>\n");
     } else {
         $out->addHTML("<li id=\"mw-imagepage-upload-disallowed\">" . $this->getContext()->msg('upload-disallowed-here')->escaped() . "</li>\n");
     }
     $out->addHTML("</ul>\n");
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:26,代码来源:ImagePage.php

示例3: uploadLinksBox

 /**
  * Print out the various links at the bottom of the image page, e.g. reupload,
  * external editing (and instructions link) etc.
  */
 protected function uploadLinksBox()
 {
     global $wgUser, $wgOut, $wgEnableUploads, $wgUseExternalEditor;
     if (!$wgEnableUploads) {
         return;
     }
     $this->loadFile();
     if (!$this->img->isLocal()) {
         return;
     }
     $sk = $wgUser->getSkin();
     $wgOut->addHTML("<br /><ul>\n");
     # "Upload a new version of this file" link
     if (UploadBase::userCanReUpload($wgUser, $this->img->name)) {
         $ulink = $sk->makeExternalLink($this->getUploadUrl(), wfMsg('uploadnewversion-linktext'));
         $wgOut->addHTML("<li id=\"mw-imagepage-reupload-link\"><div class=\"plainlinks\">{$ulink}</div></li>\n");
     }
     # External editing link
     if ($wgUseExternalEditor) {
         $elink = $sk->link($this->mTitle, wfMsgHtml('edit-externally'), array(), array('action' => 'edit', 'externaledit' => 'true', 'mode' => 'file'), array('known', 'noclasses'));
         $wgOut->addHTML('<li id="mw-imagepage-edit-external">' . $elink . ' <small>' . wfMsgExt('edit-externally-help', array('parseinline')) . "</small></li>\n");
     }
     $wgOut->addHTML("</ul>\n");
 }
开发者ID:GodelDesign,项目名称:Godel,代码行数:28,代码来源:ImagePage.php

示例4: uploadLinksBox

 /**
  * Print out the various links at the bottom of the image page, e.g. reupload,
  * external editing (and instructions link) etc.
  */
 protected function uploadLinksBox()
 {
     global $wgEnableUploads, $wgUseExternalEditor;
     if (!$wgEnableUploads) {
         return;
     }
     $this->loadFile();
     if (!$this->mPage->getFile()->isLocal()) {
         return;
     }
     $out = $this->getContext()->getOutput();
     $out->addHTML("<ul>\n");
     # "Upload a new version of this file" link
     $canUpload = $this->getTitle()->userCan('upload', $this->getContext()->getUser());
     if ($canUpload && UploadBase::userCanReUpload($this->getContext()->getUser(), $this->mPage->getFile()->name)) {
         $ulink = Linker::makeExternalLink($this->getUploadUrl(), wfMessage('uploadnewversion-linktext')->text());
         $out->addHTML("<li id=\"mw-imagepage-reupload-link\"><div class=\"plainlinks\">{$ulink}</div></li>\n");
     } else {
         $out->addHTML("<li id=\"mw-imagepage-upload-disallowed\">" . $this->getContext()->msg('upload-disallowed-here')->escaped() . "</li>\n");
     }
     # External editing link
     if ($wgUseExternalEditor) {
         $elink = Linker::linkKnown($this->getTitle(), wfMessage('edit-externally')->escaped(), array(), array('action' => 'edit', 'externaledit' => 'true', 'mode' => 'file'));
         $out->addHTML('<li id="mw-imagepage-edit-external">' . $elink . ' <small>' . wfMessage('edit-externally-help')->parse() . "</small></li>\n");
     }
     $out->addHTML("</ul>\n");
 }
开发者ID:seedbank,项目名称:old-repo,代码行数:31,代码来源:ImagePage.php

示例5: uploadLinksBox

 /**
  * Print out the various links at the bottom of the image page, e.g. reupload,
  * external editing (and instructions link) etc.
  */
 protected function uploadLinksBox()
 {
     global $wgUser, $wgOut, $wgEnableUploads, $wgUseExternalEditor;
     if (!$wgEnableUploads) {
         return;
     }
     $this->loadFile();
     if (!$this->mPage->getFile()->isLocal()) {
         return;
     }
     $wgOut->addHTML("<br /><ul>\n");
     # "Upload a new version of this file" link
     /* Wikia change begin - @author: mech - replacing ->name with ->getName(), as File::$name is protected */
     if (UploadBase::userCanReUpload($wgUser, $this->mPage->getFile()->getName())) {
         /* Wikia change - end */
         $ulink = Linker::makeExternalLink($this->getUploadUrl(), wfMsg('uploadnewversion-linktext'));
         $wgOut->addHTML("<li id=\"mw-imagepage-reupload-link\"><div class=\"plainlinks\">{$ulink}</div></li>\n");
     }
     # External editing link
     if ($wgUseExternalEditor) {
         $elink = Linker::link($this->getTitle(), wfMsgHtml('edit-externally'), array(), array('action' => 'edit', 'externaledit' => 'true', 'mode' => 'file'), array('known', 'noclasses'));
         $wgOut->addHTML('<li id="mw-imagepage-edit-external">' . $elink . ' <small>' . wfMsgExt('edit-externally-help', array('parseinline')) . "</small></li>\n");
     }
     $wgOut->addHTML("</ul>\n");
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:29,代码来源:ImagePage.php


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