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


PHP Notifications::notifyByEmail方法代码示例

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


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

示例1: deletemarked

 /**
  * @return string HTML
  */
 public function deletemarked($request)
 {
     $fileIDs = $request->requestVar($this->Name());
     $numFiles = 0;
     $brokenPageList = '';
     if ($fileIDs && count($fileIDs)) {
         $files = DataObject::get("File", sprintf("\"File\".\"ID\" IN (%s)", Convert::raw2sql(implode(',', $fileIDs))));
         if ($files) {
             $brokenPages = array();
             foreach ($files as $file) {
                 $brokenPages = array_merge($brokenPages, $file->BackLinkTracking()->toArray());
                 $file->delete();
                 $numFiles++;
             }
             if ($brokenPages) {
                 $brokenPageList = "  " . _t('AssetAdmin.NOWBROKEN', 'These pages now have broken links:') . '<ul>';
                 foreach ($brokenPages as $brokenPage) {
                     $brokenPageList .= "<li style=&quot;font-size: 65%&quot;>" . $brokenPage->Breadcrumbs(3, true) . '</li>';
                 }
                 $brokenPageList .= '</ul>';
                 Notifications::notifyByEmail("BrokenLink", "Page_BrokenLinkEmail");
             } else {
                 $brokenPageList = '';
             }
         }
     }
     $response = $this->form->Controller()->getResponse();
     $response->addHeader('X-Status', sprintf(_t('AssetAdmin.DELETEDX', "Deleted %s file(s) %s"), $numFiles, $brokenPageList));
 }
开发者ID:rixrix,项目名称:silverstripe-cms,代码行数:32,代码来源:AssetTableField.php

示例2: deletemarked

 /**
  * Perform the "delete marked" action.
  * Called and returns in same way as 'save' function
  */
 public function deletemarked($urlParams, $form)
 {
     $fileList = "'" . ereg_replace(' *, *', "','", trim(addslashes($_REQUEST['FileIDs']))) . "'";
     $numFiles = 0;
     $folderID = 0;
     $deleteList = '';
     $brokenPageList = '';
     if ($fileList != "''") {
         $files = DataObject::get('File', "`File`.ID IN ({$fileList})");
         if ($files) {
             foreach ($files as $file) {
                 if ($file instanceof Image) {
                     $file->deleteFormattedImages();
                 }
                 if (!$folderID) {
                     $folderID = $file->ParentID;
                 }
                 $file->delete();
                 $numFiles++;
             }
             if ($brokenPages = Notifications::getItems('BrokenLink')) {
                 $brokenPageList = "  " . _t('AssetAdmin.NOWBROKEN', 'These pages now have broken links:') . '</ul>';
                 foreach ($brokenPages as $brokenPage) {
                     $brokenPageList .= "<li style=&quot;font-size: 65%&quot;>" . $brokenPage->Breadcrumbs(3, true) . '</li>';
                 }
                 $brokenPageList .= '</ul>';
                 Notifications::notifyByEmail("BrokenLink", "Page_BrokenLinkEmail");
             } else {
                 $brokenPageList = '';
             }
             $deleteList = '';
             if ($folderID) {
                 $remaining = DB::query("SELECT COUNT(*) FROM `File` WHERE `ParentID`={$folderID}")->value();
                 if (!$remaining) {
                     $deleteList .= "Element.removeClassName(\$('sitetree').getTreeNodeByIdx('{$folderID}').getElementsByTagName('a')[0],'contents');";
                 }
             }
         } else {
             user_error("No files in {$fileList} could be found!", E_USER_ERROR);
         }
     }
     $message = sprintf(_t('AssetAdmin.DELETEDX', "Deleted %s files.%s"), $numFiles, $brokenPageList);
     FormResponse::add($deleteList);
     FormResponse::status_message($message, "good");
     FormResponse::add("\$('Form_EditForm').getPageFromServer(\$('Form_EditForm_ID').value)");
     return FormResponse::respond();
 }
开发者ID:racontemoi,项目名称:shibuichi,代码行数:51,代码来源:AssetAdmin.php


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