예제 #1
0
/**
* This function shows a form to send email to single or multiple users
*/
function show_mailer()
{
    global $xoopsConfig, $rmc_config, $rmTpl;
    $uid = rmc_server_var($_GET, 'uid', array());
    $query = rmc_server_var($_GET, 'query', '');
    if (!is_array($uid) && $uid <= 0 || empty($uid)) {
        // In admin control panel (side) add_message always must to be called before
        // ExmGUI::show_header()
        RMTemplate::get()->add_message(__('You must select one user at least. Please click on "Add Users" and select as many users as you wish.'), 0);
    }
    $uid = !is_array($uid) ? array($uid) : $uid;
    RMBreadCrumb::get()->add_crumb(__('Users Management', 'rmcommon'), 'users.php');
    RMBreadCrumb::get()->add_crumb(__('Send E-Mail', 'rmcommon'));
    $rmTpl->assign('xoops_pagetitle', __('Sending email to users', 'rmcommon'));
    xoops_cp_header();
    $form = new RMForm(__('Send Email to Users', 'rmcommon'), 'frm_mailer', 'users.php');
    $form->addElement(new RMFormUser(__('Users', 'global'), 'mailer_users', 1, $uid, 30, 600, 400));
    $form->element('mailer_users')->setDescription(__('Please note that the maximun users number that you can select depends of the limit of emails that you can send accourding to your email server policies (or hosting account policies).', 'rmcommon'));
    $form->addElement(new RMFormText(__('Message subject', 'rmcommon'), 'subject', 50, 255), true);
    $form->element('subject')->setDescription(__('Subject must be descriptive.', 'rmcommon'));
    $form->addElement(new RMFormRadio(__('Message type', 'rmcommon'), 'type', ' ', 1, 2));
    $form->element('type')->addOption(__('HTML', 'global'), 'html', 1, $rmc_config['editor_type'] == 'tiny' ? 'onclick="switchEditors.go(\'message\', \'tinymce\');"' : '');
    $form->element('type')->addOption(__('Plain Text', 'global'), 'text', 0, $rmc_config['editor_type'] == 'tiny' ? 'onclick="switchEditors.go(\'message\', \'html\');"' : '');
    $form->addElement(new RMFormEditor(__('Message content', 'rmcommon'), 'message', '99%', '300px', ''), true);
    $ele = new RMFormButtonGroup();
    $ele->addButton('sbt', __('Send E-Mail', 'rmcommon'), 'submit');
    $ele->addButton('cancel', __('Cancel', 'rmcommon'), 'button', 'onclick="history.go(-1);"');
    $form->addElement($ele);
    $form->addElement(new RMFormHidden('action', 'sendmail'));
    $form->addElement(new RMFormHidden('query', $query));
    $form->display();
    xoops_cp_footer();
}
예제 #2
0
/**
* @desc Visualiza lista de usuarios para determinar moderadores
**/
function bx_moderators()
{
    global $xoopsModule;
    $id = rmc_server_var($_REQUEST, 'id', 0);
    if ($id <= 0) {
        redirectMsg('forums.php', __('No forum ID has been provided!', 'bxpress'), 1);
        die;
    }
    $forum = new bXForum($id);
    if ($forum->isNew()) {
        redirectMsg('forums.php', __('Specified forum does not exists!', 'bxpress'), 1);
        break;
    }
    RMTemplate::get()->set_help('http://www.redmexico.com.mx/docs/bxpress-forums/foros/standalone/1/#moderadores');
    xoops_cp_header();
    //Lista de usuarios
    $form = new RMForm(sprintf(__('Forum "%s" Moderators', 'bxpress'), $forum->name()), 'formmdt', 'forums.php');
    $form->addElement(new RMFormUser(__('Moderators', 'bxpress'), 'users', 1, $forum->moderators(), 30), true, 'checked');
    $form->element('users')->setDescription(__('Choose from the list the moderators users', 'bxpress'));
    $buttons = new RMFormButtonGroup();
    $buttons->addButton('sbt', __('Save Moderators', 'bxpress'), 'submit');
    $buttons->addButton('cancel', __('Cancel', 'bxpress'), 'button', 'onclick="window.location.href=\'forums.php\';"');
    $form->addElement($buttons);
    $form->addElement(new RMFormHidden('action', 'savemoderat'));
    $form->addElement(new RMFormHidden('id', $id));
    $form->display();
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; " . __('forum Moderators', 'bxpress'));
    xoops_cp_footer();
}
예제 #3
0
/**
* Formulario para crear publicaciones
**/
function rd_show_form($edit = 0)
{
    global $xoopsModule, $xoopsConfig, $xoopsModuleConfig;
    RDFunctions::toolbar();
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; " . ($edit ? __('Editing Document', 'docs') : __('Create Document', 'docs')));
    xoops_cp_header();
    $id = rmc_server_var($_GET, 'id', 0);
    $page = rmc_server_var($_GET, 'page', 1);
    if ($edit) {
        //Comprueba si la publicación es válida
        if ($id <= 0) {
            redirectMsg('./resources.php?page=' . $page, __('You must provide an ID from some Document to edit!', 'docs'), 1);
            die;
        }
        //Comprueba si la publicación existe
        $res = new RDResource($id);
        if ($res->isNew()) {
            redirectMsg('./resources.php?page=' . $page, __('Specified Document does not exists!', 'docs'), 1);
            die;
        }
    }
    $form = new RMForm($edit ? sprintf(__('Edit Document: %s', 'docs'), $res->getVar('title')) : __('New Document', 'docs'), 'frmres', 'resources.php');
    $form->addElement(new RMFormText(__('Document title', 'docs'), 'title', 50, 150, $edit ? $res->getVar('title') : ''), true);
    if ($edit) {
        $form->addElement(new RMFormText(__('Document slug', 'docs'), 'nameid', 50, 150, $res->getVar('nameid')));
    }
    $form->addElement(new RMFormTextArea(__('Description', 'docs'), 'desc', 5, 50, $edit ? $res->getVar('description', 'e') : ''), true);
    $form->addElement(new RMFormUser(__('Editors', 'docs'), 'editors', 1, $edit ? $res->getVar('editors') : '', 30));
    //Propietario de la publicacion
    if ($edit) {
        $form->addElement(new RMFormUser(__('Document owner', 'docs'), 'owner', 0, $edit ? array($res->getVar('owner')) : '', 30));
    }
    $form->addElement(new RMFormYesno(__('Approve content and changes by editors', 'docs'), 'approvededit', $edit ? $res->getVar('editor_approve') : 0));
    $form->addElement(new RMFormGroups(__('Groups that can see this Document', 'docs'), 'groups', 1, 1, 5, $edit ? $res->getVar('groups') : array(1, 2)), true);
    $form->addElement(new RMFormYesno(__('Set as public', 'docs', 'docs'), 'public', $edit ? $res->getVar('public') : 0));
    $form->addElement(new RMFormYesNo(__('Quick index', 'docs'), 'quick', $edit ? $res->getVar('quick') : 0));
    //Mostrar índice a usuarios sin permiso de publicación
    $form->addElement(new RMFormYesno(__('Show index to restricted users', 'docs'), 'showindex', $edit ? $res->getVar('show_index') : 0));
    $form->addElement(new RMFormYesno(__('Featured', 'docs'), 'featured', $edit ? $res->getVar('featured') : 0));
    $form->addElement(new RMFormYesno(__('Approve inmediatly', 'docs'), 'approvedres', $edit ? $res->getVar('approved') : 1));
    $form->addElement(new RMFormYesno(__('Show content in a single page', 'docs'), 'single', $edit ? $res->getVar('single') : 0));
    $form->element('single')->setDescription(__('When you enable this option the Document content will show in a single page.', 'docs'));
    $buttons = new RMFormButtonGroup();
    $buttons->addButton('sbt', $edit ? __('Update Document', 'docs') : __('Create Document', 'docs'), 'submit');
    $buttons->addButton('cancel', __('Cancel', 'docs'), 'button', 'onclick="window.location=\'resources.php\';"');
    $form->addElement($buttons);
    $form->addElement(new RMFormHidden('action', $edit ? 'saveedit' : 'save'));
    if ($edit) {
        $form->addElement(new RMFormHidden('id', $id));
    }
    $form->addElement(new RMFormHidden('page', $page));
    $form->addElement(new RMFormHidden('app', $edit ? $res->getVar('approved') : 0));
    $form->display();
    xoops_cp_footer();
}