diff options
| author | Nils Adermann <naderman@naderman.de> | 2012-09-01 12:44:23 -0700 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2012-09-01 12:44:23 -0700 |
| commit | 43190ebecaeadbc8738da9dcb33b9163652fb9f3 (patch) | |
| tree | 516a6470a93742067259d618f7e1c6c48f558894 /phpBB/posting.php | |
| parent | c539c2b0f9f736da816422320d6f58e6f414f54e (diff) | |
| parent | 02644c02b9d6bed5e4a8e20323bdafb2ca9749b4 (diff) | |
| download | forums-43190ebecaeadbc8738da9dcb33b9163652fb9f3.tar forums-43190ebecaeadbc8738da9dcb33b9163652fb9f3.tar.gz forums-43190ebecaeadbc8738da9dcb33b9163652fb9f3.tar.bz2 forums-43190ebecaeadbc8738da9dcb33b9163652fb9f3.tar.xz forums-43190ebecaeadbc8738da9dcb33b9163652fb9f3.zip | |
Merge pull request #962 from imkingdavid/feature/add_events
Feature/add events
Diffstat (limited to 'phpBB/posting.php')
| -rw-r--r-- | phpBB/posting.php | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php index 736ba8feea..2d3cb9ab44 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -44,6 +44,41 @@ $mode = ($delete && !$preview && !$refresh && $submit) ? 'delete' : request_var $error = $post_data = array(); $current_time = time(); +/** +* This event allows you to alter the above parameters, such as submit and mode +* +* Note: $refresh must be true to retain previously submitted form data. +* +* Note: The template class will not work properly until $user->setup() is +* called, and it has not been called yet. Extensions requiring template +* assignments should use an event that comes later in this file. +* +* @event core.modify_posting_parameters +* @var int post_id ID of the post +* @var int topic_id ID of the topic +* @var int forum_id ID of the forum +* @var int draft_id ID of the draft +* @var int lastclick Timestamp of when the form was last loaded +* @var bool submit Whether or not the form has been submitted +* @var bool preview Whether or not the post is being previewed +* @var bool save Whether or not a draft is being saved +* @var bool load Whether or not a draft is being loaded +* @var bool delete Whether or not the post is being deleted +* @var bool cancel Whether or not to cancel the form (returns to +* viewtopic or viewforum depending on if the user +* is posting a new topic or editing a post) +* @var bool refresh Whether or not to retain previously submitted data +* @var string mode What action to take if the form has been sumitted +* post|reply|quote|edit|delete|bump|smilies|popup +* @var array error Any error strings; a non-empty array aborts +* form submission. +* NOTE: Should be actual language strings, NOT +* language keys. +* @since 3.1-A1 +*/ +$vars = array('post_id', 'topic_id', 'forum_id', 'draft_id', 'lastclick', 'submit', 'preview', 'save', 'load', 'delete', 'cancel', 'refresh', 'mode', 'error'); +extract($phpbb_dispatcher->trigger_event('core.modify_posting_parameters', compact($vars))); + // Was cancel pressed? If so then redirect to the appropriate page if ($cancel || ($current_time - $lastclick < 2 && $submit)) { @@ -1417,6 +1452,14 @@ $template->assign_vars(array( 'S_HIDDEN_FIELDS' => $s_hidden_fields) ); +/** +* This event allows you to modify template variables for the posting screen +* +* @event core.posting_modify_template_vars +* @since 3.1-A1 +*/ +$phpbb_dispatcher->trigger_event('core.posting_modify_template_vars'); + // Build custom bbcodes array display_custom_bbcodes(); |
