148 lines
3.1 KiB
PHP
148 lines
3.1 KiB
PHP
<?php
|
|
/**
|
|
*
|
|
* @package Board3 Portal v2.1
|
|
* @copyright (c) 2013 Board3 Group ( www.board3.de )
|
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
|
*
|
|
*/
|
|
|
|
namespace board3\portal\modules;
|
|
|
|
/**
|
|
* @package Links
|
|
*/
|
|
class portal_tl_menu extends module_base
|
|
{
|
|
/**
|
|
* Allowed columns: Just sum up your options (Exp: left + right = 10)
|
|
* top 1
|
|
* left 2
|
|
* center 4
|
|
* right 8
|
|
* bottom 16
|
|
*/
|
|
public $columns = 10;
|
|
|
|
/**
|
|
* Default modulename
|
|
*/
|
|
public $name = 'TL_MENU';
|
|
|
|
/**
|
|
* Default module-image:
|
|
* file must be in "{T_THEME_PATH}/images/portal/"
|
|
*/
|
|
public $image_src = 'portal_menu.png';
|
|
|
|
/**
|
|
* module-language file
|
|
* file must be in "language/{$user->lang}/mods/portal/"
|
|
*/
|
|
public $language = 'portal_tl_menu_module';
|
|
|
|
/**
|
|
* custom acp template
|
|
* file must be in "adm/style/portal/"
|
|
*/
|
|
public $custom_acp_tpl = 'acp_portal_links';
|
|
|
|
/** @var bool Can include this module multiple times */
|
|
protected $multiple_includes = true;
|
|
|
|
/**
|
|
* constants
|
|
*/
|
|
const LINK_INT = 1;
|
|
const LINK_EXT = 2;
|
|
|
|
/** @var \phpbb\config\config */
|
|
protected $config;
|
|
|
|
/** @var \phpbb\db\driver\driver_interface */
|
|
protected $db;
|
|
|
|
/** @var \phpbb\request\request */
|
|
protected $request;
|
|
|
|
/** @var \phpbb\template\template */
|
|
protected $template;
|
|
|
|
/** @var string PHP file extension */
|
|
protected $php_ext;
|
|
|
|
/** @var string phpBB root path */
|
|
protected $phpbb_root_path;
|
|
|
|
/** @var \phpbb\user */
|
|
protected $user;
|
|
|
|
/** @var \phpbb\log\log phpBB log */
|
|
protected $log;
|
|
|
|
/**
|
|
* Construct a links object
|
|
*
|
|
* @param \phpbb\config\config $config phpBB config
|
|
* @param \phpbb\db\driver\driver_interface $db phpBB db driver
|
|
* @param \phpbb\request\request $request phpBB request
|
|
* @param \phpbb\template\template $template phpBB template
|
|
* @param string $phpEx php file extension
|
|
* @param string $phpbb_root_path phpBB root path
|
|
* @param \phpbb\user $user phpBB user object
|
|
* @param \phpbb\log\log phpBB log
|
|
*/
|
|
public function __construct($config, $db, $request, $template, $phpbb_root_path, $phpEx, $user, $log)
|
|
{
|
|
$this->config = $config;
|
|
$this->db = $db;
|
|
$this->request = $request;
|
|
$this->template = $template;
|
|
$this->php_ext = $phpEx;
|
|
$this->phpbb_root_path = $phpbb_root_path;
|
|
$this->user = $user;
|
|
$this->log = $log;
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
|
|
public function get_template_side($module_id)
|
|
{
|
|
global $config, $template;
|
|
|
|
$template->assign_vars(array(
|
|
'EXAMPLE' => $config['board3_configname2_' . $module_id],
|
|
));
|
|
|
|
return 'tl_menu.html';
|
|
}
|
|
|
|
public function get_template_acp($module_id)
|
|
{
|
|
global $phpEx, $phpbb_root_path;
|
|
|
|
return array(
|
|
'title' => 'ACP_CONFIG_MODULENAME',
|
|
'vars' => array(
|
|
'legend1' => 'ACP_MODULENAME_CONFIGLEGEND',
|
|
'board3_configname_' . $module_id => array('lang' => 'MODULENAME_CONFIGNAME', 'validate' => 'string', 'type' => 'text:10:200', 'explain' => false),
|
|
'board3_configname2_' . $module_id => array('lang' => 'MODULENAME_CONFIGNAME2', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
|
),
|
|
);
|
|
}
|
|
|
|
/**
|
|
* API functions
|
|
*/
|
|
public function install($module_id)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function uninstall($module_id, $db)
|
|
{
|
|
return true;
|
|
}
|
|
} |