streams/Zotlabs/Module
git-marijus 07b67963f1
Merge pull request #951 from dawnbreak/docu
💡 Add source documentation from recent conversations.
2018-01-12 10:15:43 +01:00
..
Admin expose settings for site sellpage and site location 2018-01-11 14:29:00 -08:00
Settings a different (hopefully better) implementation of affinity presets, but not for 3.0 because strings have changed. 2017-12-28 15:12:20 -08:00
Achievements.php remove the app $a passed to profile_load, also add profile_load to mod_wiki which should fix issue #431 2016-06-26 22:13:59 -07:00
Acl.php 💡 Add source documentation from recent conversations. 2018-01-05 01:38:20 +01:00
Admin.php provide a mechanism to mark apps active in the bin 2017-07-21 10:32:21 +02:00
Api.php scrutinizer issues: none worthy of including in 3.0, there will likely be a few hundred more before all is said and done. 2018-01-08 14:45:21 -08:00
Appman.php provide ability to pin apps to navbar from /apps. this removes the ability to have per custom navbar pinned apps - this can be added later if desired 2017-11-16 11:11:06 +01:00
Apporder.php fix issues with apporder related to recent pinned apps changes 2017-11-19 22:42:16 +01:00
Apps.php fix regression in app categories 2018-01-08 11:11:17 +01:00
Article_edit.php article feature 2017-11-22 15:39:06 -08:00
Articles.php article feature 2017-11-22 15:39:06 -08:00
Attach.php check code rights on cloud files 2017-09-05 21:38:07 -07:00
Authorize.php oauth2/oidc testing (please do not port - this requires several extra DB tables to work) 2017-05-03 22:37:06 -07:00
Authtest.php module updates 2016-04-18 20:38:38 -07:00
Block.php remove unused page_widgets.php include and provide a general function for loading sql from file to use in the cdav migration 2017-06-22 22:43:08 -07:00
Blocks.php remove the app $a passed to profile_load, also add profile_load to mod_wiki which should fix issue #431 2016-06-26 22:13:59 -07:00
Bookmarks.php feed untranslated appnames to nav_set_selected() and query for the active app directly to get app details 2017-10-09 21:22:57 +02:00
Branchtopic.php module updates 2016-04-18 20:38:38 -07:00
Cal.php rename channel app events to calendar and add nav_set_selected() to /cal 2017-11-07 11:22:11 +01:00
Card_edit.php card_edit: fix lockstate and current permissions not handed over to editor 2017-10-01 22:46:35 +02:00
Cards.php cards - change placeholdertext, separate from button text 2017-08-24 18:34:12 -07:00
Cdav.php strip acct: from OWA auth to API endpoints 2017-12-07 18:56:26 -08:00
Changeaddr.php allow channel address to be changed 2017-08-04 19:02:41 -07:00
Channel.php support for netselect query 2017-11-01 02:53:12 -07:00
Chanview.php typo in chanview, remove output buffering in mod_cloud which is preventing large files from being downloaded. IIRC this was put there to avoid a SAML warning in SabreDAV but I'm not seeing that currently. 2017-06-25 19:17:05 -07:00
Chat.php feed untranslated appnames to nav_set_selected() and query for the active app directly to get app details 2017-10-09 21:22:57 +02:00
Chatsvc.php fix chat member list when one or members are connected via access tokens 2017-01-02 23:35:40 -08:00
Cloud.php mod_cloud: provide a themed page with an error notification on errors instead of an obtuse XML error structure 2017-12-05 18:20:38 -08:00
Cloud_tiles.php make most recent cloud_tiles setting for local channels persistent across logins 2017-11-07 19:34:00 -08:00
Common.php some basic work on mod common 2017-10-03 11:37:45 +02:00
Connect.php command line connect utility. 2016-11-01 15:27:34 -07:00
Connections.php feed untranslated appnames to nav_set_selected() and query for the active app directly to get app details 2017-10-09 21:22:57 +02:00
Connedit.php possibly fix hubzilla #673 (prev/next buttons on connedit can show deleted connections). We cannot actually determine that a connection has been deleted (this is typically accomplished by removing the abook record), but we can determine if the corresponding xchan has been deleted. 2017-12-30 15:35:18 -08:00
Contactgroup.php more backquotes - this should take care of most except for the array import queries 2016-10-09 16:31:04 -07:00
Cover_photo.php more work related to attach/photo and os_path, display_path and general code cleanup 2017-03-29 13:44:55 +02:00
Dav.php strip acct: from OWA auth to API endpoints 2017-12-07 18:56:26 -08:00
Defperms.php .htignore update 2017-11-06 21:55:36 -08:00
Directory.php allow a site to block (public) the directory separately from other resources. 2017-11-12 21:43:46 -08:00
Dirsearch.php hubzilla issue #945 continued: We previously blocked directory keywords when searching the local directory as it produced errant results and included results from the entire directory space (an issue that was resolved satisfactorily by that fix sometime in the past). As a result of issue #945 this was reworked so that we should return correct results for keywords when searching either the local directory or a standalone directory. 2018-01-10 15:32:04 -08:00
Display.php fix mod display and others that require a non-zero profile_uid for updates 2017-12-04 21:18:10 -08:00
Dreport.php allow delivery report for not just the author, but also if you're the owner and it's on your wall. 2016-10-03 20:50:13 -07:00
Editblock.php various input filter fixes 2017-03-29 13:56:31 +02:00
Editlayout.php various input filter fixes 2017-03-29 13:56:31 +02:00
Editpost.php more deprecate server_role 2017-05-29 16:25:27 -07:00
Editwebpage.php hubzilla issue #795 2017-05-27 02:22:36 -07:00
Embedphotos.php hubzilla #475 continued - show photos in root folder. Part of Andrew's fix for this wasn't in my repository and hopefully won't conflict; as it appears to have been lost somewhere. It also needed a small change to the folder permissions check. 2017-12-12 14:18:34 -08:00
Events.php feed untranslated appnames to nav_set_selected() and query for the active app directly to get app details 2017-10-09 21:22:57 +02:00
Fbrowser.php more backquotes - this should take care of most except for the array import queries 2016-10-09 16:31:04 -07:00
Feed.php issues with feed parameters 2018-01-02 14:04:43 -08:00
Fhublocs.php fix typos 2017-01-31 09:43:58 +01:00
File_upload.php remove logging line 2017-11-30 19:11:26 -08:00
Filer.php fix item_list and item_search templates. make item filer use a bootdtrap modal and some css and class fixes 2017-03-17 14:22:10 +01:00
Filerm.php more db column renames 2016-05-31 21:45:33 -07:00
Filestorage.php sync packet not generated when deleting a file using the web browser interface 2017-11-24 00:12:19 -08:00
Follow.php remove obscured @ hack 2016-10-04 19:37:16 -07:00
Getfile.php use the same variable name consistently 2017-11-29 14:08:30 -08:00
Group.php hubzilla issue #832 2017-07-19 18:32:16 -07:00
Hcard.php missing space in nav tpl 2017-06-28 16:45:48 -07:00
Help.php feed untranslated appnames to nav_set_selected() and query for the active app directly to get app details 2017-10-09 21:22:57 +02:00
Home.php mod_home: if using an atoken login on the home page redirect to the channel page of the channel that owns the atoken. 2016-07-15 15:26:36 -07:00
Hostxrd.php minor theming and whitespace 2017-02-08 19:47:34 -08:00
Hq.php continue working on hq 2018-01-11 10:58:46 +01:00
Impel.php pagetitle lost importing a pdl element from conversation 2017-12-03 19:12:55 -08:00
Import.php import: special handling required for channel photo in the xchan record when not seizing 'primary' 2017-10-02 20:27:04 -07:00
Import_items.php 🔒 Add CSRF protection for import and import_items. 2017-03-30 23:17:32 +02:00
Invite.php feed untranslated appnames to nav_set_selected() and query for the active app directly to get app details 2017-10-09 21:22:57 +02:00
Item.php fix another PHP7.2 warningg 2017-12-14 22:41:11 +01:00
Lang.php feed untranslated appnames to nav_set_selected() and query for the active app directly to get app details 2017-10-09 21:22:57 +02:00
Layouts.php pagetitle lost importing a pdl element from conversation 2017-12-03 19:12:55 -08:00
Like.php fix mod like after recent changes 2017-11-27 10:07:45 +01:00
Linkinfo.php more work on oembed from /display 2017-08-21 15:00:45 -07:00
Lockview.php many dropdown and class fixes. still a long way to go... 2017-03-12 21:11:28 +01:00
Locs.php provide /locs link on settings page if there is more than one hubloc for this channnel *that isn't deleted*. 2016-11-05 03:31:50 -07:00
Login.php sort out some of the authentication mess - with luck this may fix the DAV auth issue which I simply could not duplicate or find a reason for. 2016-07-20 17:55:40 -07:00
Logout.php create an actual logout module instead of relying on internal variables 2017-10-12 22:10:42 -07:00
Lostpass.php Unify the various mail sending instance to enotify::send() and z_mail(). Both take the same arguments. z_mail() is text only, enotify::send() provides html and text. Both are pluggable using the enotfy_send hook. 2016-10-01 03:06:01 -07:00
Magic.php encrypt the owa token 2017-10-26 15:23:04 -07:00
Mail.php fix issues with diaspora xchans 2017-11-02 08:44:46 +01:00
Manage.php more fixes 2017-10-08 22:47:43 +02:00
Menu.php add a few more path macros to portable menu elements (channelurl, pageurl, storeurl and baseurl) 2016-07-31 20:14:25 -07:00
Message.php call zidify_links() when formatting bbcode for internal consumption 2016-12-19 16:06:49 -08:00
Mitem.php multi acl: port /webpages and /mitem 2016-08-04 11:23:43 +02:00
Moderate.php redirect to be moderated items to /moderate and change the conv link to partent mid in /modrate 2017-10-19 11:20:09 +02:00
Mood.php feed untranslated appnames to nav_set_selected() and query for the active app directly to get app details 2017-10-09 21:22:57 +02:00
Network.php test of new affinity preset code (post 3.0) 2017-12-30 22:48:06 -08:00
New_channel.php register workflow was getting over-ridden in include/security 2017-10-19 18:48:11 -07:00
Nojs.php revert the reversal of checkjs logic, but still restrict the behaviour scope to just those urls that require it 2016-04-20 22:10:00 -07:00
Notes.php module updates 2016-04-18 20:38:38 -07:00
Notifications.php do not show seen notifys in notifications - show them in mod notifications instead. Update notifications count also on notifications updates 2017-10-22 21:01:58 +02:00
Notify.php some more work on mod hq 2017-11-18 22:16:06 +01:00
Oembed.php add rel=noopener to all external target _blank links 2017-06-14 16:56:13 +02:00
Oep.php article feature 2017-11-22 15:39:06 -08:00
Oexchange.php minor theming and whitespace 2017-02-08 19:47:34 -08:00
Ofeed.php issues with feed parameters 2018-01-02 14:04:43 -08:00
Online.php module updates 2016-04-18 20:38:38 -07:00
Owa.php OpenWebAuth: can fail after site re-installs; this may need to be pushed forward to master 2018-01-11 12:15:38 -08:00
Page.php allow plugin class widgets, fix sql error in page module 2017-10-29 19:52:00 -07:00
Pconfig.php missing class instance pointer in Pconfig module upgrade 2016-04-19 19:09:35 -07:00
Pdledit.php pdledit - show original/system layout text for comparison 2017-10-31 18:04:01 -07:00
Permcat.php move permcat library functions to Zlib 2017-02-07 16:43:00 -08:00
Photo.php cover photo was unintentionally disabled when block_public in effect 2017-05-08 11:11:50 +02:00
Photos.php synchronise an attach_move operation to clones 2017-12-06 14:20:17 -08:00
Ping.php notifications: only handle item otype notify_ids 2017-12-18 12:46:37 +01:00
Poco.php module updates 2016-04-18 20:38:38 -07:00
Poke.php feed untranslated appnames to nav_set_selected() and query for the active app directly to get app details 2017-10-09 21:22:57 +02:00
Post.php whitespace 2017-09-25 23:39:48 -07:00
Prate.php daemon conversion continued... 2016-05-19 22:26:37 -07:00
Pretheme.php module updates 2016-04-18 20:38:38 -07:00
Probe.php feed untranslated appnames to nav_set_selected() and query for the active app directly to get app details 2017-10-09 21:22:57 +02:00
Profile.php remove deprecated $a argument from advanced_profile() 2017-11-23 20:35:34 -08:00
Profile_photo.php this should finish up hubzilla issue #113 2017-12-31 14:45:42 -08:00
Profiles.php provide a mechanism to mark apps active in the bin 2017-07-21 10:32:21 +02:00
Profperm.php Create virtual privacy groups for private profile member lists 2017-02-12 15:56:33 -08:00
Pubsites.php comment out statistics link in mod pubsites until we have something functional again 2017-10-24 18:21:19 +02:00
Pubstream.php pubstream comments and a few other bugfixes that were discovered along the way 2017-11-26 18:29:24 -08:00
Randprof.php convert randprof to use chanlink_hash() instead of chanlink_url() and filter sys channels by xchan.xchan_system instead of xchan_addr != sys@% 2017-06-03 10:13:42 +02:00
Rate.php ratings are gone. They can be enabled, but there is no UI for doing so at this time; and will likely only be available in a 'pro' configuration once the new implementation details have been hashed out. This appears to require a mechanism for rebuttal before it can again be opened to the public. There are also some synchronisation issues to contend with; as ratings are currently only distributed to active directory servers. There is no reliable mechanism for a new directory server to fetch existing ratings. 2016-08-25 17:43:07 -07:00
Ratings.php ratings are gone. They can be enabled, but there is no UI for doing so at this time; and will likely only be available in a 'pro' configuration once the new implementation details have been hashed out. This appears to require a mechanism for rebuttal before it can again be opened to the public. There are also some synchronisation issues to contend with; as ratings are currently only distributed to active directory servers. There is no reliable mechanism for a new directory server to fetch existing ratings. 2016-08-25 17:43:07 -07:00
Ratingsearch.php add the hidden flag also 2016-07-27 16:14:46 -07:00
Rbmark.php module updates 2016-04-18 20:38:38 -07:00
React.php pubstream comments and a few other bugfixes that were discovered along the way 2017-11-26 18:29:24 -08:00
README.md readme for the module directory, also provide an undocumented way to reset the timestamp on connection photos to force a refresh without messing with the database directly. 2016-06-14 17:04:29 -07:00
Regdir.php sql: limit 1 for UPDATE and DELETE is not supported by the SQL standard and postgresql 2016-10-27 02:41:32 +02:00
Register.php Provide system config option for minimum registration age. 2017-11-24 13:50:29 -05:00
Regmod.php module updates 2016-04-18 20:38:38 -07:00
Regver.php module updates 2016-04-18 20:38:38 -07:00
Removeaccount.php null_date conversion; phase 1 2016-09-25 17:06:13 -07:00
Removeme.php null_date conversion; phase 1 2016-09-25 17:06:13 -07:00
Rmagic.php redirect loop with rmagic and owa 2017-10-04 18:51:37 -07:00
Rpost.php feed untranslated appnames to nav_set_selected() and query for the active app directly to get app details 2017-10-09 21:22:57 +02:00
Search.php more search work 2017-11-03 15:08:56 -07:00
Search_ac.php Bring the saved search feature in line with the spec, and publish the feature spec. 2016-09-28 20:55:15 -07:00
Service_limits.php module updates 2016-04-18 20:38:38 -07:00
Settings.php provide a mechanism to mark apps active in the bin 2017-07-21 10:32:21 +02:00
Setup.php fix typos in comment 2017-10-16 21:33:14 +02:00
Share.php oopsy 2017-06-21 17:46:28 -07:00
Sharedwithme.php improve file_activity() a little 2017-07-31 16:59:43 +02:00
Siteinfo.php turn url requests where argv[0] is something.xyz into module='something' and $_REQUEST['module_format'] = 'xyz'; But leave modules beginning with . (like .well_known) alone (convert the initial . to _ and then strip it). This really only affects Siteinfo_json at this time. 2017-07-13 20:53:05 -07:00
Sitelist.php module updates 2016-04-18 20:38:38 -07:00
Smilies.php module updates 2016-04-18 20:38:38 -07:00
Snap.php since the snap module runs without permissions controls, verify the logged in channel matches the requested cloud path 2016-10-09 21:36:55 -07:00
Sources.php sort out the rest of the source categories 2016-05-02 01:18:18 -07:00
Sslify.php there are occasional sites which use different capitalisation of Content-Type; which is rare, but completely legal. 2016-12-15 18:08:23 -08:00
Starred.php fix "unstar" 2017-10-28 15:24:37 -07:00
Subthread.php pubstream comments and a few other bugfixes that were discovered along the way 2017-11-26 18:29:24 -08:00
Suggest.php feed untranslated appnames to nav_set_selected() and query for the active app directly to get app details 2017-10-09 21:22:57 +02:00
Tagger.php pubstream comments and a few other bugfixes that were discovered along the way 2017-11-26 18:29:24 -08:00
Tagrm.php more backticks 2016-10-03 21:48:53 -07:00
Tasks.php last remaining task in tasklist was not removed from view when 'completed' 2017-08-23 23:59:05 -07:00
Theme_info.php put theme config into its own namespace 2016-09-01 22:20:08 -07:00
Thing.php hubzilla issue #868 2017-10-03 17:03:24 -07:00
Toggle_mobile.php module updates 2016-04-18 20:38:38 -07:00
Toggle_safesearch.php module updates 2016-04-18 20:38:38 -07:00
Token.php oauth2/oidc testing (please do not port - this requires several extra DB tables to work) 2017-05-03 22:37:06 -07:00
Uexport.php channel export - use a selected list of functional data categories to export; this allows one to export single data sets instead of always exporting everything we know about 2017-01-31 15:28:25 -08:00
Update.php explain what happened here 2017-12-04 21:39:53 -08:00
View.php module updates 2016-04-18 20:38:38 -07:00
Viewconnections.php more places to use chanlink_hash() instead of chanlink_url() for profile_link 2017-02-23 10:36:00 +01:00
Viewsrc.php The rest of the library and backend changes to support client-side e2ee and deprecate previous uses of item_obscured. 2017-04-26 14:16:07 +02:00
Wall_attach.php change to bbcode calling parameters: important: will require pulling addons; 2017-11-23 15:21:50 -08:00
Wall_upload.php deprecate/remove get_channel_by_nick() which is just a less generalised variant of channelx_by_nick() 2016-11-08 18:15:57 -08:00
Webfinger.php module updates 2016-04-18 20:38:38 -07:00
Webpages.php feed untranslated appnames to nav_set_selected() and query for the active app directly to get app details 2017-10-09 21:22:57 +02:00
Well_known.php convert all the _well_known service controllers which are a bit touchy when it comes to the router 2016-04-18 01:35:09 -07:00
Wfinger.php not sure when but the hcard went missing in webfinger 2017-10-23 21:19:40 -07:00
Wiki.php missed a spot while resolving merge conflict 2017-12-06 12:40:27 +01:00
Xchan.php module updates 2016-04-18 20:38:38 -07:00
Xpoco.php module updates 2016-04-18 20:38:38 -07:00
Xrd.php we need this in the plugin, not in core 2017-09-20 19:34:43 -07:00
Xref.php module updates 2016-04-18 20:38:38 -07:00
Zfinger.php some preliminary work on Zot VI 2017-09-04 22:35:44 -07:00
Zotfeed.php authenticate onepoll so we can receive private posts/comments in zotfeed; if local server bypass the network access and invoke zotfeed directly. 2017-05-01 15:14:10 +02:00
Zping.php module updates 2016-04-18 20:38:38 -07:00

