| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php defined('BX_DOL') or die('hack attempt');
- /**
- * Copyright (c) UNA, Inc - https://una.io
- * MIT License - https://opensource.org/licenses/MIT
- *
- * @defgroup UnaBaseView UNA Base Representation Classes
- * @{
- */
- /**
- * Menu representation.
- * @see BxDolMenu
- */
- class BxBaseMenuAccountNotifications extends BxTemplMenu
- {
- public function __construct ($aObject, $oTemplate)
- {
- parent::__construct ($aObject, $oTemplate);
- $this->addMarkers(array(
- 'studio_url' => BX_DOL_URL_STUDIO
- ));
- }
- /**
- * Check if menu items is visible with extended checking for friends notifications
- * @param $a menu item array
- * @return boolean
- */
- protected function _isVisible ($a)
- {
- // default visible settings
- if (!BxDolAcl::getInstance()->isMemberLevelInSet($a['visible_for_levels']))
- return false;
-
- switch ($a['name']) {
- case 'studio':
- if (!isAdmin())
- return false;
- break;
- case 'notifications-cart':
- $oPayments = BxDolPayments::getInstance();
- if(!$oPayments->isActive())
- return false;
- break;
- case 'notifications-orders':
- $oPayments = BxDolPayments::getInstance();
- if(!$oPayments->isActive())
- return false;
- break;
- // show only friends for currently active profile for friend request notification
- case 'notifications-friend-requests':
- case 'profile-stats-friend-requests':
- case 'profile-stats-subscriptions':
- case 'profile-stats-subscribed-me':
- $aInfo = BxDolProfile::getInstance()->getInfo();
- if($a['module'] != $aInfo['type'])
- return false;
- break;
- }
- return true;
- }
- protected function _getTmplVarsAddon($mixedAddon, $aMenuItem)
- {
- return array(
- 'addon' => $mixedAddon,
- 'addonf' => $this->_oTemplate->parseHtmlByName('menu_item_addon.html', array(
- 'content' => $mixedAddon
- ))
-
- );
- }
- }
- /** @} */
|