mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
Merge remote-tracking branch 'origin/2.0' into 2.1
This commit is contained in:
commit
35423c9aeb
@ -190,14 +190,14 @@ class DMSDocumentAddController extends LeftAndMain
|
||||
return Controller::join_links(
|
||||
$modelAdmin->Link('DMSDocumentSet'),
|
||||
'EditForm/field/DMSDocumentSet/item',
|
||||
$this->getRequest()->getVar('dsid'),
|
||||
(int) $this->getRequest()->getVar('dsid'),
|
||||
'edit'
|
||||
);
|
||||
}
|
||||
return $modelAdmin->Link();
|
||||
}
|
||||
|
||||
return $this->getPageEditLink($this->currentPageID(), $this->getRequest()->getVar('dsid'));
|
||||
return $this->getPageEditLink($this->currentPageID(), (int) $this->getRequest()->getVar('dsid'));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -212,7 +212,7 @@ class DMSDocumentAddController extends LeftAndMain
|
||||
return Controller::join_links(
|
||||
CMSPageEditController::singleton()->getEditForm($pageId)->FormAction(),
|
||||
'field/Document Sets/item',
|
||||
$documentSetId
|
||||
(int) $documentSetId
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1322,6 +1322,9 @@ class DMSDocument extends DataObject implements DMSDocumentInterface
|
||||
. '<ul>';
|
||||
|
||||
foreach ($this->actionTasks as $panelKey => $title) {
|
||||
$panelKey = Convert::raw2xml($panelKey);
|
||||
$title = Convert::raw2xml($title);
|
||||
|
||||
$html .= '<li class="ss-ui-button dmsdocument-action" data-panel="' . $panelKey . '">'
|
||||
. _t('DMSDocument.ACTION_' . strtoupper($panelKey), $title)
|
||||
. '</li>';
|
||||
|
@ -82,6 +82,7 @@ class DMSDocument_Controller extends Controller
|
||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||
$mime = finfo_file($finfo, $path);
|
||||
} elseif (is_executable($fileBin)) {
|
||||
$path = escapeshellarg($path);
|
||||
// try to use the system tool
|
||||
$mime = `$fileBin -i -b $path`;
|
||||
$mime = explode(';', $mime);
|
||||
@ -89,7 +90,7 @@ class DMSDocument_Controller extends Controller
|
||||
} else {
|
||||
// make do with what we have
|
||||
$ext = $doc->getExtension();
|
||||
if ($ext =='pdf') {
|
||||
if ($ext == 'pdf') {
|
||||
$mime = 'application/pdf';
|
||||
} elseif ($ext == 'html' || $ext =='htm') {
|
||||
$mime = 'text/html';
|
||||
|
@ -39,10 +39,12 @@ class ShortCodeRelationFinder
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $number
|
||||
* @return DataList
|
||||
*/
|
||||
public function getList($number)
|
||||
{
|
||||
$number = (int) $number;
|
||||
$list = DataList::create('SiteTree');
|
||||
$where = array();
|
||||
$fields = $this->getShortCodeFields('SiteTree');
|
||||
|
Loading…
Reference in New Issue
Block a user