Файл: install/data/code_events.xml
Строк: 1261
<?xml version="1.0" encoding="utf-8"?>
<code_events>
<event event_id="container_admin_params"><![CDATA[<p>Called while preparing the container template of admin/back-end pages (PAGE_CONTAINER). You should use this to fetch any data you need for the container.</p>
<p>Callback signature:</p>
<blockquote><code><em>array</em> &$params, <em>XenForo_Dependencies_Abstract</em> $dependencies</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>array</em> &$params</code> - an array of key-value params that will be available in the container. You may modify existing ones or add your own values here.</li>
<li><code><em>XenForo_Dependencies_Abstract</em> $dependencies</code> - the dependencies object that triggered this event. You will generally not need to use this.</li>
</ol>]]></event>
<event event_id="container_public_params"><![CDATA[<p>Called while preparing the container template of public/front-end pages (PAGE_CONTAINER). You should use this to fetch any data you need for the container.</p>
<p>Callback signature:</p>
<blockquote><code><em>array</em> &$params, <em>XenForo_Dependencies_Abstract</em> $dependencies</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>array</em> &$params</code> - an array of key-value params that will be available in the container. You may modify existing ones or add your own values here.</li>
<li><code><em>XenForo_Dependencies_Abstract</em> $dependencies</code> - the dependencies object that triggered this event. You will generally not need to use this.</li>
</ol>]]></event>
<event event_id="controller_post_dispatch"><![CDATA[<p>Called after a controller action has been run.</p>
<p>Callback signature:</p>
<blockquote><code><em>XenForo_Controller</em> $controller, $controllerResponse, $controllerName, $action</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>XenForo_Controller</em> $controller</code> - the controller instance. From this, you can inspect the request, response, etc.</li>
<li><code><em>mixed</em> $controllerResponse</code> - controller response object. This will usually be an instance of <code><em>XenForo_ControllerResponse_Abstract</em></code>.</li>
<li><code><em>string</em> $controllerName</code> - name of the controller class that was requested for execution by the front controller. This should be a concrete class, not affected by load_class_controller events.</li>
<li><code><em>string</em> $action</code> - the specific action that was executed in this controller.</li>
</ol>
<p><b>Event Hint:</b> Name of the controller class that is being run.</p>]]></event>
<event event_id="controller_pre_dispatch"><![CDATA[<p>Called before attempting to dispatch the request in a specific controller. The visitor object is available at this point.</p>
<p>Callback signature:</p>
<blockquote><code><em>XenForo_Controller</em> $controller, $action</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>XenForo_Controller</em> $controller</code> - the controller instance. From this, you can inspect the request, response, etc.</li>
<li><code><em>string</em> $action</code> - the specific action that will be executed in this controller.</li>
<li><code><em>string</em> $controllerName</code> - the base class name for the controller that has been instantiated. The actual controller instance may be a child class.</li>
</ol>
<p><b>Event Hint:</b> Name of the controller class that is being run.</p>]]></event>
<event event_id="criteria_page"><![CDATA[<p>Called while testing a page against various criteria in XenForo_Helper_Criteria::pageMatchesCriteria() for trophies, notices etc.</p>
<p>Callback signature:</p>
<blockquote><code>$rule, <em>array</em> $data, <em>array</em> $params, <em>array</em> $containerData, &$returnValue</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>string</em> $rule</code> - text identifying the criteria that should be checked.</li>
<li><code><em>array</em> $data</code> - data defining the conditions of the criteria.</li>
<li><code><em>array</em> $params</code> - template parameters to use in the criteria checks.</li>
<li><code><em>array</em> $containerData</code> - container template parameters to use in the criteria checks.</li>
<li><code><em>boolean</em> &$returnValue</code> - the event code should set this to <b>true</b> if a criteria check succeeds.</li>
</ol>
<p>Example:</p>
<pre>public static function criteriaPage($rule, array $data, array $params, array $containerData, &$returnValue)
{
switch ($rule)
{
case 'p_field':
if ($params['p'] == $data['p_value'])
{
$returnValue = true;
}
break;
case 'c_check':
if ($params['c'] == $data['c'])
{
$returnValue = true;
}
break;
}
}</pre>]]></event>
<event event_id="criteria_user"><![CDATA[<p>Called while testing a user against user criteria in XenForo_Helper_Criteria::userMatchesCriteria() for trophies, notices etc.</p>
<p>Callback signature:</p>
<blockquote><code>$rule, <em>array</em> $data, <em>array</em> $user, &$returnValue</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>string</em> $rule</code> - text identifying the criteria that should be checked.</li>
<li><code><em>array</em> $data</code> - data defining the conditions of the criteria.</li>
<li><code><em>array</em> $user</code> - the user against which to check the criteria.</li>
<li><code><em>boolean</em> &$returnValue</code> - the event code should set this to <b>true</b> if a criteria check matches.</li>
</ol>
<p>Example:</p>
<pre>public static function criteriaUser($rule, array $data, array $user, &$returnValue)
{
switch ($rule)
{
case 'foo_field':
if ($user['foo_field'] == $data['foo'])
{
$returnValue = true;
}
break;
case 'bar_field':
if ($user['bar_field'] == $data['bar_value'])
{
$returnValue = true;
}
break;
}
}</pre>]]></event>
<event event_id="editor_setup"><![CDATA[<p>Called when the rich text editor is being initialized during the view.</p>
<p>Callback signature:</p>
<blockquote><code><em>XenForo_View</em> $view, $formCtrlName, &$message, <em>array</em> &$editorOptions, &$showWysiwyg</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>XenForo_View</em> $view</code> - the view object triggering this</li>
<li><code><em>string</em> $formCtrlName</code> - the name of the form control that is asking to be created</li>
<li><code><em>string</em> &$message</code> - the default message text. Can be manipulated to change this.</li>
<li><code><em>array</em> &$editorOptions</code> - options that control the setup of the editor. Can be manipulated to override things like the editor ID and template name or pass options to the editor JS.</li>
<li><code><em>boolean</em> &$showWysiwyg</code> - If true, the rich text/WYSIWYG editor will be displayed. Can be manipulated to change this.</li>
</ol>]]></event>
<event event_id="file_health_check"><![CDATA[<p>Called before the operation of the 'File Health Check' tool.</p>
<p>You may use this event to provide the hashes of the required files from your own add-on, so that your add-on can be health-checked along with the core code.</p>
<p>You should generate your hashes using XenForo_Helper_Hash::hashDirectory() against your add-on's directories, then assemble a $hashes array and build it into a class using XenForo_Helper_Hash::getHashClassCode(), so that you end up with a result similar to XenForo_Install_Data_FileSums.</p>
<p>Callback signature:</p>
<blockquote><code><em>XenForo_ControllerAdmin_Abstract</em> $controller, <em>array</em> &$hashes</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>XenForo_ControllerAdmin_Abstract</em> $controller</code> - the controller calling the event.</li>
<li><code><em>array</em> &$hashes</code> - the array of file hashes for your add-on. Keys should be the path to the file relative to the installation directory, and values should be the MD5 sum of the file contents.</li>
</ol>]]></event>
<event event_id="front_controller_post_view"><![CDATA[<p>Called after the view has been executed, before outputting. This can be used to modify the final output.</p>
<p>Callback signature:</p>
<blockquote><code><em>XenForo_FrontController</em> $fc, &$output</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>XenForo_FrontController</em> $fc</code> - the front controller instance. From this, you can inspect the request, response, dependency loader, etc.</li>
<li><code><em>string</em> &$output</code> - string to output. Note that this may not be HTML or even text.</li>
</ol>]]></event>
<event event_id="front_controller_pre_dispatch"><![CDATA[<p>Called before attempting to dispatch the request in the front controller. This could also be considered post-routing.</p>
<p>Callback signature:</p>
<blockquote><code><em>XenForo_FrontController</em> $fc, <em>XenForo_RouteMatch</em> &$routeMatch</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>XenForo_FrontController</em> $fc</code> - the front controller instance. From this, you can inspect the request, response, dependency loader, etc.</li>
<li><code><em>XenForo_RouteMatch</em> &$routeMatch</code> - the route match object. Note that this may represent an error page if routing was unsuccessful.</li>
</ol>]]></event>
<event event_id="front_controller_pre_route"><![CDATA[<p>Called before attempting to route the request in the front controller.</p>
<p>Callback signature:</p>
<blockquote><code><em>XenForo_FrontController</em> $fc</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>XenForo_FrontController</em> $fc</code> - the front controller instance. From this, you can inspect the request, response, dependency loader, etc.</li>
</ol>]]></event>
<event event_id="front_controller_pre_view"><![CDATA[<p>Called before attempting to prepare a view in the front controller. This could also be considered post-dispatch (after completing the dispatch loop).</p>
<p>Callback signature:</p>
<blockquote><code><em>XenForo_FrontController</em> $fc, <em>XenForo_ControllerResponse_Abstract</em> &$controllerResponse, <em>XenForo_ViewRenderer_Abstract</em> &$viewRenderer, <em>array</em> &$containerParams</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>XenForo_FrontController</em> $fc</code> - the front controller instance. From this, you can inspect the request, response, dependency loader, etc.</li>
<li><code><em>XenForo_ControllerResponse_Abstract</em> &$controllerResponse</code></li>
<li><code><em>XenForo_ViewRenderer_Abstract</em> &$viewRenderer</code></li>
<li><code><em>array</em> &$containerParams</code> - list of key-value parameters that will be used to help prepare/render the necessary container template.</li>
</ol>]]></event>
<event event_id="init_dependencies"><![CDATA[<p>Called when the dependency manager loads its default data. This event is fired on virtually every page and is the first thing you can plug into.</p>
<p>Callback signature:</p>
<blockquote><code><em>XenForo_Dependencies_Abstract</em> $dependencies, <em>array</em> $data</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>XenForo_Dependencies_Abstract</em> $dependencies</code></li>
<li><code><em>array</em> $data</code></li>
</ol>]]></event>
<event event_id="init_router_public"><![CDATA[<p>Called before the public dependency manager routes the request. You can use this to manipulate the routing approach.</p>
<p>Callback signature:</p>
<blockquote><code><em>XenForo_Dependencies_Abstract</em> $dependencies, <em>XenForo_Router</em> $router</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>XenForo_Dependencies_Abstract</em> $dependencies</code></li>
<li><code><em>XenForo_Router</em> $router</code></li>
</ol>]]></event>
<event event_id="load_class"><![CDATA[<p>Called when instantiating a class. This event can be used to extend the class that will be instantiated dynamically. Note that not all classes that are to be instantiated will call this but many will.</p>
<p>Callback signature:</p>
<blockquote><code>$class, <em>array</em> &$extend</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>string</em> $class</code> - the name of the class to be created</li>
<li><code><em>array</em> &$extend</code> - a modifiable list of classes that wish to extend the class. See below.</li>
</ol>
<p>To use this event properly, determine if the class is one you want to extend. If so, add a new entry to $extend with the name of the class that should extend it. This class MUST be defined as follows:</p>
<pre>class My_Class_Name extends XFCP_My_Class_Name
{
// functionality to extend/override
}</pre>
<p>This class must extend the non-existent XFCP_x class. This will be resolved at run time.</p>
<p><b>Event Hint:</b> Name of the class that is being loaded.</p>]]></event>
<event event_id="load_class_bb_code"><![CDATA[<p>Called when instantiating a BB code formatter. This event can be used to extend the class that will be instantiated dynamically.</p>
<p>Callback signature:</p>
<blockquote><code>$class, <em>array</em> &$extend</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>string</em> $class</code> - the name of the class to be created</li>
<li><code><em>array</em> &$extend</code> - a modifiable list of classes that wish to extend the class. See below.</li>
</ol>
<p>To use this event properly, determine if the class is one you want to extend. If so, add a new entry to $extend with the name of the class that should extend it. This class MUST be defined as follows:</p>
<pre>class My_Class_Name extends XFCP_My_Class_Name
{
// functionality to extend/override
}</pre>
<p>This class must extend the non-existent XFCP_x class. This will be resolved at run time.</p>
<p><b>Event Hint:</b> Name of the class that is being loaded.</p>]]></event>
<event event_id="load_class_controller"><![CDATA[<p>Called when instantiating a controller. This event can be used to extend the class that will be instantiated dynamically.</p>
<p>Callback signature:</p>
<blockquote><code>$class, <em>array</em> &$extend</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>string</em> $class</code> - the name of the class to be created</li>
<li><code><em>array</em> &$extend</code> - a modifiable list of classes that wish to extend the class. See below.</li>
</ol>
<p>To use this event properly, determine if the class is one you want to extend. If so, add a new entry to $extend with the name of the class that should extend it. This class MUST be defined as follows:</p>
<pre>class My_Class_Name extends XFCP_My_Class_Name
{
// functionality to extend/override
}</pre>
<p>This class must extend the non-existent XFCP_x class. This will be resolved at run time.</p>
<p><b>Event Hint:</b> Name of the class that is being loaded.</p>]]></event>
<event event_id="load_class_datawriter"><![CDATA[<p>Called when instantiating a data writer. This event can be used to extend the class that will be instantiated dynamically.</p>
<p>Callback signature:</p>
<blockquote><code>$class, <em>array</em> &$extend</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>string</em> $class</code> - the name of the class to be created</li>
<li><code><em>array</em> &$extend</code> - a modifiable list of classes that wish to extend the class. See below.</li>
</ol>
<p>To use this event properly, determine if the class is one you want to extend. If so, add a new entry to $extend with the name of the class that should extend it. This class MUST be defined as follows:</p>
<pre>class My_Class_Name extends XFCP_My_Class_Name
{
// functionality to extend/override
}</pre>
<p>This class must extend the non-existent XFCP_x class. This will be resolved at run time.</p>
<p><b>Event Hint:</b> Name of the class that is being loaded.</p>]]></event>
<event event_id="load_class_importer"><![CDATA[<p>Called when instantiating an importer. This event can be used to extend the class that will be instantiated dynamically.</p>
<p>Callback signature:</p>
<blockquote><code>$class, <em>array</em> &$extend</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>string</em> $class</code> - the name of the class to be created</li>
<li><code><em>array</em> &$extend</code> - a modifiable list of classes that wish to extend the class. See below.</li>
</ol>
<p>To use this event properly, determine if the class is one you want to extend. If so, add a new entry to $extend with the name of the class that should extend it. This class MUST be defined as follows:</p>
<pre>class My_Class_Name extends XFCP_My_Class_Name
{
// functionality to extend/override
}</pre>
<p>This class must extend the non-existent XFCP_x class. This will be resolved at run time.</p>
<p><b>Event Hint:</b> Name of the class that is being loaded.</p>]]></event>
<event event_id="load_class_mail"><![CDATA[<p>Called when instantiating a mail object. This event can be used to extend the class that will be instantiated dynamically.</p>
<p>Callback signature:</p>
<blockquote><code>$class, <em>array</em> &$extend</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>string</em> $class</code> - the name of the class to be created</li>
<li><code><em>array</em> &$extend</code> - a modifiable list of classes that wish to extend the class. See below.</li>
</ol>
<p>To use this event properly, determine if the class is one you want to extend. If so, add a new entry to $extend with the name of the class that should extend it. This class MUST be defined as follows:</p>
<pre>class My_Class_Name extends XFCP_My_Class_Name
{
// functionality to extend/override
}</pre>
<p>This class must extend the non-existent XFCP_x class. This will be resolved at run time.</p>
<p><b>Event Hint:</b> Name of the class that is being loaded.</p>]]></event>
<event event_id="load_class_model"><![CDATA[<p>Called when instantiating a model. This event can be used to extend the class that will be instantiated dynamically.</p>
<p>Callback signature:</p>
<blockquote><code>$class, <em>array</em> &$extend</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>string</em> $class</code> - the name of the class to be created</li>
<li><code><em>array</em> &$extend</code> - a modifiable list of classes that wish to extend the class. See below.</li>
</ol>
<p>To use this event properly, determine if the class is one you want to extend. If so, add a new entry to $extend with the name of the class that should extend it. This class MUST be defined as follows:</p>
<pre>class My_Class_Name extends XFCP_My_Class_Name
{
// functionality to extend/override
}</pre>
<p>This class must extend the non-existent XFCP_x class. This will be resolved at run time.</p>
<p><b>Event Hint:</b> Name of the class that is being loaded.</p>]]></event>
<event event_id="load_class_route_prefix"><![CDATA[<p>Called when instantiating a specific route prefix class. This event can be used to extend the class that will be instantiated dynamically.</p>
<p>Callback signature:</p>
<blockquote><code>$class, <em>array</em> &$extend</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>string</em> $class</code> - the name of the class to be created</li>
<li><code><em>array</em> &$extend</code> - a modifiable list of classes that wish to extend the class. See below.</li>
</ol>
<p>To use this event properly, determine if the class is one you want to extend. If so, add a new entry to $extend with the name of the class that should extend it. This class MUST be defined as follows:</p>
<pre>class My_Class_Name extends XFCP_My_Class_Name
{
// functionality to extend/override
}</pre>
<p>This class must extend the non-existent XFCP_x class. This will be resolved at run time.</p>
<p><b>Event Hint:</b> Name of the class that is being loaded.</p>]]></event>
<event event_id="load_class_search_data"><![CDATA[<p>Called when instantiating a search data handler. This event can be used to extend the class that will be instantiated dynamically.</p>
<p>Callback signature:</p>
<blockquote><code>$class, <em>array</em> &$extend</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>string</em> $class</code> - the name of the class to be created</li>
<li><code><em>array</em> &$extend</code> - a modifiable list of classes that wish to extend the class. See below.</li>
</ol>
<p>To use this event properly, determine if the class is one you want to extend. If so, add a new entry to $extend with the name of the class that should extend it. This class MUST be defined as follows:</p>
<pre>class My_Class_Name extends XFCP_My_Class_Name
{
// functionality to extend/override
}</pre>
<p>This class must extend the non-existent XFCP_x class. This will be resolved at run time.</p>
<p><b>Event Hint:</b> Name of the class that is being loaded.</p>]]></event>
<event event_id="load_class_view"><![CDATA[<p>Called when instantiating a view. This event can be used to extend the class that will be instantiated dynamically.</p>
<p>Callback signature:</p>
<blockquote><code>$class, <em>array</em> &$extend</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>string</em> $class</code> - the name of the class to be created</li>
<li><code><em>array</em> &$extend</code> - a modifiable list of classes that wish to extend the class. See below.</li>
</ol>
<p>To use this event properly, determine if the class is one you want to extend. If so, add a new entry to $extend with the name of the class that should extend it. This class MUST be defined as follows:</p>
<pre>class My_Class_Name extends XFCP_My_Class_Name
{
// functionality to extend/override
}</pre>
<p>This class must extend the non-existent XFCP_x class. This will be resolved at run time.</p>
<p><b>Event Hint:</b> Name of the class that is being loaded.</p>]]></event>
<event event_id="navigation_tabs"><![CDATA[<p>Called when preparing the tabs and links that are put in the main page navigation. You may use this event to add your own tabs.</p>
<p>Callback signature:</p>
<blockquote><code><em>array</em> &$extraTabs, $selectedTabId</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>array</em> &$extraTabs</code> - you may push additional tabs onto this array. Each tab must be identified with a unique key (see $selectedTabId) and be an array with the following keys:
<ul>
<li><i>title</i> - title for the main tab</li>
<li><i>href</i> - link for the root of the tab</li>
<li><i>position</i> - currently 'home', 'middle', or 'end'. This controls where the tab will show up in the navigation.</li>
<li><i>linksTemplate</i> - the name of the template that contains the links that will be displayed in the second row. The outer HTML of this template should be a <ul class="secondaryContent blockLinksList">.</li>
</ul>
</li>
<li><code><em>string</em> $selectedTabId</code> - the name of the selected tab. Select your tab if this matches.</li>
</ol>]]></event>
<event event_id="notices_prepare"><![CDATA[<p>Called before the notices are prepared for display.</p>
<p>Callback signature:</p>
<blockquote><code><em>array</em> &$noticeList, <em>array</em> &$noticeTokens, <em>XenForo_Template_Abstract</em> $template, <em>array</em> $containerData</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>array</em> $noticeList</code> - list of notices that will be displayed.</li>
<li><code><em>array</em> $noticeTokens</code> - list of tokens that will be replaced in the notice output.</li>
<li><code><em>XenForo_Template_Abstract</em> $template</code> - template object that can be used for rendering.</li>
<li><code><em>array</em> $containerData</code> - container template parameters to use in the criteria checks.</li>
</ol>]]></event>
<event event_id="option_captcha_render"><![CDATA[<p>Called when rendering the CAPTCHA option. This should be used to add additional CAPTCHA type options.</p>
<p>Callback signature:</p>
<blockquote><code><em>array</em> &$extraChoices, <em>XenForo_View</em> $view, <em>array</em> $preparedOption</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>array</em> &$extraChoices</code> - the array you should push your extra choices in to. This will be used in a <xen:options /> tag.</li>
<li><code><em>XenForo_View</em> $view</code> - the current view object.</li>
<li><code><em>array</em> $preparedOption</code> - the prepared option's data.</li>
</ol>]]></event>
<event event_id="prepare_user_change_log_field"><![CDATA[<p>Called when preparing a user change log entry for display.</p>
<p>Callback signature:</p>
<blockquote><code><em>XenForo_Model_UserChangeLog</em> $logModel, <em>array</em> &$field </code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>XenForo_Model_UserChangeLog</em> $logModel</code> - the change log model instance.</li>
<li><code><em>array</em> $field</code> - array of information about the field. This data can be modified.</li>
</ol>]]></event>
<event event_id="search_source_create"><![CDATA[<p>Called when creating the default search source handlers. Search source handlers give the opportunity to use an alternative method of searching by overriding a particular class. This event gives the option to change the name of the search source handler class that it is initialized. Note that this differs from the load_class_* events in approach.</p>
<p>Callback signature:</p>
<blockquote><code>&$class</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>string</em> &$class</code> - when called, this contains the name of the search source handler that will be instantiated. You may overwrite the value of this variable to instantiate a different class. Note that your class should inherit from XenForo_Search_SourceHandler_Abstract.</li>
</ol>]]></event>
<event event_id="template_create"><![CDATA[<p>Called whenever the template object constructor is called. You may use this event to modify the name of the template being called, to modify the params being passed to the template, or to pre-load additional templates as needed.</p>
<p>Callback signature:</p>
<blockquote><code>&$templateName, <em>array</em> &$params, <em>XenForo_Template_Abstract</em> $template</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>string</em> &$templateName</code> - the name of the template to be rendered</li>
<li><code><em>array</em> &$params</code> - key-value pairs of parameters that are available to the template</li>
<li><code><em>XenForo_Template_Abstract</em> $template</code> - the template object itself</li>
</ol>
<p><b>Event Hint:</b> Name of the template being created.</p>]]></event>
<event event_id="template_file_change"><![CDATA[<p>Called whenever a template that has been compiled to a file is updated or deleted.</p>
<p>Callback signature:</p>
<blockquote><code>$file, $action</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>string</em> $file</code> - the name of the file that has been updated</li>
<li><code><em>string</em> $action</code> - the type of update that happened, either 'write' or 'delete'</li>
</ol>
<p><b>Event Hint:</b> File name being changed.</p>]]></event>
<event event_id="template_hook"><![CDATA[<p>Called whenever a template hook is encountered (via <xen:hook> tags). You may use this event to modify the final output of that portion of the template.</p>
<p>A template hook may pass a block of final template output with it; you may either adjust this text (such as with regular expressions) or add additional output before or after the contents. Some blocks will not pass contents with them; they are primarily designed to allow you to add additional components in those positions.</p>
<p>Callback signature:</p>
<blockquote><code>$hookName, &$contents, <em>array</em> $hookParams, <em>XenForo_Template_Abstract</em> $template</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>string</em> $hookName</code> - the name of the template hook being called</li>
<li><code><em>string</em> &$contents</code> - the contents of the template hook block. This content will be the final rendered output of the block. You should manipulate this, such as by adding additional output at the end.</li>
<li><code><em>array</em> $hookParams</code> - explicit key-value params that have been passed to the hook, enabling content-aware decisions. These will not be all the params that are available to the template.</li>
<li><code><em>XenForo_Template_Abstract</em> $template</code> - the raw template object that has called this hook. You can access the template name and full, raw set of parameters via this object.</li>
</ol>
<p><b>Event Hint:</b> Name of the template hook being called.</p>]]></event>
<event event_id="template_post_render"><![CDATA[<p>Called after a template is rendered. Please note that this is only called for templates that are created via the template object directly. Templates that are included via <xen:include> will not trigger this event.</p>
<p>Callback prototype:</p>
<blockquote><code>$templateName, &$content, <em>array</em> &$containerData, <em>XenForo_Template_Abstract</em> $template</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>string</em> $templateName</code> - the name of the template that was rendered</li>
<li><code><em>string</em> &$content</code> - the final string output of the template</li>
<li><code><em>array</em> &$containerData</code> - data that this template rendered for use in the container template</li>
<li><code><em>XenForo_Template_Abstract</em> $template</code> - the template object itself</li>
</ol>
<p><b>Event Hint:</b> Name of the template being rendered.</p>]]></event>
<event event_id="visitor_setup"><![CDATA[<p>Called when the visitor object has been prepared.</p>
<p>Callback signature:</p>
<blockquote><code><em>XenForo_Visitor</em> &$visitor</code></blockquote>
<p>Arguments:</p>
<ol>
<li><code><em>XenForo_Visitor</em> &$visitor</code> - the visitor instance. From this, you can inspect the user, their permissions, profile fields etc.</li>
</ol>]]></event>
</code_events>