Permalink
Browse files

Make DMSDocument methods chainable. PHPDoc cleanup.

- Remove unimplemented getAllTags()
- Add .DS_Store as ignored file
- Add gridfieldextensions as a declared dependancy.
  • Loading branch information...
1 parent 0fb0410 commit 8e534e99f2bc157d379e7e1d1e796acdd5b6d00e @wilr wilr committed Jan 10, 2014
View
@@ -1 +1,2 @@
-.sass-cache
+.sass-cache
+.DS_Store
@@ -1,7 +1,10 @@
<?php
+
/**
* Handles replacing `dms_document_link` shortcodes with links to the actual
* document.
+ *
+ * @package dms
*/
class DMSShortcodeHandler {
@@ -1,5 +1,9 @@
<?php
+/**
+ * @package dms
+ */
+
class DMSDocumentAddController extends LeftAndMain {
private static $url_segment = 'pages/adddocument';
@@ -1,11 +1,16 @@
<?php
+
+/**
+ * @package dms
+ */
class DMSSiteTreeExtension extends DataExtension {
private static $belongs_many_many = array(
'Documents' => 'DMSDocument'
);
private static $noDocumentsList = array();
+
private static $showDocumentsList = array();
/**
@@ -82,27 +87,27 @@ function updateCMSFields(FieldList $fields){
singleton('DMSDocument');
$gridFieldConfig->getComponentByType('GridFieldDataColumns')->setDisplayFields(Config::inst()->get('DMSDocument', 'display_fields'))
->setFieldCasting(array('LastChanged'=>"Datetime->Ago"))
- ->setFieldFormatting(array('FilenameWithoutID'=>'<a target=\'_blank\' class=\'file-url\' href=\'$Link\'>$FilenameWithoutID</a>'));
+ ->setFieldFormatting(array('FilenameWithoutID'=>'<a target=\'_blank\' class=\'file-url\' href=\'$Link\'>$FilenameWithoutID</a>'));
//override delete functionality with this class
$gridFieldConfig->getComponentByType('GridFieldDetailForm')->setItemRequestClass('DMSGridFieldDetailForm_ItemRequest');
$gridField = GridField::create(
- 'Documents',
- false,
+ 'Documents',
+ false,
$this->owner->Documents()->Sort('DocumentSort'),
$gridFieldConfig
);
$gridField->addExtraClass('documents');
$uploadBtn = new LiteralField(
- 'UploadButton',
+ 'UploadButton',
sprintf(
'<a class="ss-ui-button ss-ui-action-constructive cms-panel-link" data-pjax-target="Content" data-icon="add" href="%s">%s</a>',
Controller::join_links(singleton('DMSDocumentAddController')->Link(), '?ID=' . $this->owner->ID),
"Add Documents"
)
- );
+ );
$fields->addFieldsToTab(
'Root.Documents (' . $this->owner->Documents()->Count() . ')',
@@ -122,7 +127,7 @@ function Documents() {
function onBeforeDelete() {
if(Versioned::current_stage() == 'Live') {
- $existsOnOtherStage = !$this->owner->getIsDeletedFromStage();
+ $existsOnOtherStage = !$this->owner->getIsDeletedFromStage();
} else {
$existsOnOtherStage = $this->owner->getExistsOnLive();
}
@@ -100,18 +100,6 @@ function removeTag($category, $value = null);
function removeAllTags();
/**
- * Returns a multi-dimensional array containing all Tags associated with this DMSDocument. The array has the
- * following structure:
- * $twoDimensionalArray = new array(
- * array('fruit','banana'),
- * array('fruit','apple')
- * );
- * @abstract
- * @return array Multi-dimensional array of tags
- */
- function getAllTags();
-
- /**
* Returns a link to download this DMSDocument from the DMS store
* @abstract
* @return String
Oops, something went wrong.

0 comments on commit 8e534e9

Please sign in to comment.