Skip to content

Commit

Permalink
cleaning up the code
Browse files Browse the repository at this point in the history
  • Loading branch information
colymba committed Aug 7, 2012
1 parent cf0a326 commit fe8e41a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 64 deletions.
2 changes: 1 addition & 1 deletion _config.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

//define global path to Components' root folder
if(!defined('BULK_EDIT_TOOLS_PATH'))
{
define('BULK_EDIT_TOOLS_PATH', rtrim(basename(dirname(__FILE__))));
Expand Down
4 changes: 2 additions & 2 deletions code/GridFieldBulkEditingTools.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
/**
*
* Base Component for all 'GridFieldBulkEditingTools'
* defines the common HTML fragment
*
* @author colymba
* @package GridFieldBulkEditingTools
Expand All @@ -12,7 +13,6 @@ public function getHTMLFragments($gridField)
Requirements::css(BULK_EDIT_TOOLS_PATH . '/css/GridFieldBulkEditingTools.css');

return array(
//"footer" => '<tr><td colspan="'.$columnsCount.'">\$DefineFragment(bulk-edit-tools)</td></tr>'
"after" => "<div id=\"bulkEditTools\">\$DefineFragment(bulk-edit-tools)</div>"
);
}
Expand Down
65 changes: 4 additions & 61 deletions code/GridFieldBulkImageUpload_Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ class GridFieldBulkImageUpload_Request extends RequestHandler {
*
*/
static $url_handlers = array(
'$Action!' => '$Action'/*,
'' => 'uploadForm'*/
'$Action!' => '$Action'
);

/**
Expand Down Expand Up @@ -121,53 +120,10 @@ function getDefaultRecordImageField()
}

/**
* Return a list of the GridField managed DataObject's editable fields: (HTML)Text, (HTML)Varchar and Enum fields
*
* @return array
*/
/*
function getDefaultRecordEditableFields()
{
$recordClass = $this->gridField->list->dataClass;
$recordDbFields = Config::inst()->get($recordClass, 'db', Config::UNINHERITED);
$editableFields = array();
foreach ( $recordDbFields as $field => $type )
{
if ( preg_match( '/(Text|Varchar|Enum)/i', $type ) > 0 ) {
array_push($editableFields, $field);
}
}
return $editableFields;
}
*/

/**
* Return the CMS edit field for a given name. As set in the GridField managed DataObject getCMSFields method
*
* @param string $fieldName
* @return FormField
*
* @param type $recordID
* @return type
*/
/*
function getFieldEditForm($fieldName)
{
if ( !$this->recordCMSFieldList ) {
$recordClass = $this->gridField->list->dataClass;
$this->recordCMSFieldList = singleton($recordClass)->getCMSFields();
}
$field = $this->recordCMSFieldList->fieldByName($fieldName);
if ( !$field ) {
$fields = $this->recordCMSFieldList->dataFields();
$field = $fields[$fieldName];
}
return $field;
}
*/

function getRecordHTMLFormFields( $recordID = 0 )
{
$config = $this->component->getConfig();
Expand Down Expand Up @@ -336,19 +292,6 @@ public function upload(SS_HTTPRequest $request)
//get record's CMS Fields
$recordEditableFormFields = $this->getRecordHTMLFormFields( $record->ID );


// collect all editable fields forms
/*
$recordEditableFieldsForms = array();
foreach ( $this->getRecordEditableFields() as $editableFieldName )
{
$formField = $this->getFieldEditForm($editableFieldName);
if ( $formField ) {
array_push($recordEditableFieldsForms, $this->parseFieldHTMLWithRecordID($formField->FieldHolder(), $record->ID) );
}
}
*/

// Collect all output data.
$return = array_merge($return, array(
'id' => $file->ID,
Expand Down

0 comments on commit fe8e41a

Please sign in to comment.