]> BookStack Code Mirror - bookstack/commitdiff
Extracted text from logic files
authorDan Brown <redacted>
Sun, 4 Dec 2016 16:51:39 +0000 (16:51 +0000)
committerDan Brown <redacted>
Sun, 4 Dec 2016 16:51:39 +0000 (16:51 +0000)
38 files changed:
app/Http/Controllers/AttachmentController.php
app/Http/Controllers/Auth/ForgotPasswordController.php
app/Http/Controllers/Auth/LoginController.php
app/Http/Controllers/Auth/RegisterController.php
app/Http/Controllers/Auth/ResetPasswordController.php
app/Http/Controllers/BookController.php
app/Http/Controllers/ChapterController.php
app/Http/Controllers/ImageController.php
app/Http/Controllers/PageController.php
app/Http/Controllers/PermissionController.php
app/Http/Controllers/SearchController.php
app/Http/Controllers/SettingController.php
app/Http/Controllers/TagController.php
app/Http/Controllers/UserController.php
app/Repos/BookRepo.php
app/Repos/ChapterRepo.php
app/Repos/PageRepo.php
app/Repos/PermissionsRepo.php
app/Repos/TagRepo.php
app/Repos/UserRepo.php
app/Services/AttachmentService.php
app/Services/EmailConfirmationService.php
app/Services/ImageService.php
app/Services/LdapService.php
app/Services/SocialAuthService.php
resources/assets/js/controllers.js
resources/lang/en/auth.php
resources/lang/en/common.php
resources/lang/en/components.php
resources/lang/en/entities.php
resources/lang/en/errors.php
resources/lang/en/settings.php
resources/lang/en/validation.php
resources/views/books/show.blade.php
resources/views/chapters/show.blade.php
resources/views/errors/404.blade.php
resources/views/pages/show.blade.php
routes/web.php

index 62be0b852236f9109249e17834f32ae85ae7eaee..e61a488ce9e3b2d56a4887cb533dd465c8f07053 100644 (file)
@@ -77,7 +77,7 @@ class AttachmentController extends Controller
         $this->checkOwnablePermission('attachment-create', $attachment);
         
         if (intval($pageId) !== intval($attachment->uploaded_to)) {
-            return $this->jsonError('Page mismatch during attached file update');
+            return $this->jsonError(trans('errors.attachment_page_mismatch'));
         }
 
         $uploadedFile = $request->file('file');
@@ -113,7 +113,7 @@ class AttachmentController extends Controller
         $this->checkOwnablePermission('attachment-create', $attachment);
 
         if (intval($pageId) !== intval($attachment->uploaded_to)) {
-            return $this->jsonError('Page mismatch during attachment update');
+            return $this->jsonError(trans('errors.attachment_page_mismatch'));
         }
 
         $attachment = $this->attachmentService->updateFile($attachment, $request->all());
@@ -175,7 +175,7 @@ class AttachmentController extends Controller
 
         $attachments = $request->get('files');
         $this->attachmentService->updateFileOrderWithinPage($attachments, $pageId);
-        return response()->json(['message' => 'Attachment order updated']);
+        return response()->json(['message' => trans('entities.attachments_order_updated')]);
     }
 
     /**
@@ -210,6 +210,6 @@ class AttachmentController extends Controller
         $attachment = $this->attachment->findOrFail($attachmentId);
         $this->checkOwnablePermission('attachment-delete', $attachment);
         $this->attachmentService->deleteFile($attachment);
-        return response()->json(['message' => 'Attachment deleted']);
+        return response()->json(['message' => trans('entities.attachments_deleted')]);
     }
 }
index 45e40e6fe8371a5d8034ca2d5627f2ff63621acc..d1fbddc509593e347e8a5b789d2792c2d2abd071 100644 (file)
@@ -52,7 +52,7 @@ class ForgotPasswordController extends Controller
         );
 
         if ($response === Password::RESET_LINK_SENT) {
-            $message = 'A password reset link has been sent to ' . $request->get('email') . '.';
+            $message = trans('auth.reset_password_sent_success', ['email' => $request->get('email')]);
             session()->flash('success', $message);
             return back()->with('status', trans($response));
         }
index 0de4a8282b9d61e0f9ffabe75093446996e6c7e0..e7eeb9bc1629d2ed94441458f6435e0b22ff8982 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace BookStack\Http\Controllers\Auth;
 
+use BookStack\Exceptions\AuthException;
 use BookStack\Http\Controllers\Controller;
 use BookStack\Repos\UserRepo;
 use BookStack\Services\SocialAuthService;
@@ -86,7 +87,7 @@ class LoginController extends Controller
             // Check for users with same email already
             $alreadyUser = $user->newQuery()->where('email', '=', $user->email)->count() > 0;
             if ($alreadyUser) {
-                throw new AuthException('A user with the email ' . $user->email . ' already exists but with different credentials.');
+                throw new AuthException(trans('errors.error_user_exists_different_creds', ['email' => $user->email]));
             }
 
             $user->save();
index 6bba6de045f8d371e3f5b5d92d59b093ddd90df5..4bf4c0178067e92e74e2f0c146447cd1d5de18af 100644 (file)
@@ -3,6 +3,7 @@
 namespace BookStack\Http\Controllers\Auth;
 
 use BookStack\Exceptions\ConfirmationEmailException;
+use BookStack\Exceptions\SocialSignInException;
 use BookStack\Exceptions\UserRegistrationException;
 use BookStack\Repos\UserRepo;
 use BookStack\Services\EmailConfirmationService;
@@ -82,7 +83,7 @@ class RegisterController extends Controller
     protected function checkRegistrationAllowed()
     {
         if (!setting('registration-enabled')) {
-            throw new UserRegistrationException('Registrations are currently disabled.', '/login');
+            throw new UserRegistrationException(trans('auth.registrations_disabled'), '/login');
         }
     }
 
@@ -147,7 +148,7 @@ class RegisterController extends Controller
             $restrictedEmailDomains = explode(',', str_replace(' ', '', setting('registration-restrict')));
             $userEmailDomain = $domain = substr(strrchr($userData['email'], "@"), 1);
             if (!in_array($userEmailDomain, $restrictedEmailDomains)) {
-                throw new UserRegistrationException('That email domain does not have access to this application', '/register');
+                throw new UserRegistrationException(trans('auth.registration_email_domain_invalid'), '/register');
             }
         }
 
@@ -169,7 +170,7 @@ class RegisterController extends Controller
         }
 
         auth()->login($newUser);
-        session()->flash('success', 'Thanks for signing up! You are now registered and signed in.');
+        session()->flash('success', trans('auth.register_success'));
         return redirect($this->redirectPath());
     }
 
@@ -262,7 +263,7 @@ class RegisterController extends Controller
                 return $this->socialRegisterCallback($socialDriver);
             }
         } else {
-            throw new SocialSignInException('No action defined', '/login');
+            throw new SocialSignInException(trans('errors.social_no_action_defined'), '/login');
         }
         return redirect()->back();
     }
index bd64793f9223078d375da6577af9a01cfd1a9fae..eb678503d80828e7a7e700e42f2f335d252a20f4 100644 (file)
@@ -41,7 +41,7 @@ class ResetPasswordController extends Controller
      */
     protected function sendResetResponse($response)
     {
-        $message = 'Your password has been successfully reset.';
+        $message = trans('auth.reset_password_success');
         session()->flash('success', $message);
         return redirect($this->redirectPath())
             ->with('status', trans($response));
index 8ada594335292b93c5ffb7a6d7a89dd5e440bdcb..80a6c24b3c40686e81b1a036fe636eb24ff8d8d9 100644 (file)
@@ -7,6 +7,7 @@ use BookStack\Http\Requests;
 use BookStack\Repos\BookRepo;
 use BookStack\Repos\ChapterRepo;
 use BookStack\Repos\PageRepo;
+use Illuminate\Http\Response;
 use Views;
 
 class BookController extends Controller
@@ -53,7 +54,7 @@ class BookController extends Controller
     public function create()
     {
         $this->checkPermission('book-create-all');
-        $this->setPageTitle('Create New Book');
+        $this->setPageTitle(trans('entities.books_create'));
         return view('books/create');
     }
 
@@ -99,7 +100,7 @@ class BookController extends Controller
     {
         $book = $this->bookRepo->getBySlug($slug);
         $this->checkOwnablePermission('book-update', $book);
-        $this->setPageTitle('Edit Book ' . $book->getShortName());
+        $this->setPageTitle(trans('entities.books_edit_named',['bookName'=>$book->getShortName()]));
         return view('books/edit', ['book' => $book, 'current' => $book]);
     }
 
@@ -131,7 +132,7 @@ class BookController extends Controller
     {
         $book = $this->bookRepo->getBySlug($bookSlug);
         $this->checkOwnablePermission('book-delete', $book);
-        $this->setPageTitle('Delete Book ' . $book->getShortName());
+        $this->setPageTitle(trans('entities.books_delete_named', ['bookName'=>$book->getShortName()]));
         return view('books/delete', ['book' => $book, 'current' => $book]);
     }
 
@@ -146,7 +147,7 @@ class BookController extends Controller
         $this->checkOwnablePermission('book-update', $book);
         $bookChildren = $this->bookRepo->getChildren($book, true);
         $books = $this->bookRepo->getAll(false);
-        $this->setPageTitle('Sort Book ' . $book->getShortName());
+        $this->setPageTitle(trans('entities.books_sort_named', ['bookName'=>$book->getShortName()]));
         return view('books/sort', ['book' => $book, 'current' => $book, 'books' => $books, 'bookChildren' => $bookChildren]);
     }
 
