summaryrefslogtreecommitdiff
path: root/app/controllers/entryController.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-07-04 19:38:29 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-07-04 19:38:29 +0200
commiteb5f05304c253df90873b94ba52d7093115f3850 (patch)
tree1152ab618aa5cf884a1f2f2e2d1926da4167a6be /app/controllers/entryController.php
parent8dd5fd51f74a47e5c80052f27a74cdcd5dd044b9 (diff)
parentb5f233f6d524ca9f74e9d33bf5692a1a678d7fec (diff)
Merge branch 'dev'0.4.0
Diffstat (limited to 'app/controllers/entryController.php')
-rwxr-xr-xapp/controllers/entryController.php86
1 files changed, 17 insertions, 69 deletions
diff --git a/app/controllers/entryController.php b/app/controllers/entryController.php
index 35f3150ea..c7e13f471 100755
--- a/app/controllers/entryController.php
+++ b/app/controllers/entryController.php
@@ -98,74 +98,22 @@ class entryController extends ActionController {
}
}
- public function noteAction () {
- View::appendScript (Url::display (array ('c' => 'javascript', 'a' => 'main')));
-
- $not_found = false;
- $entryDAO = new EntryDAO ();
- $catDAO = new CategoryDAO ();
-
- $id = Request::param ('id');
- if ($id) {
- $entry = $entryDAO->searchById ($id);
-
- if ($entry) {
- $feed = $entry->feed (true);
-
- if (Request::isPost ()) {
- $note = htmlspecialchars (Request::param ('note', ''));
- $public = Request::param ('public', 'no');
- if ($public == 'yes') {
- $public = true;
- } else {
- $public = false;
- }
-
- $values = array (
- 'annotation' => $note,
- 'is_public' => $public,
- 'lastUpdate' => time ()
- );
-
- if ($entryDAO->updateEntry ($id, $values)) {
- $notif = array (
- 'type' => 'good',
- 'content' => Translate::t ('updated')
- );
- } else {
- $notif = array (
- 'type' => 'bad',
- 'content' => Translate::t ('error_occured')
- );
- }
- Session::_param ('notification', $notif);
- Request::forward (array (
- 'c' => 'entry',
- 'a' => 'note',
- 'params' => array (
- 'id' => $id
- )
- ), true);
- }
- } else {
- $not_found = true;
- }
- } else {
- $not_found = true;
- }
-
- if ($not_found) {
- Error::error (
- 404,
- array ('error' => array (Translate::t ('page_not_found')))
- );
- } else {
- $this->view->entry = $entry;
- $this->view->cat_aside = $catDAO->listCategories ();
- $this->view->nb_favorites = $entryDAO->countFavorites ();
- $this->view->nb_total = $entryDAO->count ();
- $this->view->get_c = $feed->category ();
- $this->view->get_f = $feed->id ();
- }
+ public function optimizeAction() {
+ // La table des entrées a tendance à grossir énormément
+ // Cette action permet d'optimiser cette table permettant de grapiller un peu de place
+ // Cette fonctionnalité n'est à appeler qu'occasionnellement
+ $entryDAO = new EntryDAO();
+ $entryDAO->optimizeTable();
+
+ $notif = array (
+ 'type' => 'good',
+ 'content' => Translate::t ('optimization_complete')
+ );
+ Session::_param ('notification', $notif);
+
+ Request::forward(array(
+ 'c' => 'configure',
+ 'a' => 'display'
+ ), true);
}
}