| 1 |
<?php |
| 2 |
/** |
| 3 |
* Profile-collections module (spec 029-profile-collections). |
| 4 |
* |
| 5 |
* Favourites/downloads/purchased-items listing pages. Relocated verbatim from |
| 6 |
* includes/API/Profile.php — behavior byte-identical (same 3 routes: download- |
| 7 |
* history, my-favourites, purchased-items). NOT the same class as |
| 8 |
* modules/auth/REST/Profile.php (profile/sync, profile/verified — a genuinely |
| 9 |
* different, pre-existing class; a stale includes/Core/Migrator.php reference |
| 10 |
* to the WRONG "Profile" class, calling ::sync() on THIS class where it never |
| 11 |
* existed, was fixed as part of this move — see the PRD's blockers log). |
| 12 |
* |
| 13 |
* SCOPE NOTE: the favourite TOGGLE endpoint (POST /items/favourite) stays in |
| 14 |
* modules/template-browsing/REST/Items.php (spec 017's own established |
| 15 |
* boundary — not moved). The favourites/downloads/purchasedItems REDUX state, |
| 16 |
* action creators, and sagas all live in modules/auth (profileReducer.js / |
| 17 |
* actions.js / profileSaga.js, spec 013) — too entangled with the rest of |
| 18 |
* profileReducer to split out, so this module owns only the REST + the view |
| 19 |
* components, cross-referencing auth's state/actions/sagas as-is. No |
| 20 |
* templately.routes registration and no webpack partial for the same reason |
| 21 |
* 028-my-cloud deferred its own: the /downloads, /favourites, /purchased-items |
| 22 |
* routes share one CloudsLayout parent wrapper with 028's /clouds route (also |
| 23 |
* CloudsLayout-wrapped) — TemplatelyRoutes.js keeps its inline route |
| 24 |
* definitions, importing Downloads/Favourites/PurchasedItems from this module |
| 25 |
* via the profile/ barrel's re-export. |
| 26 |
* |
| 27 |
* @package Templately |
| 28 |
*/ |
| 29 |
|
| 30 |
namespace Templately\Modules\ProfileCollections; |
| 31 |
|
| 32 |
use Templately\Core\Module_Base; |
| 33 |
use Templately\Modules\ProfileCollections\REST\Profile; |
| 34 |
|
| 35 |
class Module extends Module_Base { |
| 36 |
|
| 37 |
public function get_name(): string { |
| 38 |
return 'profile-collections'; |
| 39 |
} |
| 40 |
|
| 41 |
public function register_rest_routes(): void { |
| 42 |
Profile::get_instance()->register_routes(); |
| 43 |
} |
| 44 |
} |
| 45 |
|