Skip to content

Commit

Permalink
adding the method to get plugins here so it can be used anywere
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Jan 28, 2010
1 parent 62e3807 commit a1fb9ed
Showing 1 changed file with 53 additions and 35 deletions.
88 changes: 53 additions & 35 deletions app_model.php
Original file line number Diff line number Diff line change
@@ -1,36 +1,54 @@
<?php
/**
* Comment Template.
*
* @todo Implement .this needs to be sorted out.
*
* Copyright (c) 2009 Carl Sutton ( dogmatic69 )
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
* @filesource
* @copyright Copyright (c) 2009 Carl Sutton ( dogmatic69 )
* @link http://infinitas-cms.org
* @package sort
* @subpackage sort.comments
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @since 0.5a
*/

class AppModel extends Model {
/**
* The database configuration to use for the site.
*/
var $useDbConfig = 'default';

/**
* Behaviors to attach to the site.
*/
var $actsAs = array(
'Containable',
'Libs.Lockable',
'Libs.Logable'
);
}

<?php
/**
* Comment Template.
*
* @todo Implement .this needs to be sorted out.
*
* Copyright (c) 2009 Carl Sutton ( dogmatic69 )
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
* @filesource
* @copyright Copyright (c) 2009 Carl Sutton ( dogmatic69 )
* @link http://infinitas-cms.org
* @package sort
* @subpackage sort.comments
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @since 0.5a
*/

class AppModel extends Model {
/**
* The database configuration to use for the site.
*/
var $useDbConfig = 'default';

/**
* Behaviors to attach to the site.
*/
var $actsAs = array(
'Containable',
'Libs.Lockable',
'Libs.Logable'
);

var $blockedPlugins = array(
'DebugKit',
'Filter',
'Libs'
);

function getPlugins(){
$plugins = Configure::listObjects('plugin');

foreach($plugins as $plugin){
if (!in_array($plugin, $this->blockedPlugins)){
$return[Inflector::underscore($plugin)] = $plugin;
}
}

return array('' => 'None') + (array)$return;
}
}

?>

0 comments on commit a1fb9ed

Please sign in to comment.