Skip to content

Commit

Permalink
adding a method to get plugins that are disabled. This method can be …
Browse files Browse the repository at this point in the history
…used to filter out data so that turning a plugin off stops pulling its data from the db
  • Loading branch information
dogmatic69 committed May 24, 2012
1 parent f7c9de3 commit 6b61c7e
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Core/Installer/Model/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,38 @@ public function getActiveInstalledPlugins($type = 'list'){
)
);
}

public function getInactiveInstalledPlugins($type = 'list') {
return $this->__installedPluginsByState(0);
}

private function __installedPluginsByState($active = 1, $type = 'list') {
if(!in_array($type, array('list', 'count', 'all'))){
$type = 'list';
}

$fields = array(
$this->alias . '.id',
$this->alias . '.internal_name'
);

if($type !== 'list'){
$fields = array();
}

return $this->find(
$type,
array(
'fields' => $fields,
'conditions' => array(
'or' => array(
$this->alias . '.active' => $active,
$this->alias . '.core' => 1
)
)
)
);
}

/**
* @brief method to find a list of plugins not yet installed
Expand Down

0 comments on commit 6b61c7e

Please sign in to comment.