-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ACP module that allows to change settings
- Loading branch information
Showing
11 changed files
with
279 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/** | ||
* @author MarkusWME <[email protected]> | ||
* @copyright 2016 MarkusWME | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 | ||
*/ | ||
|
||
namespace pcgf\pmnamesuggestions\acp; | ||
|
||
/** @version 1.1.0 */ | ||
class pmnamesuggestions_info | ||
{ | ||
/** | ||
* Function that returns module information data | ||
* | ||
* @access public | ||
* @since 1.1.0 | ||
* @return array The module information array | ||
*/ | ||
public function module() | ||
{ | ||
return array( | ||
'filename' => '\pcgf\pmnamesuggestions\acp\pmnamesuggestions_module', | ||
'title' => 'ACP_PCGF_PMNAMESUGGESTIONS', | ||
'version' => '1.1.0', | ||
'modes' => array( | ||
'settings' => array( | ||
'title' => 'ACP_PCGF_PMNAMESUGGESTIONS', | ||
'auth' => 'ext_pcgf/pmnamesuggestions', | ||
'cat' => array('ACP_MESSAGES'), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
/** | ||
* @author MarkusWME <[email protected]> | ||
* @copyright 2016 MarkusWME | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 | ||
*/ | ||
|
||
namespace pcgf\pmnamesuggestions\acp; | ||
|
||
/** @version 1.1.0 */ | ||
class pmnamesuggestions_module | ||
{ | ||
/** @var string $page_title The title of the page */ | ||
public $page_title; | ||
|
||
/** @var string $tpl_name The name of the template file */ | ||
public $tpl_name; | ||
|
||
/** @var object $u_action The user action */ | ||
public $u_action; | ||
|
||
/** | ||
* Main function of the module | ||
* | ||
* @access public | ||
* @since 1.1.0 | ||
* | ||
* @param int $id The module id | ||
* @param string $mode The mode the module is beeing called with | ||
* | ||
* @return null | ||
*/ | ||
public function main($id, $mode) | ||
{ | ||
global $user, $request, $template, $config; | ||
$this->page_title = $user->lang('ACP_PCGF_PMNAMESUGGESTIONS'); | ||
$this->tpl_name = 'acp_pmnamesuggestions_body'; | ||
add_form_key('pcgf/pmnamesuggestions'); | ||
if ($request->is_set_post('submit')) | ||
{ | ||
if (!check_form_key('pcgf/pmnamesuggestions')) | ||
{ | ||
trigger_error('FORM_INVALID', E_USER_WARNING); | ||
} | ||
$config->set('pcgf_pmnamesuggestions_user_count', $request->variable('pmnamesuggestions_user_count', 5)); | ||
$config->set('pcgf_pmnamesuggestions_avatar_image_size', $request->variable('pmnamesuggestions_avatar_image_size', 20)); | ||
trigger_error($user->lang('ACP_PCGF_PMNAMESUGGESTIONS_SETTINGS_SAVED') . adm_back_link($this->u_action)); | ||
} | ||
$template->assign_vars(array( | ||
'PCGF_PMNAMESUGGESTIONS_USER_COUNT' => $config['pcgf_pmnamesuggestions_user_count'], | ||
'PCGF_PMNAMESUGGESTIONS_AVATAR_IMAGE_SIZE' => $config['pcgf_pmnamesuggestions_avatar_image_size'], | ||
'U_ACTION' => $this->u_action, | ||
)); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
pcgf/pmnamesuggestions/adm/style/acp_pmnamesuggestions_body.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!-- INCLUDE overall_header.html --> | ||
<h1>{L_ACP_PCGF_PMNAMESUGGESTIONS}</h1> | ||
<p>{L_ACP_PCGF_PMNAMESUGGESTIONS_SETTINGS_EXPLAIN}</p> | ||
<form id="acp_pcgf_pmnamesuggestions_settings" method="post" action="{U_ACTION}"> | ||
<fieldset> | ||
<legend>{L_ACP_PCGF_PMNAMESUGGESTIONS_SETTINGS}</legend> | ||
<dl> | ||
<dt> | ||
<label for="pmnamesuggestions_user_count">{L_ACP_PCGF_PMNAMESUGGESTIONS_USER_COUNT}{L_COLON}</label> | ||
<br/> | ||
<span>{L_ACP_PCGF_PMNAMESUGGESTIONS_USER_COUNT_EXPLAIN}</span> | ||
</dt> | ||
<dd> | ||
<input id="pmnamesuggestions_user_count" name="pmnamesuggestions_user_count" type="number" value="{PCGF_PMNAMESUGGESTIONS_USER_COUNT}" min="0" max="100"/> | ||
</dd> | ||
</dl> | ||
<dl> | ||
<dt> | ||
<label for="pmnamesuggestions_avatar_image_size">{L_ACP_PCGF_PMNAMESUGGESTIONS_AVATAR_IMAGE_SIZE}{L_COLON}</label> | ||
<br/> | ||
<span>{L_ACP_PCGF_PMNAMESUGGESTIONS_AVATAR_IMAGE_SIZE_EXPLAIN}</span> | ||
</dt> | ||
<dd> | ||
<input id="pmnamesuggestions_avatar_image_size" name="pmnamesuggestions_avatar_image_size" type="number" value="{PCGF_PMNAMESUGGESTIONS_AVATAR_IMAGE_SIZE}" min="0"/> | ||
<label for="pmnamesuggestions_avatar_image_size">px</label> | ||
</dd> | ||
</dl> | ||
</fieldset> | ||
<p class="submit-buttons"> | ||
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}"/> | ||
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}"/> | ||
{S_FORM_TOKEN} | ||
</p> | ||
</form> | ||
<!-- INCLUDE overall_footer.html --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
pcgf/pmnamesuggestions/language/de/info_acp_pmnamesuggestions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
/** | ||
* @author MarkusWME <[email protected]> | ||
* @copyright 2016 MarkusWME | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 | ||
* @version 1.1.0 | ||
*/ | ||
|
||
if (!defined('IN_PHPBB')) | ||
{ | ||
exit; | ||
} | ||
|
||
if (empty($lang) || !is_array($lang)) | ||
{ | ||
$lang = array(); | ||
} | ||
|
||
// Merging language data for the ACP with the other language data | ||
$lang = array_merge($lang, array( | ||
'ACP_PCGF_PMNAMESUGGESTIONS' => 'PN Namensvorschläge', | ||
'ACP_PCGF_PMNAMESUGGESTIONS_AVATAR_IMAGE_SIZE' => 'Größe der Avatar-Bilder', | ||
'ACP_PCGF_PMNAMESUGGESTIONS_AVATAR_IMAGE_SIZE_EXPLAIN' => 'Legt die Breite und die Höhe des Avatar-Bildes auf den angegebenen Wert fest. Um kein Avatar-Bild anzeigen zu lassen kann der Wert auf 0 gesetzt werden.', | ||
'ACP_PCGF_PMNAMESUGGESTIONS_SETTINGS' => 'Einstellungen', | ||
'ACP_PCGF_PMNAMESUGGESTIONS_SETTINGS_EXPLAIN' => 'Hier kannst du einige Einstellungen für die PN Namensvorschläge anpassen.', | ||
'ACP_PCGF_PMNAMESUGGESTIONS_SETTINGS_SAVED' => 'Die Einstellungen wurden erfolgreich gespeichert!', | ||
'ACP_PCGF_PMNAMESUGGESTIONS_USER_COUNT' => 'Anzahl der Vorschläge', | ||
'ACP_PCGF_PMNAMESUGGESTIONS_USER_COUNT_EXPLAIN' => 'Die maximale Anzahl der vorzuschlagenden Benutzer (Werte zwischen 0 und 100 sind erlaubt).', | ||
)); |
30 changes: 30 additions & 0 deletions
30
pcgf/pmnamesuggestions/language/en/info_acp_pmnamesuggestions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
/** | ||
* @author MarkusWME <[email protected]> | ||
* @copyright 2016 MarkusWME | ||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 | ||
* @version 1.1.0 | ||
*/ | ||
|
||
if (!defined('IN_PHPBB')) | ||
{ | ||
exit; | ||
} | ||
|
||
if (empty($lang) || !is_array($lang)) | ||
{ | ||
$lang = array(); | ||
} | ||
|
||
// Merging language data for the ACP with the other language data | ||
$lang = array_merge($lang, array( | ||
'ACP_PCGF_PMNAMESUGGESTIONS' => 'PM Name Suggestions', | ||
'ACP_PCGF_PMNAMESUGGESTIONS_AVATAR_IMAGE_SIZE' => 'Avatar image size', | ||
'ACP_PCGF_PMNAMESUGGESTIONS_AVATAR_IMAGE_SIZE_EXPLAIN' => 'Sets width and height of the avatar image to the given value. To hide the avatar image you can set the value to 0.', | ||
'ACP_PCGF_PMNAMESUGGESTIONS_SETTINGS' => 'Settings', | ||
'ACP_PCGF_PMNAMESUGGESTIONS_SETTINGS_EXPLAIN' => 'Here you can adjust the settings for PM Name Suggestions.', | ||
'ACP_PCGF_PMNAMESUGGESTIONS_SETTINGS_SAVED' => 'The settings have been saved successfully!', | ||
'ACP_PCGF_PMNAMESUGGESTIONS_USER_COUNT' => 'Suggestion count', | ||
'ACP_PCGF_PMNAMESUGGESTIONS_USER_COUNT_EXPLAIN' => 'The maximum count of suggested users (values between 0 and 100 are allowed).', | ||
)); |
Oops, something went wrong.