Skip to content
This repository has been archived by the owner on Apr 5, 2018. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Olde Hampsink committed Apr 1, 2016
2 parents c2dc111 + b0afbf7 commit 9a74722
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ before_script:
- mkdir craft/storage
- mkdir -p craft/plugins/taskmanager
- for item in *; do if [[ ! "$item" == "craft" ]]; then mv $item craft/plugins/taskmanager; fi; done
- cd craft/app
- composer require mockery/mockery
- cd ../..

# execute tests
script: phpunit --bootstrap craft/app/tests/bootstrap.php --configuration craft/plugins/taskmanager/phpunit.xml.dist --coverage-clover coverage.clover craft/plugins/taskmanager/tests
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ phpunit --bootstrap craft/app/tests/bootstrap.php --configuration craft/plugins/

Changelog
=================
###0.3.1###
- Updated the plugin for Craft 2.5
- The hook "modifyTaskManagerAttributes" is now "defineAdditionalTaskManagerTableAttributes"
- Added description and documentation url

###0.3.0###
- Added sources by type
- Replaced action buttons by element actions
Expand Down
24 changes: 22 additions & 2 deletions TaskManagerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,24 @@ public function getName()
return Craft::t('Task Manager');
}

/**
* Get plugin description.
*
* @return string
*/
public function getDescription()
{
return Craft::t('Adds a "Task Manager" section to your CP to easily cancel or delete Craft Tasks.');
}

/**
* Get plugin version.
*
* @return string
*/
public function getVersion()
{
return '0.3.0';
return '0.3.1';
}

/**
Expand All @@ -50,7 +60,17 @@ public function getDeveloper()
*/
public function getDeveloperUrl()
{
return 'http://github.com/boboldehampsink';
return 'https://github.com/boboldehampsink';
}

/**
* Get plugin documentation url.
*
* @return string
*/
public function getDocumentationUrl()
{
return 'https://github.com/boboldehampsink/taskmanager';
}

/**
Expand Down
29 changes: 24 additions & 5 deletions elementtypes/TaskManagerElementType.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,11 @@ public function getAvailableActions($source = null)
}

/**
* Returns the attributes that can be shown/sorted by in table views.
*
* @param string|null $source
* @inheritDoc IElementType::defineAvailableTableAttributes()
*
* @return array
*/
public function defineTableAttributes($source = null)
public function defineAvailableTableAttributes()
{
$attributes = array(
'description' => Craft::t('Description'),
Expand All @@ -157,11 +155,32 @@ public function defineTableAttributes($source = null)
);

// Allow plugins to modify the attributes
craft()->plugins->call('modifyTaskManagerTableAttributes', array(&$attributes, $source));
$pluginAttributes = craft()->plugins->call('defineAdditionalTaskManagerTableAttributes', array(), true);
foreach ($pluginAttributes as $thisPluginAttributes) {
$attributes = array_merge($attributes, $thisPluginAttributes);
}

return $attributes;
}

/**
* @inheritDoc IElementType::getDefaultTableAttributes()
*
* @param string|null $source
*
* @return array
*/
public function getDefaultTableAttributes($source = null)
{
return array(
'description',
'type',
'dateCreated',
'currentStep',
'totalSteps',
);
}

/**
* Get table attribute html.
*
Expand Down

0 comments on commit 9a74722

Please sign in to comment.