-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
444 changed files
with
2,657 additions
and
3,269 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 |
---|---|---|
|
@@ -5,4 +5,5 @@ Backup/ | |
|
||
/node_modules/ | ||
/build/ | ||
/develop/ | ||
/vendor/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* | ||
* Advanced BBCode Box | ||
* | ||
* @copyright (c) 2020 Matt Friedman | ||
* @license GNU General Public License, version 2 (GPL-2.0) | ||
* | ||
*/ | ||
|
||
namespace vse\abbc3\acp; | ||
|
||
class abbc3_info | ||
{ | ||
public function module() | ||
{ | ||
return [ | ||
'filename' => '\vse\abbc3\acp\abbc3_module', | ||
'title' => 'ACP_ABBC3_MODULE', | ||
'modes' => [ | ||
'settings' => [ | ||
'title' => 'ACP_ABBC3_SETTINGS', | ||
'auth' => 'ext_vse/abbc3 && acl_a_board', | ||
'cat' => ['ACP_ABBC3_MODULE'], | ||
], | ||
], | ||
]; | ||
} | ||
} |
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,134 @@ | ||
<?php | ||
/** | ||
* | ||
* Advanced BBCode Box | ||
* | ||
* @copyright (c) 2020 Matt Friedman | ||
* @license GNU General Public License, version 2 (GPL-2.0) | ||
* | ||
*/ | ||
|
||
namespace vse\abbc3\acp; | ||
|
||
class abbc3_module | ||
{ | ||
/** @var \phpbb\cache\driver\driver_interface */ | ||
protected $cache; | ||
|
||
/** @var \phpbb\config\config */ | ||
protected $config; | ||
|
||
/** @var \Symfony\Component\DependencyInjection\ContainerInterface */ | ||
protected $container; | ||
|
||
/** @var \phpbb\db\driver\driver_interface */ | ||
protected $db; | ||
|
||
/** @var \phpbb\language\language */ | ||
protected $language; | ||
|
||
/** @var \phpbb\request\request */ | ||
protected $request; | ||
|
||
/** @var \phpbb\template\template */ | ||
protected $template; | ||
|
||
/** @var string */ | ||
public $page_title; | ||
|
||
/** @var string */ | ||
public $tpl_name; | ||
|
||
/** @var string */ | ||
public $u_action; | ||
|
||
/** | ||
* Constructor | ||
*/ | ||
public function __construct() | ||
{ | ||
global $phpbb_container; | ||
|
||
$this->container = $phpbb_container; | ||
$this->cache = $this->container->get('cache'); | ||
$this->config = $this->container->get('config'); | ||
$this->db = $this->container->get('dbal.conn'); | ||
$this->language = $this->container->get('language'); | ||
$this->request = $this->container->get('request'); | ||
$this->template = $this->container->get('template'); | ||
} | ||
|
||
/** | ||
* Main ACP module | ||
*/ | ||
public function main() | ||
{ | ||
$this->language->add_lang('abbc3', 'vse/abbc3'); | ||
|
||
$this->tpl_name = 'acp_abbc3_settings'; | ||
$this->page_title = $this->language->lang('ACP_ABBC3_SETTINGS'); | ||
|
||
$form_key = 'vse/abbc3'; | ||
add_form_key($form_key); | ||
|
||
if ($this->request->is_set_post('submit')) | ||
{ | ||
if (!check_form_key($form_key)) | ||
{ | ||
trigger_error('FORM_INVALID', E_USER_WARNING); | ||
} | ||
|
||
$this->save_settings(); | ||
} | ||
|
||
$this->display_settings(); | ||
} | ||
|
||
/** | ||
* Add settings template vars to the form | ||
*/ | ||
protected function display_settings() | ||
{ | ||
$this->template->assign_vars([ | ||
'S_ABBC3_PIPES' => $this->config['abbc3_pipes'], | ||
'S_ABBC3_BBCODE_BAR' => $this->config['abbc3_bbcode_bar'], | ||
'S_ABBC3_QR_BBCODES' => $this->config['abbc3_qr_bbcodes'], | ||
'S_ABBC3_ICONS_TYPE' => build_select(['png' => 'PNG', 'svg' => 'SVG'], $this->config['abbc3_icons_type']), | ||
'U_ACTION' => $this->u_action, | ||
]); | ||
} | ||
|
||
/** | ||
* Save settings data to the database | ||
*/ | ||
protected function save_settings() | ||
{ | ||
$this->config->set('abbc3_bbcode_bar', $this->request->variable('abbc3_bbcode_bar', 0)); | ||
$this->config->set('abbc3_qr_bbcodes', $this->request->variable('abbc3_qr_bbcodes', 0)); | ||
$this->config->set('abbc3_icons_type', $this->request->variable('abbc3_icons_type', 'png')); | ||
$this->save_pipes(); | ||
|
||
trigger_error($this->language->lang('CONFIG_UPDATED') . adm_back_link($this->u_action)); | ||
} | ||
|
||
/** | ||
* Save the Pipes Table setting. | ||
* - Set the config | ||
* - Show or hide the Pipes BBCode button | ||
* - Purge BBCode caches. | ||
*/ | ||
protected function save_pipes() | ||
{ | ||
$enable_pipes = $this->request->variable('abbc3_pipes', 0); | ||
|
||
$this->config->set('abbc3_pipes', $enable_pipes); | ||
|
||
$sql = 'UPDATE ' . BBCODES_TABLE . ' | ||
SET display_on_posting = ' . (int) $enable_pipes . " | ||
WHERE bbcode_tag = 'pipes'"; | ||
$this->db->sql_query($sql); | ||
|
||
$this->cache->destroy($this->container->getParameter('text_formatter.cache.parser.key')); | ||
$this->cache->destroy($this->container->getParameter('text_formatter.cache.renderer.key')); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,69 @@ | ||
{% include 'overall_header.html' %} | ||
{% INCLUDECSS '@vse_abbc3/acp_abbc3.css' %} | ||
|
||
<img src="{{ ROOT_PATH }}ext/vse/abbc3/adm/images/abbc3logo.png" alt="{{ lang('ACP_ABBC3_MODULE') }}"> | ||
|
||
<p>{{ lang('ABBC3_SETTINGS_EXPLAIN') }}</p> | ||
|
||
<form id="abbc3_settings" method="post" action="{{ U_ACTION }}" data-ajax="true"> | ||
<fieldset> | ||
<legend>{{ lang('ABBC3_LEGEND_ICON_BAR') }}</legend> | ||
<dl> | ||
<dt><label for="abbc3_bbcode_bar">{{ lang('ABBC3_BBCODE_BAR') ~ lang('COLON') }}</label><br><span>{{ lang('ABBC3_BBCODE_BAR_EXPLAIN') }}</span></dt> | ||
<dd><label><input type="radio" class="radio" name="abbc3_bbcode_bar" id="abbc3_bbcode_bar" value="1"{% if S_ABBC3_BBCODE_BAR %} checked="checked"{% endif %}> {{ lang('YES') }}</label> | ||
<label><input type="radio" class="radio" name="abbc3_bbcode_bar" value="0"{% if not S_ABBC3_BBCODE_BAR %} checked="checked"{% endif %}> {{ lang('NO') }}</label></dd> | ||
</dl> | ||
<dl> | ||
<dt><label for="abbc3_icons_type">{{ lang('ABBC3_ICONS_TYPE') ~ lang('COLON') }}</label><br><span>{{ lang('ABBC3_ICONS_TYPE_EXPLAIN') }}</span></dt> | ||
<dd> | ||
<select name="abbc3_icons_type" id="abbc3_icons_type">{{ S_ABBC3_ICONS_TYPE }}</select> | ||
{% set ABBC3_ICON_PATH = ROOT_PATH ~ 'ext/vse/abbc3/images/icons/' %} | ||
{% for ext in ['png', 'svg'] %} | ||
<div class="abbc3-bar abbc3-icons-{{ ext }} hidden"> | ||
<span style="background-image:url('{{ ABBC3_ICON_PATH }}bold.{{ ext }}')"></span> | ||
<span style="background-image:url('{{ ABBC3_ICON_PATH }}italic.{{ ext }}')"></span> | ||
<span style="background-image:url('{{ ABBC3_ICON_PATH }}underline.{{ ext }}')"></span> | ||
<span style="background-image:url('{{ ABBC3_ICON_PATH }}quote.{{ ext }}')"></span> | ||
<span style="background-image:url('{{ ABBC3_ICON_PATH }}code.{{ ext }}')"></span> | ||
<span style="background-image:url('{{ ABBC3_ICON_PATH }}listb.{{ ext }}')"></span> | ||
<span style="background-image:url('{{ ABBC3_ICON_PATH }}listo.{{ ext }}')"></span> | ||
<span style="background-image:url('{{ ABBC3_ICON_PATH }}listitem.{{ ext }}')"></span> | ||
<span style="background-image:url('{{ ABBC3_ICON_PATH }}img.{{ ext }}')"></span> | ||
<span style="background-image:url('{{ ABBC3_ICON_PATH }}url.{{ ext }}')"></span> | ||
<span style="background-image:url('{{ ABBC3_ICON_PATH }}fontcolor.{{ ext }}')"></span> | ||
</div> | ||
{% endfor %} | ||
</dd> | ||
</dl> | ||
</fieldset> | ||
<fieldset> | ||
<legend>{{ lang('ABBC3_LEGEND_ADD_ONS') }}</legend> | ||
<dl> | ||
<dt><label for="abbc3_qr_bbcodes">{{ lang('ABBC3_QR_BBCODES') ~ lang('COLON') }}</label><br><span>{{ lang('ABBC3_QR_BBCODES_EXPLAIN') }}</span></dt> | ||
<dd><label><input type="radio" class="radio" name="abbc3_qr_bbcodes" id="abbc3_qr_bbcodes" value="1"{% if S_ABBC3_QR_BBCODES %} checked="checked"{% endif %}> {{ lang('YES') }}</label> | ||
<label><input type="radio" class="radio" name="abbc3_qr_bbcodes" value="0"{% if not S_ABBC3_QR_BBCODES %} checked="checked"{% endif %}> {{ lang('NO') }}</label></dd> | ||
</dl> | ||
<dl> | ||
<dt><label for="abbc3_pipes">{{ lang('ABBC3_PIPES') ~ lang('COLON') }}</label><br><span>{{ lang('ABBC3_PIPES_EXPLAIN') }}</span></dt> | ||
<dd><label><input type="radio" class="radio" name="abbc3_pipes" id="abbc3_pipes" value="1"{% if S_ABBC3_PIPES %} checked="checked"{% endif %}> {{ lang('YES') }}</label> | ||
<label><input type="radio" class="radio" name="abbc3_pipes" value="0"{% if not S_ABBC3_PIPES %} checked="checked"{% endif %}> {{ lang('NO') }}</label></dd> | ||
</dl> | ||
</fieldset> | ||
<fieldset class="submit-buttons"> | ||
<input class="button1" type="submit" id="submit" name="submit" value="{{ lang('SUBMIT') }}"> | ||
<input class="button2" type="reset" id="reset" name="reset" value="{{ lang('RESET') }}"> | ||
{{ S_FORM_TOKEN }} | ||
</fieldset> | ||
</form> | ||
|
||
<script> | ||
const select = document.querySelector("select[name='abbc3_icons_type']"); | ||
document.querySelector(".abbc3-icons-" + select.value).classList.toggle("hidden"); | ||
select.addEventListener("change", () => { | ||
document.querySelectorAll(".abbc3-bar").forEach(bar => { | ||
bar.classList.toggle("hidden"); | ||
}); | ||
}); | ||
</script> | ||
|
||
{% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<fieldset> | ||
<legend>{{ lang('ACP_GROUPS_PERMISSIONS') }}</legend> | ||
<dl> | ||
<dt><label for="bbcode_group">{{ lang('ABBC3_BBCODE_GROUP') }}</label><br /><br /><span>{{ lang('ABBC3_BBCODE_GROUP_INFO') }}</span></dt> | ||
<dt><label for="bbcode_group">{{ lang('ABBC3_BBCODE_GROUP') }}</label><br><br><span>{{ lang('ABBC3_BBCODE_GROUP_INFO') }}</span></dt> | ||
<dd><select id="bbcode_group" name="bbcode_group[]" size="10" multiple="multiple">{{ S_GROUP_OPTIONS }}</select></dd> | ||
</dl> | ||
</fieldset> |
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
{% INCLUDEJS '@vse_abbc3/js/abbc3.min.js' %} | ||
{% INCLUDECSS '@vse_abbc3/abbc3_common.min.css' %} | ||
{% INCLUDECSS '@vse_abbc3/abbc3_posting.min.css' %} | ||
{% include '@vse_abbc3/abbc3_posting_buttons.html' %} | ||
{% if S_ABBC3_BBCODES_BAR %} | ||
{% INCLUDECSS '@vse_abbc3/abbc3_posting.min.css' %} | ||
{% include '@vse_abbc3/abbc3_posting_buttons.html' %} | ||
{% endif %} |
Oops, something went wrong.