/** * Registers some core page URLs */ function registerPages() { $permalink_route = \Idno\Common\Entity::getPermalinkRoute(); /** Homepage */ $this->addPageHandler('/?', '\\Idno\\Pages\\Homepage'); $this->addPageHandler('/feed\\.xml', '\\Idno\\Pages\\Feed'); $this->addPageHandler('/feed/?', '\\Idno\\Pages\\Feed'); $this->addPageHandler('/rss\\.xml', '\\Idno\\Pages\\Feed'); $this->addPageHandler('/content/([A-Za-z\\-\\/]+)+', '\\Idno\\Pages\\Homepage'); /** Individual entities / posting / deletion */ $this->addPageHandler('/view/([\\%A-Za-z0-9]+)/?', '\\Idno\\Pages\\Entity\\View'); $this->addPageHandler('/s/([\\%A-Za-z0-9]+)/?', '\\Idno\\Pages\\Entity\\Shortlink'); $this->addPageHandler($permalink_route . '/?', '\\Idno\\Pages\\Entity\\View'); $this->addPageHandler('/edit/([A-Za-z0-9]+)/?', '\\Idno\\Pages\\Entity\\Edit'); $this->addPageHandler('/delete/([A-Za-z0-9]+)/?', '\\Idno\\Pages\\Entity\\Delete'); $this->addPageHandler('/withdraw/([A-Za-z0-9]+)/?', '\\Idno\\Pages\\Entity\\Withdraw'); /** Annotations */ $this->addPageHandler('/view/([A-Za-z0-9]+)/annotations/([A-Za-z0-9]+)?', '\\Idno\\Pages\\Annotation\\View'); $this->addPageHandler($permalink_route . '/annotations/([A-Za-z0-9]+)?', '\\Idno\\Pages\\Annotation\\View'); $this->addPageHandler($permalink_route . '/annotations/([A-Za-z0-9]+)/delete/?', '\\Idno\\Pages\\Annotation\\Delete'); // Delete annotation $this->addPageHandler('/annotation/post/?', '\\Idno\\Pages\\Annotation\\Post'); /** Bookmarklets and sharing */ $this->addPageHandler('/share/?', '\\Idno\\Pages\\Entity\\Share'); $this->addPageHandler('/bookmarklet\\.js', '\\Idno\\Pages\\Entity\\Bookmarklet', true); /** Mobile integrations */ $this->addPageHandler('/chrome/manifest\\.json', '\\Idno\\Pages\\Chrome\\Manifest', true); /** Files */ $this->addPageHandler('/file/upload/?', '\\Idno\\Pages\\File\\Upload', true); $this->addPageHandler('/file/picker/?', '\\Idno\\Pages\\File\\Picker', true); $this->addPageHandler('/filepicker/?', '\\Idno\\Pages\\File\\Picker', true); $this->addPageHandler('/file/([A-Za-z0-9]+)(/.*)?', '\\Idno\\Pages\\File\\View', true); /** Users */ $this->addPageHandler('/profile/([^\\/]+)/?', '\\Idno\\Pages\\User\\View'); $this->addPageHandler('/profile/([^\\/]+)/edit/?', '\\Idno\\Pages\\User\\Edit'); /** Search */ $this->addPageHandler('/search/?', '\\Idno\\Pages\\Search\\Forward'); $this->addPageHandler('/search/mentions\\.json', '\\Idno\\Pages\\Search\\Mentions'); $this->addPageHandler('/tag/([^\\s]+)\\/?', '\\Idno\\Pages\\Search\\Tags'); /** robots.txt */ $this->addPageHandler('/robots\\.txt', '\\Idno\\Pages\\Txt\\Robots'); /** Autosave / preview */ $this->addPageHandler('/autosave/?', '\\Idno\\Pages\\Entity\\Autosave'); /** Installation / first use */ $this->addPageHandler('/begin/?', '\\Idno\\Pages\\Onboarding\\Begin', true); $this->addPageHandler('/begin/register/?', '\\Idno\\Pages\\Onboarding\\Register', true); $this->addPageHandler('/begin/profile/?', '\\Idno\\Pages\\Onboarding\\Profile'); $this->addPageHandler('/begin/connect/?', '\\Idno\\Pages\\Onboarding\\Connect'); $this->addPageHandler('/begin/connect\\-forwarder/?', '\\Idno\\Pages\\Onboarding\\ConnectForwarder'); $this->addPageHandler('/begin/publish/?', '\\Idno\\Pages\\Onboarding\\Publish'); /** Add some services */ $this->addPageHandler('/service/db/optimise/?', '\\Idno\\Pages\\Service\\Db\\Optimise'); $this->addPageHandler('/service/vendor/messages/?', '\\Idno\\Pages\\Service\\Vendor\\Messages'); // These must be loaded last $this->plugins = new Plugins(); $this->themes = new Themes(); }