pm = new pmbox_manager(); $this->prefs = $this->pm->prefs(); } function sc_pm_nav($parm='') { $tp = e107::getParser(); if(!check_class($this->prefs['pm_class'])) { return null; } $mbox = $this->pm->pm_getInfo('inbox'); if(!empty($mbox['inbox']['new'])) { $count = "".$mbox['inbox']['new'].""; $icon = $tp->toGlyph('fa-envelope'); } else { $icon = $tp->toGlyph('fa-envelope-o'); $count = ''; } $urlInbox = e107::url('pm','index','', array('query'=>array('mode'=>'inbox'))); $urlOutbox = e107::url('pm','index','', array('query'=>array('mode'=>'outbox'))); $urlCompose = e107::url('pm','index','', array('query'=>array('mode'=>'send'))); return ''.$icon.$count.' '; } /** * @param array|string $parm - User ID or array of values (see below) * @param int $parm['user'] * @param string $parm['glyph'] * @param string $parm['class'] * * @return null|string */ function sc_sendpm($parm=null) { // global $sysprefs, $pm_prefs; // $pm_prefs = $sysprefs->getArray("pm_prefs"); if(is_string($parm)) { $parm = array('user'=>$parm); } $pm_prefs = e107::getPlugPref('pm'); $url = e107::url('pm','index').'?send.'.$parm['user']; require_once(e_PLUGIN."pm/pm_class.php"); $pm = new private_message; $glyph = empty($parm['glyph']) ? 'fa-paper-plane' : $parm['glyph']; $class = empty($parm['class']) ? 'btn btn-sm btn-default' : $parm['class']; if(check_class($pm_prefs['pm_class']) && $pm->canSendTo($parm['user'])) // check $this->pmPrefs['send_to_class']. { if(deftrue('FONTAWESOME') && deftrue('BOOTSTRAP')) { $img = e107::getParser()->toGlyph($glyph,''); return "{$img} ".LAN_PLUGIN_PM_NEW.""; } if(file_exists(THEME.'forum/pm.png')) { $img = "".LAN_PM.""; } else { $img = "".LAN_PM.""; } return "{$img}"; } else { return null; } } }