@@ -264,7 +265,7 @@ class BookController extends Controller
         $book = $this->bookRepo->getBySlug($bookSlug);
         $this->checkOwnablePermission('restrictions-manage', $book);
         $this->bookRepo->updateEntityPermissionsFromRequest($request, $book);
-        session()->flash('success', 'Book Restrictions Updated');
+        session()->flash('success', trans('entities.books_permissions_updated'));
         return redirect($book->getUrl());
     }
 }
index a3fb600fd037b82adb0850cf7549fe7fd74c0703..84983518514d8342f9fbba4aeb63a7a34bd82887 100644 (file)
@@ -3,9 +3,9 @@
 use Activity;
 use BookStack\Repos\UserRepo;
 use Illuminate\Http\Request;
-use BookStack\Http\Requests;
 use BookStack\Repos\BookRepo;
 use BookStack\Repos\ChapterRepo;
+use Illuminate\Http\Response;
 use Views;
 
 class ChapterController extends Controller
@@ -38,7 +38,7 @@ class ChapterController extends Controller
     {
         $book = $this->bookRepo->getBySlug($bookSlug);
         $this->checkOwnablePermission('chapter-create', $book);
-        $this->setPageTitle('Create New Chapter');
+        $this->setPageTitle(trans('entities.chapters_create'));
         return view('chapters/create', ['book' => $book, 'current' => $book]);
     }
 
@@ -99,7 +99,7 @@ class ChapterController extends Controller
         $book = $this->bookRepo->getBySlug($bookSlug);
         $chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id);
         $this->checkOwnablePermission('chapter-update', $chapter);
-        $this->setPageTitle('Edit Chapter' . $chapter->getShortName());
+        $this->setPageTitle(trans('entities.chapters_edit_named', ['chapterName' => $chapter->getShortName()]));
         return view('chapters/edit', ['book' => $book, 'chapter' => $chapter, 'current' => $chapter]);
     }
 
@@ -136,7 +136,7 @@ class ChapterController extends Controller
         $book = $this->bookRepo->getBySlug($bookSlug);
         $chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id);
         $this->checkOwnablePermission('chapter-delete', $chapter);
-        $this->setPageTitle('Delete Chapter' . $chapter->getShortName());
+        $this->setPageTitle(trans('entities.chapters_delete_named', ['chapterName' => $chapter->getShortName()]));
         return view('chapters/delete', ['book' => $book, 'chapter' => $chapter, 'current' => $chapter]);
     }
 
@@ -166,6 +166,7 @@ class ChapterController extends Controller
     public function showMove($bookSlug, $chapterSlug) {
         $book = $this->bookRepo->getBySlug($bookSlug);
         $chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id);
+        $this->setPageTitle(trans('entities.chapters_move_named', ['chapterName' => $chapter->getShortName()]));
         $this->checkOwnablePermission('chapter-update', $chapter);
         return view('chapters/move', [
             'chapter' => $chapter,
@@ -202,13 +203,13 @@ class ChapterController extends Controller
         }
 
         if ($parent === false || $parent === null) {
-            session()->flash('The selected Book was not found');
+            session()->flash('error', trans('errors.selected_book_not_found'));
             return redirect()->back();
         }
 
         $this->chapterRepo->changeBook($parent->id, $chapter, true);
         Activity::add($chapter, 'chapter_move', $chapter->book->id);
-        session()->flash('success', sprintf('Chapter moved to "%s"', $parent->name));
+        session()->flash('success', trans('entities.chapter_move_success', ['bookName' => $parent->name]));
 
         return redirect($chapter->getUrl());
     }
@@ -244,7 +245,7 @@ class ChapterController extends Controller
         $chapter = $this->chapterRepo->getBySlug($chapterSlug, $book->id);
         $this->checkOwnablePermission('restrictions-manage', $chapter);
         $this->chapterRepo->updateEntityPermissionsFromRequest($request, $chapter);
-        session()->flash('success', 'Chapter Restrictions Updated');
+        session()->flash('success', trans('entities.chapters_permissions_success'));
         return redirect($chapter->getUrl());
     }
 }
index 621c23e85d576e1cf4a777c80eb07c1dc5b55ee6..f073bea0afbd7ea890fbaaee899e7597409cf669 100644 (file)
@@ -73,6 +73,7 @@ class ImageController extends Controller
      * @param $filter
      * @param int $page
      * @param Request $request
+     * @return \Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\JsonResponse|\Symfony\Component\HttpFoundation\Response
      */
     public function getGalleryFiltered($filter, $page = 0, Request $request)
     {
@@ -169,7 +170,7 @@ class ImageController extends Controller
         }
 
         $this->imageRepo->destroyImage($image);
-        return response()->json('Image Deleted');
+        return response()->json(trans('components.images_deleted'));
     }
 
 
index c2d8e257cb33297e28b49c448075017de8a0ad70..e40d7668a4fedd3fe46d747b3ab10e0830274a6f 100644 (file)
@@ -10,6 +10,7 @@ use BookStack\Http\Requests;
 use BookStack\Repos\BookRepo;
 use BookStack\Repos\ChapterRepo;
 use BookStack\Repos\PageRepo;
+use Illuminate\Http\Response;
 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 use Views;
 use GatherContent\Htmldiff\Htmldiff;
@@ -62,7 +63,7 @@ class PageController extends Controller
         }
 
         // Otherwise show edit view
-        $this->setPageTitle('Create New Page');
+        $this->setPageTitle(trans('entities.pages_new'));
         return view('pages/guest-create', ['parent' => $parent]);
     }
 
@@ -104,7 +105,7 @@ class PageController extends Controller
         $book = $this->bookRepo->getBySlug($bookSlug);
         $draft = $this->pageRepo->getById($pageId, true);
         $this->checkOwnablePermission('page-create', $book);
-        $this->setPageTitle('Edit Page Draft');
+        $this->setPageTitle(trans('entities.pages_edit_draft'));
 
         $draftsEnabled = $this->signedIn;
         return view('pages/edit', [
@@ -119,6 +120,7 @@ class PageController extends Controller
      * Store a new page by changing a draft into a page.
      * @param  Request $request
      * @param  string $bookSlug
+     * @param  int $pageId
      * @return Response
      */
     public function store(Request $request, $bookSlug, $pageId)
@@ -201,7 +203,7 @@ class PageController extends Controller
         $book = $this->bookRepo->getBySlug($bookSlug);
         $page = $this->pageRepo->getBySlug($pageSlug, $book->id);
         $this->checkOwnablePermission('page-update', $page);
-        $this->setPageTitle('Editing Page ' . $page->getShortName());
+        $this->setPageTitle(trans('entities.pages_editing_named', ['pageName'=>$page->getShortName()]));
         $page->isDraft = false;
 
         // Check for active editing
@@ -265,7 +267,7 @@ class PageController extends Controller
         if (!$this->signedIn) {
             return response()->json([
                 'status' => 'error',
-                'message' => 'Guests cannot save drafts',
+                'message' => trans('errors.guests_cannot_save_drafts'),
             ], 500);
         }
 
@@ -279,7 +281,7 @@ class PageController extends Controller
         $utcUpdateTimestamp = $updateTime + Carbon::createFromTimestamp(0)->offset;
         return response()->json([
             'status'    => 'success',
-            'message'   => 'Draft saved at ',
+            'message'   => trans('entities.pages_edit_draft_save_at'),
             'timestamp' => $utcUpdateTimestamp
         ]);
     }
@@ -307,7 +309,7 @@ class PageController extends Controller
         $book = $this->bookRepo->getBySlug($bookSlug);
         $page = $this->pageRepo->getBySlug($pageSlug, $book->id);
         $this->checkOwnablePermission('page-delete', $page);
-        $this->setPageTitle('Delete Page ' . $page->getShortName());
+        $this->setPageTitle(trans('entities.pages_delete_named', ['pageName'=>$page->getShortName()]));
         return view('pages/delete', ['book' => $book, 'page' => $page, 'current' => $page]);
     }
 
@@ -324,7 +326,7 @@ class PageController extends Controller
         $book = $this->bookRepo->getBySlug($bookSlug);
         $page = $this->pageRepo->getById($pageId, true);
         $this->checkOwnablePermission('page-update', $page);
-        $this->setPageTitle('Delete Draft Page ' . $page->getShortName());
+        $this->setPageTitle(trans('entities.pages_delete_draft_named', ['pageName'=>$page->getShortName()]));
         return view('pages/delete', ['book' => $book, 'page' => $page, 'current' => $page]);
     }
 
@@ -341,7 +343,7 @@ class PageController extends Controller
         $page = $this->pageRepo->getBySlug($pageSlug, $book->id);
         $this->checkOwnablePermission('page-delete', $page);
         Activity::addMessage('page_delete', $book->id, $page->name);
