-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1111 from J9rem/fix/some-compatibility-errors
Fix/some compatibility errors and PageController
- Loading branch information
Showing
13 changed files
with
82 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace YesWiki\Core\Controller; | ||
|
||
use Exception; | ||
use YesWiki\Bazar\Controller\EntryController; | ||
use YesWiki\Bazar\Service\EntryManager; | ||
use YesWiki\Core\Controller\AuthController; | ||
use YesWiki\Core\Service\PageManager; | ||
use YesWiki\Core\YesWikiController; | ||
|
||
class PageController extends YesWikiController | ||
{ | ||
protected $authController; | ||
protected $entryController; | ||
protected $entryManager; | ||
protected $pageManager; | ||
|
||
public function __construct( | ||
AuthController $authController, | ||
EntryController $entryController, | ||
EntryManager $entryManager, | ||
PageManager $pageManager | ||
) { | ||
$this->authController = $authController; | ||
$this->entryController = $entryController; | ||
$this->entryManager = $entryManager; | ||
$this->pageManager = $pageManager; | ||
} | ||
|
||
/** | ||
* delete a page from tag | ||
* but be carefull entry or page | ||
* @param string $tag | ||
* @return bool $done | ||
* @throws Exception if in hibernation or if entry not deleted | ||
*/ | ||
public function delete(string $tag): bool | ||
{ | ||
if ($this->entryManager->isEntry($tag)){ | ||
return $this->entryController->delete($tag); | ||
} else { | ||
$this->pageManager->deleteOrphaned($tag); | ||
$this->wiki->LogAdministrativeAction($this->authController->getLoggedUserName(), "Suppression de la page ->\"\"" . $tag . "\"\""); | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.