/**
 * Parses a string from the language file with the correct variables replaced in the message
 *
 * @param string $status is either 'on' or 'off'
 * @param string $type is either 'sms' or 'email'
 * @param array $server information about the server which may be placed in a message: %KEY% will be replaced by your value
 * @return string parsed message
 */
function sm_parse_msg($status, $type, $vars)
{
    $message = '';
    $message = sm_get_lang('notifications', $status . '_' . $type);
    if (!$message) {
        return $message;
    }
    $vars['date'] = date('Y-m-d H:i:s');
    foreach ($vars as $k => $v) {
        $message = str_replace('%' . strtoupper($k) . '%', $v, $message);
    }
    return $message;
}
 protected function createHTMLLabels()
 {
     $this->tpl->addTemplateData($this->getTemplateId(), array('label_status' => sm_get_lang('log', 'status'), 'label_email' => sm_get_lang('log', 'email'), 'label_sms' => sm_get_lang('log', 'sms'), 'label_title' => sm_get_lang('log', 'title'), 'label_server' => sm_get_lang('servers', 'server'), 'label_type' => sm_get_lang('log', 'type'), 'label_message' => sm_get_lang('system', 'message'), 'label_date' => sm_get_lang('system', 'date'), 'label_users' => ucfirst(sm_get_lang('system', 'users'))));
     return parent::createHTMLLabels();
 }
 protected function createHTMLLabels()
 {
     $this->tpl->addTemplateData($this->getTemplateId(), array('label_settings_email' => sm_get_lang('config', 'settings_email'), 'label_settings_sms' => sm_get_lang('config', 'settings_sms'), 'label_settings_notification' => sm_get_lang('config', 'settings_notification'), 'label_settings_log' => sm_get_lang('config', 'settings_log'), 'label_general' => sm_get_lang('config', 'general'), 'label_language' => sm_get_lang('config', 'language'), 'label_language_english' => sm_get_lang('config', 'english'), 'label_language_dutch' => sm_get_lang('config', 'dutch'), 'label_language_french' => sm_get_lang('config', 'french'), 'label_language_german' => sm_get_lang('config', 'german'), 'label_show_update' => sm_get_lang('config', 'show_update'), 'label_email_status' => sm_get_lang('config', 'email_status'), 'label_email_from_email' => sm_get_lang('config', 'email_from_email'), 'label_email_from_name' => sm_get_lang('config', 'email_from_name'), 'label_sms_status' => sm_get_lang('config', 'sms_status'), 'label_sms_gateway' => sm_get_lang('config', 'sms_gateway'), 'label_sms_gateway_mollie' => sm_get_lang('config', 'sms_gateway_mollie'), 'label_sms_gateway_spryng' => sm_get_lang('config', 'sms_gateway_spryng'), 'label_sms_gateway_inetworx' => sm_get_lang('config', 'sms_gateway_inetworx'), 'label_sms_gateway_clickatell' => sm_get_lang('config', 'sms_gateway_clickatell'), 'label_sms_gateway_username' => sm_get_lang('config', 'sms_gateway_username'), 'label_sms_gateway_password' => sm_get_lang('config', 'sms_gateway_password'), 'label_sms_from' => sm_get_lang('config', 'sms_from'), 'label_alert_type' => sm_get_lang('config', 'alert_type'), 'label_alert_type_description' => sm_get_lang('config', 'alert_type_description'), 'label_alert_type_status' => sm_get_lang('config', 'alert_type_status'), 'label_alert_type_offline' => sm_get_lang('config', 'alert_type_offline'), 'label_alert_type_always' => sm_get_lang('config', 'alert_type_always'), 'label_log_status' => sm_get_lang('config', 'log_status'), 'label_log_email' => sm_get_lang('config', 'log_email'), 'label_log_sms' => sm_get_lang('config', 'log_sms'), 'label_auto_refresh_servers' => sm_get_lang('config', 'auto_refresh_servers')));
     return parent::createHTMLLabels();
 }
 protected function createHTMLLabels()
 {
     $this->tpl->addTemplateData($this->getTemplateId(), array('label_label' => sm_get_lang('servers', 'label'), 'label_domain' => sm_get_lang('servers', 'domain'), 'label_port' => sm_get_lang('servers', 'port'), 'label_type' => sm_get_lang('servers', 'type'), 'label_last_check' => sm_get_lang('servers', 'last_check'), 'label_rtime' => sm_get_lang('servers', 'rtime'), 'label_last_online' => sm_get_lang('servers', 'last_online'), 'label_monitoring' => sm_get_lang('servers', 'monitoring'), 'label_send_email' => sm_get_lang('servers', 'send_email'), 'label_send_sms' => sm_get_lang('servers', 'send_sms'), 'label_action' => sm_get_lang('system', 'action'), 'label_save' => sm_get_lang('system', 'save'), 'label_edit' => sm_get_lang('system', 'edit') . ' ' . sm_get_lang('servers', 'server'), 'label_delete' => sm_get_lang('system', 'delete') . ' ' . sm_get_lang('servers', 'server'), 'label_yes' => sm_get_lang('system', 'yes'), 'label_no' => sm_get_lang('system', 'no'), 'label_add_new' => sm_get_lang('system', 'add_new')));
     return parent::createHTMLLabels();
 }
 /**
  * Use this to add language specific labels to template
  *
  * @see createHTML()
  */
 protected function createHTMLLabels()
 {
     global $type;
     $this->tpl->addTemplateData('main', array('title' => strtoupper(sm_get_lang('system', 'title')), 'subtitle' => sm_get_lang('system', $type), 'active_' . $type => 'active', 'label_servers' => sm_get_lang('system', 'servers'), 'label_users' => sm_get_lang('system', 'users'), 'label_log' => sm_get_lang('system', 'log'), 'label_config' => sm_get_lang('system', 'config'), 'label_update' => sm_get_lang('system', 'update'), 'label_help' => sm_get_lang('system', 'help')));
 }
 protected function createHTMLLabels()
 {
     $this->tpl->addTemplateData($this->getTemplateId(), array('label_users' => sm_get_lang('system', 'users'), 'label_name' => sm_get_lang('users', 'name'), 'label_mobile' => sm_get_lang('users', 'mobile'), 'label_email' => sm_get_lang('users', 'email'), 'label_servers' => sm_get_lang('system', 'servers'), 'label_action' => sm_get_lang('system', 'action'), 'label_save' => sm_get_lang('system', 'save'), 'label_edit' => sm_get_lang('system', 'edit') . ' ' . sm_get_lang('users', 'user'), 'label_delete' => sm_get_lang('system', 'delete') . ' ' . sm_get_lang('users', 'user'), 'label_add_new' => sm_get_lang('system', 'add_new')));
     return parent::createHTMLLabels();
 }