-        session()->flash('success', 'Page deleted');
+        session()->flash('success', trans('entities.pages_delete_success'));
         $this->pageRepo->destroy($page);
         return redirect($book->getUrl());
     }
@@ -358,7 +360,7 @@ class PageController extends Controller
         $book = $this->bookRepo->getBySlug($bookSlug);
         $page = $this->pageRepo->getById($pageId, true);
         $this->checkOwnablePermission('page-update', $page);
-        session()->flash('success', 'Draft deleted');
+        session()->flash('success', trans('entities.pages_delete_draft_success'));
         $this->pageRepo->destroy($page);
         return redirect($book->getUrl());
     }
@@ -373,7 +375,7 @@ class PageController extends Controller
     {
         $book = $this->bookRepo->getBySlug($bookSlug);
         $page = $this->pageRepo->getBySlug($pageSlug, $book->id);
-        $this->setPageTitle('Revisions For ' . $page->getShortName());
+        $this->setPageTitle(trans('entities.pages_revisions_named', ['pageName'=>$page->getShortName()]));
         return view('pages/revisions', ['page' => $page, 'book' => $book, 'current' => $page]);
     }
 
@@ -391,7 +393,7 @@ class PageController extends Controller
         $revision = $this->pageRepo->getRevisionById($revisionId);
 
         $page->fill($revision->toArray());
-        $this->setPageTitle('Page Revision For ' . $page->getShortName());
+        $this->setPageTitle(trans('entities.pages_revision_named', ['pageName'=>$page->getShortName()]));
         
         return view('pages/revision', [
             'page' => $page,
@@ -417,7 +419,7 @@ class PageController extends Controller
         $diff = (new Htmldiff)->diff($prevContent, $revision->html);
 
         $page->fill($revision->toArray());
-        $this->setPageTitle('Page Revision For ' . $page->getShortName());
+        $this->setPageTitle(trans('entities.pages_revision_named', ['pageName'=>$page->getShortName()]));
 
         return view('pages/revision', [
             'page' => $page,
@@ -503,7 +505,7 @@ class PageController extends Controller
     {
         $pages = $this->pageRepo->getRecentlyCreatedPaginated(20)->setPath(baseUrl('/pages/recently-created'));
         return view('pages/detailed-listing', [
-            'title' => 'Recently Created Pages',
+            'title' => trans('entities.recently_created_pages'),
             'pages' => $pages
         ]);
     }
@@ -516,7 +518,7 @@ class PageController extends Controller
     {
         $pages = $this->pageRepo->getRecentlyUpdatedPaginated(20)->setPath(baseUrl('/pages/recently-updated'));
         return view('pages/detailed-listing', [
-            'title' => 'Recently Updated Pages',
+            'title' => trans('entities.recently_updated_pages'),
             'pages' => $pages
         ]);
     }
@@ -589,13 +591,13 @@ class PageController extends Controller
         }
 
         if ($parent === false || $parent === null) {
-            session()->flash('The selected Book or Chapter was not found');
+            session()->flash(trans('entities.selected_book_chapter_not_found'));
             return redirect()->back();
         }
 
         $this->pageRepo->changePageParent($page, $parent);
         Activity::add($page, 'page_move', $page->book->id);
-        session()->flash('success', sprintf('Page moved to "%s"', $parent->name));
+        session()->flash('success', trans('entities.pages_move_success', ['parentName' => $parent->name]));
 
         return redirect($page->getUrl());
     }
@@ -613,7 +615,7 @@ class PageController extends Controller
         $page = $this->pageRepo->getBySlug($pageSlug, $book->id);
         $this->checkOwnablePermission('restrictions-manage', $page);
         $this->pageRepo->updateEntityPermissionsFromRequest($request, $page);
-        session()->flash('success', 'Page Permissions Updated');
+        session()->flash('success', trans('entities.pages_permissions_success'));
         return redirect($page->getUrl());
     }
 
index ed430c0b7194e09717e3b4d9aeb06f14aad4ad9d..cd064e7e80675e47188d0b02644926f94cfb8769 100644 (file)
@@ -2,9 +2,7 @@
 
 use BookStack\Exceptions\PermissionsException;
 use BookStack\Repos\PermissionsRepo;
-use BookStack\Services\PermissionService;
 use Illuminate\Http\Request;
-use BookStack\Http\Requests;
 
 class PermissionController extends Controller
 {
@@ -55,7 +53,7 @@ class PermissionController extends Controller
         ]);
 
         $this->permissionsRepo->saveNewRole($request->all());
-        session()->flash('success', 'Role successfully created');
+        session()->flash('success', trans('settings.role_create_success'));
         return redirect('/settings/roles');
     }
 
@@ -69,7 +67,7 @@ class PermissionController extends Controller
     {
         $this->checkPermission('user-roles-manage');
         $role = $this->permissionsRepo->getRoleById($id);
-        if ($role->hidden) throw new PermissionsException('This role cannot be edited');
+        if ($role->hidden) throw new PermissionsException(trans('errors.role_cannot_be_edited'));
         return view('settings/roles/edit', ['role' => $role]);
     }
 
@@ -88,7 +86,7 @@ class PermissionController extends Controller
         ]);
 
         $this->permissionsRepo->updateRole($id, $request->all());
-        session()->flash('success', 'Role successfully updated');
+        session()->flash('success', trans('settings.role_update_success'));
         return redirect('/settings/roles');
     }
 
@@ -103,7 +101,7 @@ class PermissionController extends Controller
         $this->checkPermission('user-roles-manage');
         $role = $this->permissionsRepo->getRoleById($id);
         $roles = $this->permissionsRepo->getAllRolesExcept($role);
-        $blankRole = $role->newInstance(['display_name' => 'Don\'t migrate users']);
+        $blankRole = $role->newInstance(['display_name' => trans('settings.role_delete_no_migration')]);
         $roles->prepend($blankRole);
         return view('settings/roles/delete', ['role' => $role, 'roles' => $roles]);
     }
@@ -126,7 +124,7 @@ class PermissionController extends Controller
             return redirect()->back();
         }
 
-        session()->flash('success', 'Role successfully deleted');
+        session()->flash('success', trans('settings.role_delete_success'));
         return redirect('/settings/roles');
     }
 }
index 58ad737c4b431afa7cc5f982d4ec5fc9ffc6211c..bb70b0f88cbc9e6ad07141cd49c51127af70c080 100644 (file)
@@ -1,11 +1,7 @@
-<?php
-
-namespace BookStack\Http\Controllers;
+<?php namespace BookStack\Http\Controllers;
 
 use BookStack\Services\ViewService;
 use Illuminate\Http\Request;
-
-use BookStack\Http\Requests;
 use BookStack\Repos\BookRepo;
 use BookStack\Repos\ChapterRepo;
 use BookStack\Repos\PageRepo;
@@ -49,7 +45,7 @@ class SearchController extends Controller
         $pages = $this->pageRepo->getBySearch($searchTerm, [], 20, $paginationAppends);
         $books = $this->bookRepo->getBySearch($searchTerm, 10, $paginationAppends);
         $chapters = $this->chapterRepo->getBySearch($searchTerm, [], 10, $paginationAppends);
-        $this->setPageTitle('Search For ' . $searchTerm);
+        $this->setPageTitle(trans('entities.search_for_term', ['term' => $searchTerm]));
         return view('search/all', [
             'pages'      => $pages,
             'books'      => $books,
@@ -70,10 +66,10 @@ class SearchController extends Controller
         $searchTerm = $request->get('term');
         $paginationAppends = $request->only('term');
         $pages = $this->pageRepo->getBySearch($searchTerm, [], 20, $paginationAppends);
-        $this->setPageTitle('Page Search For ' . $searchTerm);
+        $this->setPageTitle(trans('entities.search_page_for_term', ['term' => $searchTerm]));
         return view('search/entity-search-list', [
             'entities'   => $pages,
-            'title'      => 'Page Search Results',
+            'title'      => trans('entities.search_results_page'),
             'searchTerm' => $searchTerm
         ]);
     }
@@ -90,10 +86,10 @@ class SearchController extends Controller
         $searchTerm = $request->get('term');
         $paginationAppends = $request->only('term');
         $chapters = $this->chapterRepo->getBySearch($searchTerm, [], 20, $paginationAppends);
-        $this->setPageTitle('Chapter Search For ' . $searchTerm);
+        $this->setPageTitle(trans('entities.search_chapter_for_term', ['term' => $searchTerm]));
         return view('search/entity-search-list', [
             'entities'   => $chapters,
-            'title'      => 'Chapter Search Results',
+            'title'      => trans('entities.search_results_chapter'),
             'searchTerm' => $searchTerm
         ]);
     }
@@ -110,10 +106,10 @@ class SearchController extends Controller
         $searchTerm = $request->get('term');
         $paginationAppends = $request->only('term');
         $books = $this->bookRepo->getBySearch($searchTerm, 20, $paginationAppends);