Zotlabs/Module

This directory contains controller modules for handling web requests. The lowercase class name indicates the head of the URL path which this module handles. There are other methods of attaching (routing) URL paths to controllers, but this is the primary method used in this project.

Module controllers MUST reside in this directory and namespace to be autoloaded (unless other specific routing methods are employed). They typically use and extend the class definition in Zotlabs/Web/Controller as a template.

Template:

<?php

namespace Zotlabs\Web;


class Controller {

	function init() {}
	function post() {}
	function get() {}

}

Typical Module declaration for the '/foo' URL route:

<?php
namespace Zotlabs\Module;

class Foo extends \Zotlabs\Web\Controller {

	function init() {
		// init() handler goes here
	}

	function post() {
		// post handler goes here
	}

	function get() {
		return 'Hello world.' . EOL;
	}

}

This model provides callbacks for public functions named init(), post(), and get(). init() is always called. post() is called if $_POST variables are present, and get() is called if none of the prior functions terminated the handler. The get() method typically retuns a string which represents the contents of the content region of the resulting page. Modules which emit json, xml or other machine-readable formats typically emit their contents inside the init() function and call 'killme()' to terminate the Module.

Modules are passed the URL path as argc,argv arguments. For a path such as

https://mysite.something/foo/bar/baz

The app will typically invoke the Module class 'Foo' and pass it

$x = argc(); // $x = 3

$x = argv(0); // $x = 'foo'
$x = argv(1); // $x = 'bar'
$x = argv(2); // $x = 'baz'

These are handled in a similar fashion to their counterparts in the Unix shell or C/C++ languages. Do not confuse the argc(),argv() functions with the global variables $argc,$argv which are passed to command line programs. These are handled separately by command line and Zotlabs/Daemon class functions.