mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-09-28 20:29:20 +02:00
API remove obsolete CMSMain::buildbrokenlinks()
This commit is contained in:
parent
b135c2566c
commit
4d007cd13c
@ -53,7 +53,6 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
|
|
||||||
private static $allowed_actions = array(
|
private static $allowed_actions = array(
|
||||||
'archive',
|
'archive',
|
||||||
'buildbrokenlinks',
|
|
||||||
'deleteitems',
|
'deleteitems',
|
||||||
'DeleteItemsForm',
|
'DeleteItemsForm',
|
||||||
'dialog',
|
'dialog',
|
||||||
@ -1269,42 +1268,6 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
return $this->batchactions()->batchActionList();
|
return $this->batchactions()->batchActionList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildbrokenlinks($request) {
|
|
||||||
// Protect against CSRF on destructive action
|
|
||||||
if(!SecurityToken::inst()->checkRequest($request)) return $this->httpError(400);
|
|
||||||
|
|
||||||
increase_time_limit_to();
|
|
||||||
increase_memory_limit_to();
|
|
||||||
|
|
||||||
if($this->urlParams['ID']) {
|
|
||||||
$newPageSet[] = DataObject::get_by_id("Page", $this->urlParams['ID']);
|
|
||||||
} else {
|
|
||||||
$pages = DataObject::get("Page");
|
|
||||||
foreach($pages as $page) $newPageSet[] = $page;
|
|
||||||
$pages = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
$content = new HTMLEditorField('Content');
|
|
||||||
$download = new HTMLEditorField('Download');
|
|
||||||
|
|
||||||
foreach($newPageSet as $i => $page) {
|
|
||||||
$page->HasBrokenLink = 0;
|
|
||||||
$page->HasBrokenFile = 0;
|
|
||||||
|
|
||||||
$content->setValue($page->Content);
|
|
||||||
$content->saveInto($page);
|
|
||||||
|
|
||||||
$download->setValue($page->Download);
|
|
||||||
$download->saveInto($page);
|
|
||||||
|
|
||||||
echo "<li>$page->Title (link:$page->HasBrokenLink, file:$page->HasBrokenFile)";
|
|
||||||
|
|
||||||
$page->writeWithoutVersion();
|
|
||||||
$page->destroy();
|
|
||||||
$newPageSet[$i] = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function publishall($request) {
|
public function publishall($request) {
|
||||||
if(!Permission::check('ADMIN')) return Security::permissionFailure($this);
|
if(!Permission::check('ADMIN')) return Security::permissionFailure($this);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user