-        $this->setPageTitle('Book Search For ' . $searchTerm);
+        $this->setPageTitle(trans('entities.search_book_for_term', ['term' => $searchTerm]));
         return view('search/entity-search-list', [
             'entities'   => $books,
-            'title'      => 'Book Search Results',
+            'title'      => trans('entities.search_results_book'),
             'searchTerm' => $searchTerm
         ]);
     }
index 65135eda3816079eea164c229acd89d9e57fe9ad..70a12631a2929d43424149208a79350697caaa4b 100644 (file)
@@ -1,8 +1,7 @@
 <?php namespace BookStack\Http\Controllers;
 
 use Illuminate\Http\Request;
-
-use BookStack\Http\Requests;
+use Illuminate\Http\Response;
 use Setting;
 
 class SettingController extends Controller
@@ -39,7 +38,7 @@ class SettingController extends Controller
             Setting::put($key, $value);
         }
 
-        session()->flash('success', 'Settings Saved');
+        session()->flash('success', trans('settings.settings_save_success'));
         return redirect('/settings');
     }
 
index c8a35654108ca6bde5d3429515711d702342b8e2..24bdcdb1c1af2e173684215806c1fef5138b10b6 100644 (file)
@@ -2,7 +2,6 @@
 
 use BookStack\Repos\TagRepo;
 use Illuminate\Http\Request;
-use BookStack\Http\Requests;
 
 class TagController extends Controller
 {
@@ -16,12 +15,14 @@ class TagController extends Controller
     public function __construct(TagRepo $tagRepo)
     {
         $this->tagRepo = $tagRepo;
+        parent::__construct();
     }
 
     /**
      * Get all the Tags for a particular entity
      * @param $entityType
      * @param $entityId
+     * @return \Illuminate\Http\JsonResponse
      */
     public function getForEntity($entityType, $entityId)
     {
@@ -29,29 +30,10 @@ class TagController extends Controller
         return response()->json($tags);
     }
 
-    /**
-     * Update the tags for a particular entity.
-     * @param $entityType
-     * @param $entityId
-     * @param Request $request
-     * @return mixed
-     */
-    public function updateForEntity($entityType, $entityId, Request $request)
-    {
-        $entity = $this->tagRepo->getEntity($entityType, $entityId, 'update');
-        if ($entity === null) return $this->jsonError("Entity not found", 404);
-
-        $inputTags = $request->input('tags');
-        $tags = $this->tagRepo->saveTagsToEntity($entity, $inputTags);
-        return response()->json([
-            'tags' => $tags,
-            'message' => 'Tags successfully updated'
-        ]);
-    }
-
     /**
      * Get tag name suggestions from a given search term.
      * @param Request $request
+     * @return \Illuminate\Http\JsonResponse
      */
     public function getNameSuggestions(Request $request)
     {
@@ -63,6 +45,7 @@ class TagController extends Controller
     /**
      * Get tag value suggestions from a given search term.
      * @param Request $request
+     * @return \Illuminate\Http\JsonResponse
      */
     public function getValueSuggestions(Request $request)
     {
index 18ef1a671844fc4943e7df9673f62de42bcc5cea..b5184c40acace93088c439b0b2eb3383ef4e8a56 100644 (file)
@@ -44,7 +44,7 @@ class UserController extends Controller
             'sort' => $request->has('sort') ? $request->get('sort') : 'name',
         ];
         $users = $this->userRepo->getAllUsersPaginatedAndSorted(20, $listDetails);
-        $this->setPageTitle('Users');
+        $this->setPageTitle(trans('settings.users'));
         $users->appends($listDetails);
         return view('users/index', ['users' => $users, 'listDetails' => $listDetails]);
     }
@@ -83,7 +83,6 @@ class UserController extends Controller
         }
         $this->validate($request, $validationRules);
 
-
         $user = $this->user->fill($request->all());
 
         if ($authMethod === 'standard') {
@@ -131,7 +130,7 @@ class UserController extends Controller
         $authMethod = ($user->system_name) ? 'system' : config('auth.method');
 
         $activeSocialDrivers = $socialAuthService->getActiveDrivers();
-        $this->setPageTitle('User Profile');
+        $this->setPageTitle(trans('settings.user_profile'));
         $roles = $this->userRepo->getAllRoles();
         return view('users/edit', ['user' => $user, 'activeSocialDrivers' => $activeSocialDrivers, 'authMethod' => $authMethod, 'roles' => $roles]);
     }
@@ -154,8 +153,6 @@ class UserController extends Controller
             'email'            => 'min:2|email|unique:users,email,' . $id,
             'password'         => 'min:5|required_with:password_confirm',
             'password-confirm' => 'same:password|required_with:password'
-        ], [
-            'password-confirm.required_with' => 'Password confirmation required'
         ]);
 
         $user = $this->user->findOrFail($id);
@@ -179,7 +176,7 @@ class UserController extends Controller
         }
 
         $user->save();
-        session()->flash('success', 'User successfully updated');
+        session()->flash('success', trans('settings.users_edit_success'));
 
         $redirectUrl = userCan('users-manage') ? '/settings/users' : '/settings/users/' . $user->id;
         return redirect($redirectUrl);
@@ -197,7 +194,7 @@ class UserController extends Controller
         });
 
         $user = $this->user->findOrFail($id);
-        $this->setPageTitle('Delete User ' . $user->name);
+        $this->setPageTitle(trans('settings.users_delete_named', ['userName' => $user->name]));
         return view('users/delete', ['user' => $user]);
     }
 
@@ -216,17 +213,17 @@ class UserController extends Controller
         $user = $this->userRepo->getById($id);
 
         if ($this->userRepo->isOnlyAdmin($user)) {
-            session()->flash('error', 'You cannot delete the only admin');
+            session()->flash('error', trans('errors.users_cannot_delete_only_admin'));
             return redirect($user->getEditUrl());
         }
 
         if ($user->system_name === 'public') {
-            session()->flash('error', 'You cannot delete the guest user');
+            session()->flash('error', trans('errors.users_cannot_delete_guest'));
             return redirect($user->getEditUrl());
         }
 
         $this->userRepo->destroy($user);
-        session()->flash('success', 'User successfully removed');
+        session()->flash('success', trans('settings.users_delete_success'));
 
         return redirect('/settings/users');
     }
index 7bb91f4723d84efe49d01897e5f3766520554a1b..b14cf0dabc205e24979e911b69df89fc9a000f88 100644 (file)
@@ -109,7 +109,7 @@ class BookRepo extends EntityRepo
     public function getBySlug($slug)
     {
         $book = $this->bookQuery()->where('slug', '=', $slug)->first();
-        if ($book === null) throw new NotFoundException('Book not found');
+        if ($book === null) throw new NotFoundException(trans('errors.book_not_found'));
         return $book;
     }
 
index 4c13b9aafd3c4c95d0c13367261629e43329cd3e..4106f93ee32e27ee7f3bfde0b759b11c02014a08 100644 (file)
@@ -69,7 +69,7 @@ class ChapterRepo extends EntityRepo
     public function getBySlug($slug, $bookId)
     {
         $chapter = $this->chapterQuery()->where('slug', '=', $slug)->where('book_id', '=', $bookId)->first();
-        if ($chapter === null) throw new NotFoundException('Chapter not found');
+        if ($chapter === null) throw new NotFoundException(trans('errors.chapter_not_found'));
         return $chapter;
     }
 
index e6d713f77c591f3451c38ff777d5060974946292..14463c12d191c8473ac26e7938ee0420c605cc21 100644 (file)
@@ -66,7 +66,7 @@ class PageRepo extends EntityRepo
     public function getBySlug($slug, $bookId)
     {
         $page = $this->pageQuery()->where('slug', '=', $slug)->where('book_id', '=', $bookId)->first();
-        if ($page === null) throw new NotFoundException('Page not found');
+        if ($page === null) throw new NotFoundException(trans('errors.page_not_found'));
         return $page;
     }
 
@@ -134,7 +134,7 @@ class PageRepo extends EntityRepo
         $draftPage->draft = false;
 
         $draftPage->save();
-        $this->saveRevision($draftPage, 'Initial Publish');
+        $this->saveRevision($draftPage, trans('entities.pages_initial_revision'));
         
         return $draftPage;
     }
@@ -143,12 +143,12 @@ class PageRepo extends EntityRepo
      * Get a new draft page instance.
      * @param Book $book
      * @param Chapter|bool $chapter
