function editConfig($option) { global $database, $my; $database->setQuery("SELECT cfg_name, cfg_value FROM #__messages_cfg WHERE user_id='{$my->id}'"); $data = $database->loadObjectList('cfg_name'); $vars = array(); $vars['lock'] = mosHTML::yesnoSelectList("vars[lock]", 'class="inputbox" size="1"', @$data['lock']->cfg_value); $vars['mail_on_new'] = mosHTML::yesnoSelectList("vars[mail_on_new]", 'class="inputbox" size="1"', @$data['mail_on_new']->cfg_value); HTML_messages::editConfig($vars, $option); }
function editConfig($option) { global $database, $my; $query = "SELECT cfg_name, cfg_value" . "\n FROM #__messages_cfg" . "\n WHERE user_id = " . (int) $my->id; $database->setQuery($query); $data = $database->loadObjectList('cfg_name'); // initialize values if they do not exist if (!isset($data['lock']->cfg_value)) { $data['lock']->cfg_value = 0; } if (!isset($data['mail_on_new']->cfg_value)) { $data['mail_on_new']->cfg_value = 0; } if (!isset($data['auto_purge']->cfg_value)) { $data['auto_purge']->cfg_value = 7; } $vars = array(); $vars['lock'] = mosHTML::yesnoSelectList("vars[lock]", 'class="inputbox" size="1"', $data['lock']->cfg_value); $vars['mail_on_new'] = mosHTML::yesnoSelectList("vars[mail_on_new]", 'class="inputbox" size="1"', $data['mail_on_new']->cfg_value); $vars['auto_purge'] = (int) $data['auto_purge']->cfg_value; HTML_messages::editConfig($vars, $option); }
function editConfig($option) { $db =& JFactory::getDBO(); $user =& JFactory::getUser(); $query = 'SELECT cfg_name, cfg_value' . ' FROM #__messages_cfg' . ' WHERE user_id = ' . (int) $user->get('id'); $db->setQuery($query); $data = $db->loadObjectList('cfg_name'); // initialize values if they do not exist if (!isset($data['lock']->cfg_value)) { $data['lock']->cfg_value = 0; } if (!isset($data['mail_on_new']->cfg_value)) { $data['mail_on_new']->cfg_value = 0; } if (!isset($data['auto_purge']->cfg_value)) { $data['auto_purge']->cfg_value = 7; } $vars = array(); $vars['lock'] = JHTML::_('select.booleanlist', "vars[lock]", '', $data['lock']->cfg_value, 'yes', 'no', 'varslock'); $vars['mail_on_new'] = JHTML::_('select.booleanlist', "vars[mail_on_new]", '', $data['mail_on_new']->cfg_value, 'yes', 'no', 'varsmail_on_new'); $vars['auto_purge'] = $data['auto_purge']->cfg_value; HTML_messages::editConfig($vars, $option); }