Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

Commit

Permalink
make blocked modules a globally accessible variable
Browse files Browse the repository at this point in the history
as suggested by review
  • Loading branch information
Reno Reckling committed May 22, 2012
1 parent 6a0c857 commit 82eec8f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
5 changes: 3 additions & 2 deletions phprojekt/application/Default/Controllers/JsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,9 @@ private function _processModuleDirectory($path)
$output = "";
$files = scandir($path);
foreach ($files as $file) {
if ($file != '.' && $file != '..' && $file != 'Default' && $file != 'Calendar'
&& is_dir($path . '/' . $file . '/Views')) {
if ($file != '.' && $file != '..' && $file != 'Default' &&
!in_array($file, Phprojekt::getInstance()->getBlockedModuleNames()) &&
is_dir($path . '/' . $file . '/Views')) {
if (is_dir($path . $file . '/Views/dojo/scripts/')) {
$scripts = scandir($path . $file . '/Views/dojo/scripts/');
} else {
Expand Down
17 changes: 17 additions & 0 deletions phprojekt/library/Phprojekt.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ class Phprojekt
*/
protected $_view;

/**
* Array of blocked Modules.
*
* @var Array
*/
protected $_blockedModules = array("Calendar");

/**
* Returns the current version of PHProjekt.
*
Expand Down Expand Up @@ -1017,6 +1024,16 @@ public static function checkExtensionsAndSettings()
'recommendations' => $recommendations);
}

/**
* Returns a list of modules that should be blocked explicitely.
*
* @return array Array of bocked module names
*/
public function getBlockedModuleNames()
{
return $this->_blockedModules;
}

private function _dieWithInternalServerError()
{
$response = new Zend_Controller_Response_Http();
Expand Down

0 comments on commit 82eec8f

Please sign in to comment.