-     * @return static
+     * @return Page
      */
     public function getDraftPage(Book $book, $chapter = false)
     {
         $page = $this->page->newInstance();
-        $page->name = 'New Page';
+        $page->name = trans('entities.pages_initial_name');
         $page->created_by = user()->id;
         $page->updated_by = user()->id;
         $page->draft = true;
@@ -487,11 +487,9 @@ class PageRepo extends EntityRepo
      */
     public function getUserPageDraftMessage(PageRevision $draft)
     {
-        $message = 'You are currently editing a draft that was last saved ' . $draft->updated_at->diffForHumans() . '.';
-        if ($draft->page->updated_at->timestamp > $draft->updated_at->timestamp) {
-            $message .= "\n This page has been updated by since that time. It is recommended that you discard this draft.";
-        }
-        return $message;
+        $message = trans('entities.pages_editing_draft_notification', ['timeDiff' => $draft->updated_at->diffForHumans()]);
+        if ($draft->page->updated_at->timestamp <= $draft->updated_at->timestamp) return $message;
+        return $message . "\n" . trans('entities.pages_draft_edited_notification');
     }
 
     /**
@@ -519,10 +517,10 @@ class PageRepo extends EntityRepo
     public function getPageEditingActiveMessage(Page $page, $minRange = null)
     {
         $pageDraftEdits = $this->activePageEditingQuery($page, $minRange)->get();
-        $userMessage = $pageDraftEdits->count() > 1 ? $pageDraftEdits->count() . ' users have' : $pageDraftEdits->first()->createdBy->name . ' has';
-        $timeMessage = $minRange === null ? 'since the page was last updated' : 'in the last ' . $minRange . ' minutes';
-        $message = '%s started editing this page %s. Take care not to overwrite each other\'s updates!';
-        return sprintf($message, $userMessage, $timeMessage);
+
+        $userMessage = $pageDraftEdits->count() > 1 ? trans('entities.pages_draft_edit_active.start_a', ['count' => $pageDraftEdits->count()]): trans('entities.pages_draft_edit_active.start_b', ['userName' => $pageDraftEdits->first()->createdBy->name]);
+        $timeMessage = $minRange === null ? trans('entities.pages_draft_edit_active.time_a') : trans('entities.pages_draft_edit_active.time_b', ['minCount'=>$minRange]);
+        return trans('entities.pages_draft_edit_active.message', ['start' => $userMessage, 'time' => $timeMessage]);
     }
 
     /**
index 24497c91135fa036825bcb180e88df65ba099727..e1c6d87b12f3551ea28f2f0b4001c3ae222329e3 100644 (file)
@@ -133,9 +133,9 @@ class PermissionsRepo
 
         // Prevent deleting admin role or default registration role.
         if ($role->system_name && in_array($role->system_name, $this->systemRoles)) {
-            throw new PermissionsException('This role is a system role and cannot be deleted');
+            throw new PermissionsException(trans('errors.role_system_cannot_be_deleted'));
         } else if ($role->id == setting('registration-role')) {
-            throw new PermissionsException('This role cannot be deleted while set as the default registration role.');
+            throw new PermissionsException(trans('errors.role_registration_default_cannot_delete'));
         }
 
         if ($migrateRoleId) {
index 6d0857f8b234ead8a7b3cb0fbf4f34871f5ca4b6..6e422c4f476ae1de9601357d6f4a496528514d1f 100644 (file)
@@ -121,7 +121,7 @@ class TagRepo
     /**
      * Create a new Tag instance from user input.
      * @param $input
-     * @return static
+     * @return Tag
      */
     protected function newInstanceFromInput($input)
     {
index ab3716fca027b857de43f239691b931f6cb95b05..22c92f3cea1b8e16f18244eb417be8b040deeaf3 100644 (file)
@@ -3,7 +3,6 @@
 use BookStack\Role;
 use BookStack\User;
 use Exception;
-use Setting;
 
 class UserRepo
 {
index e0ee3a04d727fdf15f1215278518ad591cb34851..592d67e63b5f11ffbe8edc911dc7940a1e715373 100644 (file)
@@ -193,7 +193,7 @@ class AttachmentService extends UploadService
         try {
             $storage->put($attachmentStoragePath, $attachmentData);
         } catch (Exception $e) {
-            throw new FileUploadException('File path ' . $attachmentStoragePath . ' could not be uploaded to. Ensure it is writable to the server.');
+            throw new FileUploadException(trans('errors.path_not_writable', ['filePath' => $attachmentStoragePath]));
         }
         return $attachmentPath;
     }
index d4ec1e9760242a4b10b889c506a8690633eebfe0..8eb52708c9f567bbfafa57be73d7709b2c65a238 100644 (file)
@@ -33,7 +33,7 @@ class EmailConfirmationService
     public function sendConfirmation(User $user)
     {
         if ($user->email_confirmed) {
-            throw new ConfirmationEmailException('Email has already been confirmed, Try logging in.', '/login');
+            throw new ConfirmationEmailException(trans('errors.email_already_confirmed'), '/login');
         }
 
         $this->deleteConfirmationsByUser($user);
@@ -63,7 +63,7 @@ class EmailConfirmationService
      * Gets an email confirmation by looking up the token,
      * Ensures the token has not expired.
      * @param string $token
-     * @return EmailConfirmation
+     * @return array|null|\stdClass
      * @throws UserRegistrationException
      */
     public function getEmailConfirmationFromToken($token)
@@ -72,14 +72,14 @@ class EmailConfirmationService
 
         // If not found show error
         if ($emailConfirmation === null) {
-            throw new UserRegistrationException('This confirmation token is not valid or has already been used, Please try registering again.', '/register');
+            throw new UserRegistrationException(trans('errors.email_confirmation_invalid'), '/register');
         }
 
         // If more than a day old
         if (Carbon::now()->subDay()->gt(new Carbon($emailConfirmation->created_at))) {
             $user = $this->users->getById($emailConfirmation->user_id);
             $this->sendConfirmation($user);
-            throw new UserRegistrationException('The confirmation token has expired, A new confirmation email has been sent.', '/register/confirm');
+            throw new UserRegistrationException(trans('errors.email_confirmation_expired'), '/register/confirm');
         }
 
         $emailConfirmation->user = $this->users->getById($emailConfirmation->user_id);
index dfe2cf453705e07a7b311b73b0f2bffaa28bfb6a..e34b3fb2b7fb0d6a9db780badd849e6738ee7845 100644 (file)
@@ -59,7 +59,7 @@ class ImageService extends UploadService
     {
         $imageName = $imageName ? $imageName : basename($url);
         $imageData = file_get_contents($url);
-        if($imageData === false) throw new \Exception('Cannot get image from ' . $url);
+        if($imageData === false) throw new \Exception(trans('errors.cannot_get_image_from_url', ['url' => $url]));
         return $this->saveNew($imageName, $imageData, $type);
     }
 
@@ -93,7 +93,7 @@ class ImageService extends UploadService
             $storage->put($fullPath, $imageData);
             $storage->setVisibility($fullPath, 'public');
         } catch (Exception $e) {
-            throw new ImageUploadException('Image Path ' . $fullPath . ' is not writable by the server.');
+            throw new ImageUploadException(trans('errors.path_not_writable', ['filePath' => $fullPath]));
         }
 
         if ($this->isLocal()) $fullPath = str_replace_first('/public', '', $fullPath);
@@ -160,7 +160,7 @@ class ImageService extends UploadService
             $thumb = $this->imageTool->make($storage->get($imagePath));
         } catch (Exception $e) {
             if ($e instanceof \ErrorException || $e instanceof NotSupportedException) {
-                throw new ImageUploadException('The server cannot create thumbnails. Please check you have the GD PHP extension installed.');
+                throw new ImageUploadException(trans('errors.cannot_create_thumbs'));
             } else {
                 throw $e;
             }
index b7f101ad2c3a9088357941df9c042eb973081dcb..40b24f1419c06e60cc372dae0b57fd1e621fe70a 100644 (file)
@@ -94,7 +94,7 @@ class LdapService
             $ldapBind = $this->ldap->bind($connection, $ldapDn, $ldapPass);
         }
 
-        if (!$ldapBind) throw new LdapException('LDAP access failed using ' . ($isAnonymous ? ' anonymous bind.' : ' given dn & pass details'));
+        if (!$ldapBind) throw new LdapException(($isAnonymous ? trans('errors.ldap_fail_anonymous') : trans('errors.ldap_fail_authed')));
     }
 
     /**
@@ -109,7 +109,7 @@ class LdapService
 
         // Check LDAP extension in installed
         if (!function_exists('ldap_connect') && config('app.env') !== 'testing') {
-            throw new LdapException('LDAP PHP extension not installed');
+            throw new LdapException(trans('errors.ldap_extension_not_installed'));
         }
 
         // Get port from server string if specified.
@@ -117,7 +117,7 @@ class LdapService
         $ldapConnection = $this->ldap->connect($ldapServer[0], count($ldapServer) > 1 ? $ldapServer[1] : 389);
 
         if ($ldapConnection === false) {
-            throw new LdapException('Cannot connect to ldap server, Initial connection failed');
+            throw new LdapException(trans('errors.ldap_cannot_connect'));
         }
 
         // Set any required options
index d76a7231b8049396c1be994a16eea4b5c7500fb6..fe554b8d7e7b938f1ed3282f47db4771fb8b161a 100644 (file)
@@ -70,12 +70,12 @@ class SocialAuthService
 
         // Check social account has not already been used
         if ($this->socialAccount->where('driver_id', '=', $socialUser->getId())->exists()) {
-            throw new UserRegistrationException('This ' . $socialDriver . ' account is already in use, Try logging in via the ' . $socialDriver . ' option.', '/login');
+            throw new UserRegistrationException(trans('errors.social_account_in_use', ['socialAccount'=>$socialDriver]), '/login');
         }
 
         if ($this->userRepo->getByEmail($socialUser->getEmail())) {
             $email = $socialUser->getEmail();
-            throw new UserRegistrationException('The email ' . $email . ' is already in use. If you already have an account you can connect your ' . $socialDriver . ' account from your profile settings.', '/login');
+            throw new UserRegistrationException(trans('errors.social_account_in_use', ['socialAccount'=>$socialDriver, 'email' => $email]), '/login');
         }
 
         return $socialUser;
@@ -113,27 +113,26 @@ class SocialAuthService
         if ($isLoggedIn && $socialAccount === null) {
             $this->fillSocialAccount($socialDriver, $socialUser);
             $currentUser->socialAccounts()->save($this->socialAccount);
-            session()->flash('success', title_case($socialDriver) . ' account was successfully attached to your profile.');
+            session()->flash('success', trans('settings.users_social_connected', ['socialAccount' => title_case($socialDriver)]));
             return redirect($currentUser->getEditUrl());
         }
 
         // When a user is logged in and the social account exists and is already linked to the current user.
         if ($isLoggedIn && $socialAccount !== null && $socialAccount->user->id === $currentUser->id) {
-            session()->flash('error', 'This ' . title_case($socialDriver) . ' account is already attached to your profile.');
+            session()->flash('error', trans('errors.social_account_existing', ['socialAccount' => title_case($socialDriver)]));
             return redirect($currentUser->getEditUrl());
         }
 
         // When a user is logged in, A social account exists but the users do not match.
-        // Change the user that the social account is assigned to.
         if ($isLoggedIn && $socialAccount !== null && $socialAccount->user->id != $currentUser->id) {
-            session()->flash('success', 'This ' . title_case($socialDriver) . ' account is already used by another user.');
+            session()->flash('error', trans('errors.social_account_already_used_existing', ['socialAccount' => title_case($socialDriver)]));
             return redirect($currentUser->getEditUrl());
         }
 
         // Otherwise let the user know this social account is not used by anyone.
-        $message = 'This ' . $socialDriver . ' account is not linked to any users. Please attach it in your profile settings';
+        $message = trans('errors.social_account_not_used', ['socialAccount' => title_case($socialDriver)]);
         if (setting('registration-enabled')) {
-            $message .= ' or, If you do not yet have an account, You can register an account using the ' . $socialDriver . ' option';
+            $message .= trans('errors.social_account_register_instructions', ['socialAccount' => title_case($socialDriver)]);
         }
         
         throw new SocialSignInException($message . '.', '/login');
@@ -157,8 +156,8 @@ class SocialAuthService
     {
         $driver = trim(strtolower($socialDriver));
 
-        if (!in_array($driver, $this->validSocialDrivers)) abort(404, 'Social Driver Not Found');
-        if (!$this->checkDriverConfigured($driver)) throw new SocialDriverNotConfigured("Your {$driver} social settings are not configured correctly.");
+        if (!in_array($driver, $this->validSocialDrivers)) abort(404, trans('errors.social_driver_not_found'));
+        if (!$this->checkDriverConfigured($driver)) throw new SocialDriverNotConfigured(trans('errors.social_driver_not_configured', ['socialAccount' => title_case($socialDriver)]));
 
         return $driver;
     }
@@ -215,7 +214,7 @@ class SocialAuthService
     {
         session();
         user()->socialAccounts()->where('driver', '=', $socialDriver)->delete();
-        session()->flash('success', title_case($socialDriver) . ' account successfully detached');
+        session()->flash('success', trans('settings.users_social_disconnected', ['socialAccount' => title_case($socialDriver)]));
         return redirect(user()->getEditUrl());
     }
 
index 9d7f7ad706d1037eef8beee41c075a6ce1fc0b45..1b5bef797f89ad934318d94e216658887179f808 100644 (file)
@@ -505,20 +505,6 @@ export default function (ngApp, events) {
                 }
             };
 
-            /**
-             * Save the tags to the current page.
-             */
-            $scope.saveTags = function() {
-                setTagOrder();
-                let postData = {tags: $scope.tags};
-                let url = window.baseUrl('/ajax/tags/update/page/' + pageId);
-                $http.post(url, postData).then((responseData) => {
-                    $scope.tags = responseData.data.tags;
-                    addEmptyTag();
-                    events.emit('success', responseData.data.message);
-                })
-            };
-
             /**
              * Remove a tag from the current list.
              * @param tag
index 3762905b96f4ce358412c285225bc7486e65b146..b734828fc7d617675da040d25c954277f0139f4e 100644 (file)
@@ -36,6 +36,10 @@ return [
 
     'register_thanks' => 'Thanks for registering!',
     'register_confirm' => 'Please check your email and click the confirmation button to access :appName.',
+    'registrations_disabled' => 'Registrations are currently disabled',
+    'registration_email_domain_invalid' => 'That email domain does not have access to this application',
+    'register_success' => 'Thanks for signing up! You are now registered and signed in.',
+
 
     /**
      * Password Reset
@@ -43,11 +47,14 @@ return [
     'reset_password' => 'Reset Password',
     'reset_password_send_instructions' => 'Enter your email below and you will be sent an email with a password reset link.',
     'reset_password_send_button' => 'Send Reset Link',
+    'reset_password_sent_success' => 'A password reset link has been sent to :email.',
+    'reset_password_success' => 'Your password has been successfully reset.',
 
     'email_reset_subject' => 'Reset your :appName password',
     'email_reset_text' => 'You are receiving this email because we received a password reset request for your account.',
     'email_reset_not_requested' => 'If you did not request a password reset, no further action is required.',
 
+
     /**
      * Email Confirmation
      */
