示例#1
0
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);
}
示例#2
0
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);
}
示例#3
0
function showconfig($confightml, &$database, $option)
{
    global $database, $mosConfig_absolute_path;
    $row = new mosCE_Config();
    $row->bindGlobals();
    // compile list of the languages
    $editor_lang = array();
    if ($handle = opendir("{$mosConfig_absolute_path}/mambots/editors/mostlyce/jscripts/tiny_mce/langs/")) {
        $i = 0;
        while (false !== ($file = readdir($handle))) {
            if ($file != "." && $file != "..") {
                $editor_lang[] = mosHTML::makeOption(substr($file, 0, -3));
            }
        }
        closedir($handle);
    }
    // sort list of languages
    sort($editor_lang);
    reset($editor_lang);
    $lists = array();
    $editor_newlines = array(mosHTML::makeOption('br', T_('BR Elements')), mosHTML::makeOption('p', T_('P Elements')));
    $editor_themes = array(mosHTML::makeOption('advanced', T_('Advanced')), mosHTML::makeOption('simple', T_('Simple')));
    $editor_compression = array(mosHTML::makeOption('true', T_('On')), mosHTML::makeOption('false', T_('Off')));
    $editor_direction = array(mosHTML::makeOption('ltr', T_('Left to Right')), mosHTML::makeOption('rtl', T_('Right to Left')));
    //Non-specific, used by several plugins
    $editor_true_false = array(mosHTML::makeOption('true', T_('Yes')), mosHTML::makeOption('false', T_('No')));
    $php_settings = new mosCE_Config();
    // build the html select lists
    //Standard Editor options
    $lists['editor_themes'] = mosHTML::selectList($editor_themes, 'editor_themes', 'class="inputbox" size="1"', 'value', 'text', $row->editor_themes);
    $lists['editor_compression'] = mosHTML::selectList($editor_compression, 'editor_compression', 'class="inputbox" size="1"', 'value', 'text', $row->editor_compression);
    $lists['editor_lang'] = mosHTML::selectList($editor_lang, 'editor_lang', 'class="inputbox" size="1"', 'value', 'text', $row->editor_lang);
    $lists['editor_css_override'] = mosHTML::yesnoSelectList('editor_css_override', 'class="inputbox" size="1"', $row->editor_css_override);
    $lists['editor_newlines'] = mosHTML::selectList($editor_newlines, 'editor_newlines', 'class="inputbox" size="1"', 'value', 'text', $row->editor_newlines);
    $lists['editor_convert_urls'] = mosHTML::selectList($editor_true_false, 'editor_convert_urls', 'class="inputbox" size="1"', 'value', 'text', $row->editor_convert_urls);
    $lists['editor_script_acl'] = mosHTML::selectList($editor_true_false, 'editor_script_acl', 'class="inputbox" size="1"', 'value', 'text', $row->editor_script_acl);
    $lists['editor_iframe_acl'] = mosHTML::selectList($editor_true_false, 'editor_iframe_acl', 'class="inputbox" size="1"', 'value', 'text', $row->editor_iframe_acl);
    $lists['editor_direction'] = mosHTML::selectList($editor_direction, 'editor_direction', 'class="inputbox" size="1"', 'value', 'text', $row->editor_direction);
    //Editor Plugin options
    $lists['editor_font_tools_acl'] = mosHTML::selectList($editor_true_false, 'editor_font_tools_acl', 'class="inputbox" size="1"', 'value', 'text', $row->editor_font_tools_acl);
    $lists['editor_plugin_emotions_acl'] = mosHTML::selectList($editor_true_false, 'editor_plugin_emotions_acl', 'class="inputbox" size="1"', 'value', 'text', $row->editor_plugin_emotions_acl);
    $lists['editor_plugin_print'] = mosHTML::selectList($editor_true_false, 'editor_plugin_print', 'class="inputbox" size="1"', 'value', 'text', $row->editor_plugin_print);
    $lists['editor_plugin_searchreplace'] = mosHTML::selectList($editor_true_false, 'editor_plugin_searchreplace', 'class="inputbox" size="1"', 'value', 'text', $row->editor_plugin_searchreplace);
    $lists['editor_plugin_media_acl'] = mosHTML::selectList($editor_true_false, 'editor_plugin_media_acl', 'class="inputbox" size="1"', 'value', 'text', $row->editor_plugin_media_acl);
    $lists['editor_plugin_datetime_acl'] = mosHTML::selectList($editor_true_false, 'editor_plugin_datetime_acl', 'class="inputbox" size="1"', 'value', 'text', $row->editor_plugin_datetime_acl);
    $lists['editor_plugin_table_acl'] = mosHTML::selectList($editor_true_false, 'editor_plugin_table_acl', 'class="inputbox" size="1"', 'value', 'text', $row->editor_plugin_table_acl);
    $lists['editor_plugin_spellchecker'] = mosHTML::selectList($editor_true_false, 'editor_plugin_spellchecker', 'class="inputbox" size="1"', 'value', 'text', $row->editor_plugin_spellchecker);
    $lists['editor_plugin_layer'] = mosHTML::selectList($editor_true_false, 'editor_plugin_layer', 'class="inputbox" size="1"', 'value', 'text', $row->editor_plugin_layer);
    $lists['editor_plugin_img_mgr'] = mosHTML::selectList($editor_true_false, 'editor_plugin_img_mgr', 'class="inputbox" size="1"', 'value', 'text', $row->editor_plugin_img_mgr);
    $lists['editor_mosimage_icon'] = mosHTML::selectList($editor_true_false, 'editor_mosimage_icon', 'class="inputbox" size="1"', 'value', 'text', $row->editor_mosimage_icon);
    $confightml->showconfig($row, $lists, $option);
}
示例#4
0
/**
* Displays front page settings option
*/
function viewSettings($option, $act)
{
    global $database;
    $database->setQuery("SELECT col_main FROM #__templates WHERE id=0");
    $col = $database->loadResult();
    $params = array();
    $database->setQuery("SELECT params FROM #__menu WHERE link='index.php?option=com_frontpage'");
    $param = mosParseParams($database->loadResult());
    $params['count'] = isset($param->count) ? $param->count : 6;
    $params['intro'] = isset($param->intro) ? $param->intro : 3;
    $params['image'] = @$param->image ? 1 : 0;
    $params['header'] = @$param->header;
    $params['empty'] = @$param->empty;
    $params['orderby'] = @$param->orderby;
    $params['image'] = mosHTML::yesnoSelectList('image', 'class="inputbox" size="1"', $params['image']);
    $orderby[] = mosHTML::makeOption('ordering', 'Ordering');
    $orderby[] = mosHTML::makeOption('date', 'Date asc');
    $orderby[] = mosHTML::makeOption('rdate', 'Date desc');
    $params['orderby'] = mosHTML::selectList($orderby, 'orderby', 'class="inputbox" size="1"', 'value', 'text', $params['orderby']);
    HTML_content::showSettings($col, $option, $params, $act);
}
示例#5
0
function editUser($uid = '0', $option = 'users')
{
    global $database, $my, $acl;
    //$row = new mosUser( $database );
    //load the row from the db table
    //$row->load( $uid );
    if ($uid) {
        $sql = "SELECT u.id as editid, u.*, c.* , e.* from #__users as u, #__user_extended_config as c";
        $sql .= " LEFT JOIN #__user_extended AS e ON u.id = e.id";
        $sql .= " WHERE u.id = '{$uid}'";
        $sql .= " AND c.id = '1'";
    } else {
        $sql = "SELECT  c.* from #__user_extended_config as c WHERE c.id = '1'";
    }
    $database->SetQuery($sql);
    $rows = $database->LoadObjectList();
    if ($database->getErrorNum()) {
        echo $database->stderr();
        return false;
    }
    $row = $rows[0];
    $lists = array();
    $my_group = strtolower($acl->get_group_name($row->gid, 'ARO'));
    if ($my_group == 'super administrator') {
        $lists['gid'] = "<input type=\"hidden\" name=\"gid\" value=\"{$my->gid}\" /><strong>Super Administrator</strong>";
    } else {
        // ensure user can't add group higher than themselves
        $my_groups = $acl->get_object_groups('users', $my->id, 'ARO');
        if (is_array($my_groups) && count($my_groups) > 0) {
            $ex_groups = $acl->get_group_children($my_groups[0], 'ARO', 'RECURSE');
        } else {
            $ex_groups = array();
        }
        $gtree = $acl->get_group_children_tree(null, 'USERS', false);
        // remove users 'above' me
        $i = 0;
        while ($i < count($gtree)) {
            if (in_array($gtree[$i]->value, $ex_groups)) {
                array_splice($gtree, $i, 1);
            } else {
                $i++;
            }
        }
        $lists['gid'] = mosHTML::selectList($gtree, 'gid', 'size="4"', 'value', 'text', $row->gid);
    }
    // make the select list for yes/no fields
    $yesno[] = mosHTML::makeOption('0', 'No');
    $yesno[] = mosHTML::makeOption('1', 'Yes');
    // build the html select list
    $lists['block'] = mosHTML::yesnoSelectList('block', 'class="inputbox" size="1"', $row->block);
    // build the html select list
    $lists['sendEmail'] = mosHTML::yesnoSelectList('sendEmail', 'class="inputbox" size="1"', $row->sendEmail);
    //HTML_users::edituser( $row, $lists, $option, $uid );
    UserExtended_users::edituser($row, $lists, $option, $uid);
}