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(
|
return Controller::join_links(
|
||||||
$modelAdmin->Link('DMSDocumentSet'),
|
$modelAdmin->Link('DMSDocumentSet'),
|
||||||
'EditForm/field/DMSDocumentSet/item',
|
'EditForm/field/DMSDocumentSet/item',
|
||||||
$this->getRequest()->getVar('dsid'),
|
(int) $this->getRequest()->getVar('dsid'),
|
||||||
'edit'
|
'edit'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return $modelAdmin->Link();
|
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(
|
return Controller::join_links(
|
||||||
CMSPageEditController::singleton()->getEditForm($pageId)->FormAction(),
|
CMSPageEditController::singleton()->getEditForm($pageId)->FormAction(),
|
||||||
'field/Document Sets/item',
|
'field/Document Sets/item',
|
||||||
$documentSetId
|
(int) $documentSetId
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1322,6 +1322,9 @@ class DMSDocument extends DataObject implements DMSDocumentInterface
|
|||||||
. '<ul>';
|
. '<ul>';
|
||||||
|
|
||||||
foreach ($this->actionTasks as $panelKey => $title) {
|
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 . '">'
|
$html .= '<li class="ss-ui-button dmsdocument-action" data-panel="' . $panelKey . '">'
|
||||||
. _t('DMSDocument.ACTION_' . strtoupper($panelKey), $title)
|
. _t('DMSDocument.ACTION_' . strtoupper($panelKey), $title)
|
||||||
. '</li>';
|
. '</li>';
|
||||||
|
@ -82,6 +82,7 @@ class DMSDocument_Controller extends Controller
|
|||||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||||
$mime = finfo_file($finfo, $path);
|
$mime = finfo_file($finfo, $path);
|
||||||
} elseif (is_executable($fileBin)) {
|
} elseif (is_executable($fileBin)) {
|
||||||
|
$path = escapeshellarg($path);
|
||||||
// try to use the system tool
|
// try to use the system tool
|
||||||
$mime = `$fileBin -i -b $path`;
|
$mime = `$fileBin -i -b $path`;
|
||||||
$mime = explode(';', $mime);
|
$mime = explode(';', $mime);
|
||||||
@ -89,7 +90,7 @@ class DMSDocument_Controller extends Controller
|
|||||||
} else {
|
} else {
|
||||||
// make do with what we have
|
// make do with what we have
|
||||||
$ext = $doc->getExtension();
|
$ext = $doc->getExtension();
|
||||||
if ($ext =='pdf') {
|
if ($ext == 'pdf') {
|
||||||
$mime = 'application/pdf';
|
$mime = 'application/pdf';
|
||||||
} elseif ($ext == 'html' || $ext =='htm') {
|
} elseif ($ext == 'html' || $ext =='htm') {
|
||||||
$mime = 'text/html';
|
$mime = 'text/html';
|
||||||
|
@ -39,10 +39,12 @@ class ShortCodeRelationFinder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param int $number
|
||||||
* @return DataList
|
* @return DataList
|
||||||
*/
|
*/
|
||||||
public function getList($number)
|
public function getList($number)
|
||||||
{
|
{
|
||||||
|
$number = (int) $number;
|
||||||
$list = DataList::create('SiteTree');
|
$list = DataList::create('SiteTree');
|
||||||
$where = array();
|
$where = array();
|
||||||
$fields = $this->getShortCodeFields('SiteTree');
|
$fields = $this->getShortCodeFields('SiteTree');
|
||||||
|
Loading…
Reference in New Issue
Block a user