index e6648fbcdeb9fc2d87ecbde3b3282f8559728753..674ed32dc0fba0d76d6cebe9bf776bbc73443364 100644 (file)
@@ -26,6 +26,8 @@ return [
     'create' => 'Create',
     'update' => 'Update',
     'edit' => 'Edit',
+    'sort' => 'Sort',
+    'move' => 'Move',
     'delete' => 'Delete',
     'search' => 'Search',
     'search_clear' => 'Clear Search',
index 2b4796179b7b5253816ace05389ac44312ead8b9..9fe277059583731cc7f7ad7ecf689ab1d386512a 100644 (file)
@@ -14,5 +14,6 @@ return [
     'imagem_load_more' => 'Load More',
     'imagem_image_name' => 'Image Name',
     'imagem_delete_confirm' => 'This image is used in the pages below, Click delete again to confirm you want to delete this image.',
-    'imagem_select_image' => 'Select Image'
+    'imagem_select_image' => 'Select Image',
+    'images_deleted' => 'Images Deleted',
 ];
\ No newline at end of file
index b2fb23d0edfc4e3700c50b9f8bd72ebddbaea6d9..855cea20c223381fbc8def4a8503d8786f3dea39 100644 (file)
@@ -13,10 +13,6 @@ return [
     'recently_viewed' => 'Recently Viewed',
     'recent_activity' => 'Recent Activity',
     'create_now' => 'Create one now',
-    'edit' => 'Edit',
-    'sort' => 'Sort',
-    'move' => 'Move',
-    'delete' => 'Delete',
     'revisions' => 'Revisions',
     'meta_created' => 'Created :timeLength',
     'meta_created_name' => 'Created :timeLength by :user',
@@ -43,11 +39,18 @@ return [
      * Search
      */
     'search_results' => 'Search Results',
+    'search_results_page' => 'Page Search Results',
+    'search_results_chapter' => 'Chapter Search Results',
+    'search_results_book' => 'Book Search Results',
     'search_clear' => 'Clear Search',
     'search_view_pages' => 'View all matches pages',
     'search_view_chapters' => 'View all matches chapters',
     'search_view_books' => 'View all matches books',
     'search_no_pages' => 'No pages matched this search',
+    'search_for_term' => 'Search for :term',
+    'search_page_for_term' => 'Page search for :term',
+    'search_chapter_for_term' => 'Chapter search for :term',
+    'search_book_for_term' => 'Books search for :term',
 
     /**
      * Books
@@ -60,12 +63,15 @@ return [
     'books_popular_empty' => 'The most popular books will appear here.',
     'books_create' => 'Create New Book',
     'books_delete' => 'Delete Book',
+    'books_delete_named' => 'Delete Book :bookName',
     'books_delete_explain' => 'This will delete the book with the name \':bookName\', All pages and chapters will be removed.',
     'books_delete_confirmation' => 'Are you sure you want to delete this book?',
     'books_edit' => 'Edit Book',
+    'books_edit_named' => 'Edit Book :bookName',
     'books_form_book_name' => 'Book Name',
     'books_save' => 'Save Book',
     'books_permissions' => 'Book Permissions',
+    'books_permissions_updated' => 'Book Permissions Updated',
     'books_empty_contents' => 'No pages or chapters have been created for this book.',
     'books_empty_create_page' => 'Create a new page',
     'books_empty_or' => 'or',
@@ -75,6 +81,7 @@ return [
     'books_search_this' => 'Search this book',
     'books_navigation' => 'Book Navigation',
     'books_sort' => 'Sort Book Contents',
+    'books_sort_named' => 'Sort Book :bookName',
     'books_sort_show_other' => 'Show Other Books',
     'books_sort_save' => 'Save New Order',
 
@@ -86,15 +93,20 @@ return [
     'chapters_new' => 'New Chapter',
     'chapters_create' => 'Create New Chapter',
     'chapters_delete' => 'Delete Chapter',
+    'chapters_delete_named' => 'Delete Chapter :chapterName',
     'chapters_delete_explain' => 'This will delete the chapter with the name \':chapterName\', All pages will be removed
         and added directly to the parent book.',
     'chapters_delete_confirm' => 'Are you sure you want to delete this chapter?',
     'chapters_edit' => 'Edit Chapter',
+    'chapters_edit_named' => 'Edit Chapter :chapterName',
     'chapters_save' => 'Save Chapter',
     'chapters_move' => 'Move Chapter',
+    'chapters_move_named' => 'Move Chapter :chapterName',
+    'chapter_move_success' => 'Chapter moved to :bookName',
     'chapters_permissions' => 'Chapter Permissions',
     'chapters_empty' => 'No pages are currently in this chapter.',
     'chapters_permissions_active' => 'Chapter Permissions Active',
+    'chapters_permissions_success' => 'Chapter Permissions Updated',
 
     /**
      * Pages
@@ -106,11 +118,18 @@ return [
     'pages_attachments' => 'Attachments',
     'pages_navigation' => 'Page Navigation',
     'pages_delete' => 'Delete Page',
+    'pages_delete_named' => 'Delete Page :pageName',
+    'pages_delete_draft_named' => 'Delete Draft Page :pageName',
     'pages_delete_draft' => 'Delete Draft Page',
+    'pages_delete_success' => 'Page deleted',
+    'pages_delete_draft_success' => 'Draft page deleted',
     'pages_delete_confirm' => 'Are you sure you want to delete this page?',
     'pages_delete_draft_confirm' => 'Are you sure you want to delete this draft page?',
+    'pages_editing_named' => 'Editing Page :pageName',
     'pages_edit_toggle_header' => 'Toggle header',
     'pages_edit_save_draft' => 'Save Draft',
+    'pages_edit_draft' => 'Edit Page Draft',
+    'pages_edit_draft_save_at' => 'Draft saved at ',
     'pages_edit_delete_draft' => 'Delete Draft',
     'pages_edit_discard_draft' => 'Discard Draft',
     'pages_edit_set_changelog' => 'Set Changelog',
@@ -125,8 +144,12 @@ return [
     'pages_md_insert_link' => 'Insert Entity Link',
     'pages_not_in_chapter' => 'Page is not in a chapter',
     'pages_move' => 'Move Page',
+    'pages_move_success' => 'Page moved to ":parentName"',
     'pages_permissions' => 'Page Permissions',
+    'pages_permissions_success' => 'Page permissions updated',
     'pages_revisions' => 'Page Revisions',
+    'pages_revisions_named' => 'Page Revisions for :pageName',
+    'pages_revision_named' => 'Page Revision for :pageName',
     'pages_revisions_created_by' => 'Created By',
     'pages_revisions_date' => 'Revision Date',
     'pages_revisions_changelog' => 'Changelog',
@@ -141,12 +164,24 @@ return [
     'pages_export_text' => 'Plain Text File',
     'pages_copy_link' => 'Copy Link',
     'pages_permissions_active' => 'Page Permissions Active',
+    'pages_initial_revision' => 'Initial publish',
+    'pages_initial_name' => 'New Page',
+    'pages_editing_draft_notification' => 'You are currently editing a draft that was last saved :timeDiff.',
+    'pages_draft_edited_notification' => 'This page has been updated by since that time. It is recommended that you discard this draft.',
+    'pages_draft_edit_active' => [
+        'start_a' => ':count users have started editing this page',
+        'start_b' => ':userName has started editing this page',
+        'time_a' => 'since the pages was last updated',
+        'time_b' => 'in the last :minCount minutes',
+        'message' => ':start :time. Take care not to overwrite each other\'s updates!',
+    ],
 
     /**
      * Editor sidebar
      */
     'page_tags' => 'Page Tags',
     'tag' => 'Tag',
+    'tags' =>  '',
     'tag_value' => 'Tag Value (Optional)',
     'tags_explain' => "Add some tags to better categorise your content. \n You can assign a value to a tag for more in-depth organisation.",
     'tags_add' => 'Add another tag',
@@ -168,6 +203,8 @@ return [
     'attachments_edit_file' => 'Edit File',
     'attachments_edit_file_name' => 'File Name',
     'attachments_edit_drop_upload' => 'Drop files or click here to upload and overwrite',
+    'attachments_order_updated' => 'Attachment order updated',
+    'attachments_deleted' => 'Attachment deleted',
 
     /**
      * Profile View
index 32655c75a29986dcf90422645e0204de4b1dea73..d36f3993257bd2110b875799fc65d4682d490c38 100644 (file)
@@ -10,8 +10,53 @@ return [
     'permission' => 'You do not have permission to access the requested page.',
     'permissionJson' => 'You do not have permission to perform the requested action.',
 
+    // Auth
+    'error_user_exists_different_creds' => 'A user with the email :email already exists but with different credentials.',
+    'email_already_confirmed' => 'Email has already been confirmed, Try logging in.',
+    'email_confirmation_invalid' => 'This confirmation token is not valid or has already been used, Please try registering again.',
+    'email_confirmation_expired' => 'The confirmation token has expired, A new confirmation email has been sent.',
+    'ldap_fail_anonymous' => 'LDAP access failed using anonymous bind',
+    'ldap_fail_authed' => 'LDAP access failed using given dn & password details',
+    'ldap_extension_not_installed' => 'LDAP PHP extension not installed',
+    'ldap_cannot_connect' => 'Cannot connect to ldap server, Initial connection failed',
+    'social_no_action_defined' => 'No action defined',
+    'social_account_in_use' => 'This :socialAccount account is already in use, Try logging in via the :socialAccount option.',
+    'social_account_email_in_use' => 'The email :email is already in use. If you already have an account you can connect your :socialAccount account from your profile settings.',
+    'social_account_existing' => 'This :socialAccount is already attached to your profile.',
+    'social_account_already_used_existing' => 'This :socialAccount account is already used by another user.',
+    'social_account_not_used' => 'This :socialAccount account is not linked to any users. Please attach it in your profile settings. ',
+    'social_account_register_instructions' => 'If you do not yet have an account, You can register an account using the :socialAccount option.',
+    'social_driver_not_found' => 'Social driver not found',
+    'social_driver_not_configured' => 'Your :socialAccount social settings are not configured correctly.',
+
+    // System
+    'path_not_writable' => 'File path :filePath could not be uploaded to. Ensure it is writable to the server.',
+    'cannot_get_image_from_url' => 'Cannot get image from :url',
+    'cannot_create_thumbs' => 'The server cannot create thumbnails. Please check you have the GD PHP extension installed.',
+
+    // Attachments
+    'attachment_page_mismatch' => 'Page mismatch during attachment update',
+
+    // Entities
+    'entity_not_found' => 'Entity not found',
+    'book_not_found' => 'Book not found',
+    'page_not_found' => 'Page not found',
+    'chapter_not_found' => 'Chapter not found',
+    'selected_book_not_found' => 'The selected book was not found',
+    'selected_book_chapter_not_found' => 'The selected Book or Chapter was not found',
+    'guests_cannot_save_drafts' => 'Guests cannot save drafts',
+
+    // Users
+    'users_cannot_delete_only_admin' => 'You cannot delete the only admin',
+    'users_cannot_delete_guest' => 'You cannot delete the guest user',
+
+    // Roles
+    'role_cannot_be_edited' => 'This role cannot be edited',
+    'role_system_cannot_be_deleted' => 'This role is a system role and cannot be deleted',
+    'role_registration_default_cannot_delete' => 'This role cannot be deleted while set as the default registration role',
+
     // Error pages
-    'page_not_found' => 'Page Not Found',
+    '404_page_not_found' => 'Page Not Found',
     'sorry_page_not_found' => 'Sorry, The page you were looking for could not be found.',
     'return_home' => 'Return to home',
     'error_occurred' => 'An Error Occurred',
index dcbfe6dde51f28d33d579ba0e57df8999cd08f86..e61df19d91172738d7ef1f3783c7bb847f2e1cf2 100644 (file)
@@ -10,6 +10,7 @@ return [
     
     'settings' => 'Settings',
     'settings_save' => 'Save Settings',
+    'settings_save_success' => 'Settings saved',
 
     /**
      * App settings
@@ -51,10 +52,13 @@ return [
     'roles' => 'Roles',
     'role_user_roles' => 'User Roles',
     'role_create' => 'Create New Role',
+    'role_create_success' => 'Role successfully created',
     'role_delete' => 'Delete Role',
     'role_delete_confirm' => 'This will delete the role with the name \':roleName\'.',
     'role_delete_users_assigned' => 'This role has :userCount users assigned to it. If you would like to migrate the users from this role select a new role below.',
+    'role_delete_no_migration' => "Don't migrate users",
     'role_delete_sure' => 'Are you sure you want to delete this role?',
+    'role_delete_success' => 'Role successfully deleted',
     'role_edit' => 'Edit Role',
     'role_details' => 'Role Details',
     'role_name' => 'Role Name',
@@ -71,6 +75,7 @@ return [
     'role_own' => 'Own',
     'role_controlled_by_asset' => 'Controlled by the asset they are uploaded to',
     'role_save' => 'Save Role',
+    'role_update_success' => 'Role successfully updated',
     'role_users' => 'Users in this role',
     'role_users_none' => 'No users are currently assigned to this role',
 
@@ -79,6 +84,7 @@ return [
      */
 
     'users' => 'Users',
+    'user_profile' => 'User Profile',
     'users_add_new' => 'Add New User',
     'users_search' => 'Search Users',
     'users_role' => 'User Roles',
@@ -86,16 +92,21 @@ return [
     'users_password_warning' => 'Only fill the below if you would like to change your password:',
     'users_system_public' => 'This user represents any guest users that visit your instance. It cannot be used to log in but is assigned automatically.',
     'users_delete' => 'Delete User',
+    'users_delete_named' => 'Delete ser :userName',
     'users_delete_warning' => 'This will fully delete this user with the name \':userName\' from the system.',
     'users_delete_confirm' => 'Are you sure you want to delete this user?',
+    'users_delete_success' => 'Users successfully removed',
     'users_edit' => 'Edit User',
     'users_edit_profile' => 'Edit Profile',
+    'users_edit_success' => 'User successfully updated',
     'users_avatar' => 'User Avatar',
     'users_avatar_desc' => 'This image should be approx 256px square.',
     'users_social_accounts' => 'Social Accounts',
     'users_social_accounts_info' => 'Here you can connect your other accounts for quicker and easier login. Disconnecting an account here does not previously authorized access. Revoke access from your profile settings on the connected social account.',
     'users_social_connect' => 'Connect Account',
     'users_social_disconnect' => 'Disconnect Account',
+    'users_social_connected' => ':socialAccount account was successfully attached to your profile.',
+    'users_social_disconnected' => ':socialAccount account was successfully disconnected from your profile.',
 ];
 
 
index 20acc9a68e44b7b81003b04af347293c1e148c68..b75af7485ffb7baf86a2faaf46f6ab4107956a3d 100644 (file)
@@ -87,8 +87,8 @@ return [
     */
 
     'custom' => [
-        'attribute-name' => [
-            'rule-name' => 'custom-message',
+        'password-confirm' => [
+            'required_with' => 'Password confirmation required',
         ],
     ],
 
index 2d1c21cdd9269bbf144fabee2dc299be3c73ccbf..6a18302bc3ac8a8dae53e45368cc5cd7555dc951 100644 (file)
                             <a href="{{ $book->getUrl('/chapter/create') }}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i>{{ trans('entities.chapters_new') }}</a>
                         @endif
                         @if(userCan('book-update', $book))
-                            <a href="{{$book->getEditUrl()}}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>{{ trans('entities.edit') }}</a>
+                            <a href="{{$book->getEditUrl()}}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>{{ trans('common.edit') }}</a>
                         @endif
                         @if(userCan('book-update', $book) || userCan('restrictions-manage', $book) || userCan('book-delete', $book))
                             <div dropdown class="dropdown-container">
                                 <a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i></a>
                                 <ul>
                                     @if(userCan('book-update', $book))
-                                        <li><a href="{{ $book->getUrl('/sort') }}" class="text-primary"><i class="zmdi zmdi-sort"></i>{{ trans('entities.sort') }}</a></li>
+                                        <li><a href="{{ $book->getUrl('/sort') }}" class="text-primary"><i class="zmdi zmdi-sort"></i>{{ trans('common.sort') }}</a></li>
                                     @endif
                                     @if(userCan('restrictions-manage', $book))
                                         <li><a href="{{ $book->getUrl('/permissions') }}" class="text-primary"><i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.permissions') }}</a></li>
                                     @endif
                                     @if(userCan('book-delete', $book))
-                                        <li><a href="{{ $book->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('entities.delete') }}</a></li>
+                                        <li><a href="{{ $book->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('common.delete') }}</a></li>
                                     @endif
                                 </ul>
                             </div>
index 5dd4e53798b2f927a540087742d9549b4aac5013..93eee6424c055bab1ec53dc4263310df215b631e 100644 (file)
                             <a href="{{ $chapter->getUrl('/create-page') }}" class="text-pos text-button"><i class="zmdi zmdi-plus"></i>{{ trans('entities.pages_new') }}</a>
                         @endif
                         @if(userCan('chapter-update', $chapter))
-                            <a href="{{ $chapter->getUrl('/edit') }}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>{{ trans('entities.edit') }}</a>
+                            <a href="{{ $chapter->getUrl('/edit') }}" class="text-primary text-button"><i class="zmdi zmdi-edit"></i>{{ trans('common.edit') }}</a>
                         @endif
                         @if(userCan('chapter-update', $chapter) || userCan('restrictions-manage', $chapter) || userCan('chapter-delete', $chapter))
                             <div dropdown class="dropdown-container">
                                 <a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i></a>
                                 <ul>
                                     @if(userCan('chapter-update', $chapter))
-                                        <li><a href="{{ $chapter->getUrl('/move') }}" class="text-primary"><i class="zmdi zmdi-folder"></i>{{ trans('entities.move') }}</a></li>
+                                        <li><a href="{{ $chapter->getUrl('/move') }}" class="text-primary"><i class="zmdi zmdi-folder"></i>{{ trans('common.move') }}</a></li>
                                     @endif
                                     @if(userCan('restrictions-manage', $chapter))
                                         <li><a href="{{ $chapter->getUrl('/permissions') }}" class="text-primary"><i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.permissions') }}</a></li>
                                     @endif
                                     @if(userCan('chapter-delete', $chapter))
-                                        <li><a href="{{ $chapter->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('entities.delete') }}</a></li>
+                                        <li><a href="{{ $chapter->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('common.delete') }}</a></li>
                                     @endif
                                 </ul>
                             </div>
index 27c221f99a32d8b389b36b685a57800bb5d557dc..c9e600ceb7376489f6945f863b2b241da3037949 100644 (file)
@@ -6,7 +6,7 @@
 <div class="container">
 
 
-    <h1>{{ $message or trans('errors.page_not_found') }}</h1>
+    <h1>{{ $message or trans('errors.404_page_not_found') }}</h1>
     <p>{{ trans('errors.sorry_page_not_found') }}</p>
     <p><a href="{{ baseUrl('/') }}" class="button">{{ trans('errors.return_home') }}</a></p>
 
index ced311f94cc230a0e7e2fb9ce6edd1695221aebd..e54dacb428c8a4845d35033c91f887b909f91010 100644 (file)
                             </ul>
                         </span>
                         @if(userCan('page-update', $page))
-                            <a href="{{ $page->getUrl('/edit') }}" class="text-primary text-button" ><i class="zmdi zmdi-edit"></i>{{ trans('entities.edit') }}</a>
+                            <a href="{{ $page->getUrl('/edit') }}" class="text-primary text-button" ><i class="zmdi zmdi-edit"></i>{{ trans('common.edit') }}</a>
                         @endif
                         @if(userCan('page-update', $page) || userCan('restrictions-manage', $page) || userCan('page-delete', $page))
                             <div dropdown class="dropdown-container">
                                 <a dropdown-toggle class="text-primary text-button"><i class="zmdi zmdi-more-vert"></i></a>
                                 <ul>
                                     @if(userCan('page-update', $page))
-                                        <li><a href="{{ $page->getUrl('/move') }}" class="text-primary" ><i class="zmdi zmdi-folder"></i>{{ trans('entities.move') }}</a></li>
+                                        <li><a href="{{ $page->getUrl('/move') }}" class="text-primary" ><i class="zmdi zmdi-folder"></i>{{ trans('common.move') }}</a></li>
                                         <li><a href="{{ $page->getUrl('/revisions') }}" class="text-primary"><i class="zmdi zmdi-replay"></i>{{ trans('entities.revisions') }}</a></li>
                                     @endif
                                     @if(userCan('restrictions-manage', $page))
                                         <li><a href="{{ $page->getUrl('/permissions') }}" class="text-primary"><i class="zmdi zmdi-lock-outline"></i>{{ trans('entities.permissions') }}</a></li>
                                     @endif
                                     @if(userCan('page-delete', $page))
-                                        <li><a href="{{ $page->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('entities.delete') }}</a></li>
+                                        <li><a href="{{ $page->getUrl('/delete') }}" class="text-neg"><i class="zmdi zmdi-delete"></i>{{ trans('common.delete') }}</a></li>
                                     @endif
                                 </ul>
                             </div>
index 28e6dccb17609ad3af5a804fb06a3460f0d0714b..3cd26e62027ac4e6c16d0c52f11f166ee0cd56e7 100644 (file)
@@ -107,7 +107,6 @@ Route::group(['middleware' => 'auth'], function () {
         Route::get('/get/{entityType}/{entityId}', 'TagController@getForEntity');
         Route::get('/suggest/names', 'TagController@getNameSuggestions');
         Route::get('/suggest/values', 'TagController@getValueSuggestions');
-        Route::post('/update/{entityType}/{entityId}', 'TagController@updateForEntity');
     });
 
     Route::get('/ajax/search/entities', 'SearchController@searchEntitiesAjax');
Morty Proxy This is a proxified and sanitized view of the page, visit original site.