Skip to content

Commit

Permalink
remove namespace and pre_load
Browse files Browse the repository at this point in the history
Signed-off-by: Diego Andrés <diegoandres_cortes@outlook.com>
  • Loading branch information
DiegoAndresCortes committed Apr 22, 2022
1 parent bdb5daf commit a16a92c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
13 changes: 2 additions & 11 deletions Sources/Class-PSL.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,12 @@
* @version 0.1
*/

namespace smftricks;

/**
* Generated by SimpleModMaker
*/
final class PSL
{
public function hooks()
{
// add_integration_function('integrate_hook_name', __CLASS__ . '::methodName#', false, __FILE__);
add_integration_function('integrate_post_end', __CLASS__ . '::postEnd#', false, __FILE__);
add_integration_function('integrate_modify_post_settings', __CLASS__ . '::modifyPostSettings#', false, __FILE__);
}

public function postEnd()
public static function postEnd()
{
global $modSettings, $smcFunc, $topic, $context;

Expand All @@ -38,7 +29,7 @@ public function postEnd()
$context['posting_fields']['subject']['input']['attributes']['maxlength'] = $modSettings['p_s_l_psl_subject_length'] + (!empty($topic) ? $smcFunc['strlen']($context['response_prefix']) : 0);
}

public function modifyPostSettings(&$config_vars)
public static function modifyPostSettings(&$config_vars)
{
global $txt;

Expand Down
8 changes: 5 additions & 3 deletions package-info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
<id>smftricks:PSL</id>
<name>Post Subject Length</name>
<version>0.1</version>
<version>0.2</version>
<type>modification</type>
<install for="2.1.*">
<readme lang="english" parsebbc="true" type="file">readme/readme.english.txt</readme>
Expand All @@ -15,11 +15,13 @@
</license>
<require-dir name="Sources" destination="$boarddir"/>
<require-dir name="Themes" destination="$boarddir"/>
<hook hook="integrate_pre_load" function="smftricks\PSL::hooks#" file="$sourcedir/Class-PSL.php"/>
<hook hook="integrate_post_end" function="PSL::postEnd" file="$sourcedir/Class-PSL.php"/>
<hook hook="integrate_modify_post_settings" function="PSL::modifyPostSettings" file="$sourcedir/Class-PSL.php"/>
<redirect url="?action=admin;area=postsettings" timeout="3000"/>
</install>
<uninstall for="2.1.*">
<hook hook="integrate_pre_load" function="smftricks\PSL::hooks#" file="$sourcedir/Class-PSL.php" reverse="true"/>
<hook hook="integrate_post_end" function="PSL::postEnd" file="$sourcedir/Class-PSL.php" reverse="true"/>
<hook hook="integrate_modify_post_settings" function="PSL::modifyPostSettings" file="$sourcedir/Class-PSL.php" reverse="true"/>
<remove-file name="$sourcedir/Class-PSL.php"/>
<remove-file name="$languagedir/PSL.english.php"/>
</uninstall>
Expand Down

0 comments on commit a16a92c

Please sign in to comment.