File size: 2Kb
<?php
/**
This software is furnished under a license and may be used and copied
only in accordance with the terms of such license and with the
inclusion of the above copyright notice. This software or any other
copies thereof may not be provided or otherwise made available to any
other person. No title to and ownership of the software is hereby
transferred.
You may not reverse engineer, decompile, defeat license encryption
mechanisms, or disassemble this software product or software product
license. AddonsLab may terminate this license if you don't comply with
any of these terms and conditions. In such event, licensee agrees
to return licensor or destroy all copies of software upon termination
of the license.
*/
namespace AddonsLab\Core\vB3;
use AddonsLab\Core\OptionProviderInterface;
class OptionProvider implements OptionProviderInterface
{
/**
* @var \vB_Registry
*/
protected $vb;
/**
* OptionProvider constructor.
*/
public function __construct()
{
$this->vb=$GLOBALS['vbulletin'];
}
public function getOption($optionId, $subOption = null)
{
$option=$this->vb->options[$optionId];
if(!empty($subOption)) {
return $option[$subOption];
}
return $option;
}
public function setOption($optionId, $subOption, $value = null)
{
if ($value === null) {
$value = $subOption;
$subOption = null;
$this->vb->options[$optionId]=$value;
} else {
$option = $this->getOption($optionId);
$option[$subOption] = $value;
$this->vb->options[$optionId] = $option;
}
}
public function getBoardTitle()
{
return $this->getOption('bbtitle');
}
public function getBoardUrl()
{
return $this->getOption('bburl');
}
}