";
if(!empty($this->notify_prefs['plugins']))
{
foreach ($this->notify_prefs['plugins'] as $plugin_id => $plugin_settings)
{
if(is_readable(e_PLUGIN.$plugin_id.'/e_notify.php'))
{
$config_category = $this->pluginConfig[$plugin_id]['category'];
$legacy = $this->pluginConfig[$plugin_id]['legacy'];
// require(e_PLUGIN.$plugin_id.'/e_notify.php');
$text .= "
";
}
}
}
$text .= "
";
$text .= $frm->admin_button('update', LAN_UPDATE,'update');
$text .= "
";
$ns -> tablerender(NT_LAN_1, $mes->render() . $text);
*/
}
function render_event($id, $description, $include='', $legacy = 0)
{
$tp = e107::getParser();
$frm = e107::getForm();
$uc = e107::getUserClass();
$uc->fixed_classes['email'] = 'Email Address =>';
$uc->text_class_link['email'] = 'email';
if(defined($description))
{
$description = constant($description);
}
$highlight = varset($_GET['type']) == $id ? " class='text-warning'" : '';
$text = "
".$description.": |
".$uc->uc_dropdown('event['.$id.'][class]', varset($this->notify_prefs['event'][$id]['class'], e_UC_NOBODY), "nobody,main,admin,member,classes,email","onchange=\"mail_field(this.value,'event_".$id."');\" ");
if($this -> notify_prefs['event'][$id]['class'] == 'email')
{
$disp='display:visible';
$value = $tp -> toForm($this -> notify_prefs['event'][$id]['email']);
}
else
{
$disp = "display:none";
$value= "";
}
$text .= "\n";
$text .= $frm->hidden("event[".$id."][include]", $include);
$text .= $frm->hidden("event[".$id."][legacy]", $legacy); // function or method
if(isset($this->notify_prefs['event'][$id]['class']) && $this->notify_prefs['event'][$id]['class'] != e_UC_NOBODY)
{
$text .= $frm->button('test['.$id.']', $id, 'confirm', 'Test');
}
$text .= " |
";
return $text;
}
function update()
{
$this->changeList = array();
$active = false;
foreach ($_POST['event'] as $key => $value)
{
if ($this -> update_event($key))
{
$active = true;
}
}
// print_a($this->notify_prefs);
/*
$s_prefs = $tp -> toDB($this -> notify_prefs);
$s_prefs = $eArrayStorage -> WriteArray($s_prefs);
if($sql -> db_Update("core", "e107_value='".$s_prefs."' WHERE e107_name='notify_prefs'")!==FALSE)
*/
e107::getConfig()->set('notify',$active)->save(true,true,false);
e107::getConfig('notify')->updatePref($this->notify_prefs);
if (e107::getConfig('notify')->save(FALSE))
{
// e107::getAdminLog()->logArrayAll('NOTIFY_01',$this->changeList);
return true;
}
else
{
return false;
}
}
function update_event($id)
{
$changed = FALSE;
if ($this -> notify_prefs['event'][$id]['class'] != $_POST['event'][$id]['class'])
{
$this -> notify_prefs['event'][$id]['class'] = $_POST['event'][$id]['class'];
$changed = TRUE;
}
if ($this -> notify_prefs['event'][$id]['email'] != $_POST['event'][$id]['email'])
{
$this -> notify_prefs['event'][$id]['email'] = $_POST['event'][$id]['email'];
$changed = TRUE;
}
$this -> notify_prefs['event'][$id]['include'] = $_POST['event'][$id]['include'];
$this -> notify_prefs['event'][$id]['legacy'] = $_POST['event'][$id]['legacy'];
unset($this -> notify_prefs['event'][$id]['plugin']);
unset($this -> notify_prefs['event'][$id]['type']);
if ($changed)
{
$this->changeList[$id] = $this->notify_prefs['event'][$id]['class'].', '.$this->notify_prefs['event'][$id]['email'];
}
if ($this -> notify_prefs['event'][$id]['class'] != 255)
{
return TRUE;
}
else
{
return FALSE;
}
}
}
require_once(e_ADMIN.'footer.php');
function headerjs()
{
$js = "
";
return $js;
}
?>