The Gitlab instance will be restarted on Monday April 28th at 2AM. There will be a short interruption of service.

Skip to content
Snippets Groups Projects
Commit 876322c1 authored by Demian Katz's avatar Demian Katz
Browse files

Added lists setting (not used yet).

parent 3c8137c7
No related merge requests found
......@@ -1068,6 +1068,8 @@ max_tag_length = 64
[Social]
; Comments may be "enabled" or "disabled" (default = "enabled")
comments = enabled
; Favorite lists may be "enabled" or "disabled" (default = "enabled")
lists = enabled
; Tags may be "enabled" or "disabled" (default = "enabled")
; When disabling tags, don't forget to also turn off tag search in searches.ini.
tags = enabled
......@@ -443,6 +443,22 @@ class Factory
);
}
/**
* Construct the UserList helper.
*
* @param ServiceManager $sm Service manager.
*
* @return UserList
*/
public static function getUserList(ServiceManager $sm)
{
$cfg = $sm->getServiceLocator()->get('VuFind\Config')->get('config');
$mode = !isset($cfg->Social->lists)
|| ($cfg->Social->lists && $cfg->Social->lists !== 'disabled')
? 'enabled' : 'disabled';
return new UserList($mode);
}
/**
* Construct the UserTags helper.
*
......
......@@ -39,6 +39,33 @@ use VuFind\Db\Row\UserList as UserListRow, Zend\View\Helper\AbstractHelper;
*/
class UserList extends AbstractHelper
{
/**
* List mode (enabled or disabled)
*
* @var string
*/
protected $mode;
/**
* Constructor
*
* @param string $mode List mode (enabled or disabled)
*/
public function __construct($mode = 'enabled')
{
$this->mode = $mode;
}
/**
* Get mode
*
* @return string
*/
public function getMode()
{
return $this->mode;
}
/**
* Retrieve the ID of the last list that was accessed, if any.
*
......
......@@ -32,6 +32,7 @@ return array(
'searchtabs' => 'VuFind\View\Helper\Root\Factory::getSearchTabs',
'syndeticsplus' => 'VuFind\View\Helper\Root\Factory::getSyndeticsPlus',
'systememail' => 'VuFind\View\Helper\Root\Factory::getSystemEmail',
'userlist' => 'VuFind\View\Helper\Root\Factory::getUserList',
'usertags' => 'VuFind\View\Helper\Root\Factory::getUserTags',
'videoclips' => 'VuFind\View\Helper\Root\Factory::getVideoClips',
'worldcat' => 'VuFind\View\Helper\Root\Factory::getWorldCat',
......@@ -53,7 +54,6 @@ return array(
'transesc' => 'VuFind\View\Helper\Root\TransEsc',
'translate' => 'VuFind\View\Helper\Root\Translate',
'truncate' => 'VuFind\View\Helper\Root\Truncate',
'userlist' => 'VuFind\View\Helper\Root\UserList',
)
),
);
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment