本文整理汇总了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="font-size: 65%">" . $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));
}
示例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="font-size: 65%">" . $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();
}