diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-11 15:48:50 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-11 15:48:50 +0200 |
commit | 80707aa9e3c2925b4ae995661013be622963c217 (patch) | |
tree | bfd86604827bc9ca6bb86292467a18afd8924322 /bl/folderbl.php | |
parent | 7808ff902b745b8e7d2fabb5f941d818b0dc78fd (diff) |
translate folder and feed errors and added css and template code for creating folders and feeds and what happens when an error gets triggered
Diffstat (limited to 'bl/folderbl.php')
-rw-r--r-- | bl/folderbl.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/bl/folderbl.php b/bl/folderbl.php index 3fcf48c7f..b542f3d34 100644 --- a/bl/folderbl.php +++ b/bl/folderbl.php @@ -25,14 +25,20 @@ namespace OCA\News\Bl; +use \OCA\AppFramework\Core\API; + use \OCA\News\Db\Folder; use \OCA\News\Db\FolderMapper; class FolderBl extends Bl { - public function __construct(FolderMapper $folderMapper){ + private $api; + + public function __construct(FolderMapper $folderMapper, + API $api){ parent::__construct($folderMapper); + $this->api = $api; } @@ -44,8 +50,9 @@ class FolderBl extends Bl { private function allowNoNameTwice($folderName, $userId){ $existingFolders = $this->mapper->findByName($folderName, $userId); if(count($existingFolders) > 0){ - throw new BLException('Error: Folder with name ' . $folderName . - ' exists already!'); + + throw new BLException( + $this->api->getTrans()->t('Can not add folder: Exists already')); } } |