예제 #1
0
/**
* Publish widget
* @return array
*/
function mywords_widget_publish($post = null, $frontend = false)
{
    global $xoopsUser;
    RMTemplate::get()->add_style('publish_widget.css', 'mywords');
    RMTemplate::get()->add_style('forms.css', 'rmcommon');
    RMTemplate::get()->add_style('jquery.css', 'rmcommon');
    RMTemplate::get()->add_script('scripts.php?file=posts.js', 'mywords', array('directory' => 'include', 'footer' => 1));
    RMTemplate::get()->add_script(XOOPS_URL . '/modules/mywords/include/js/mktime.js');
    RMTemplate::get()->add_script('forms.js', 'rmcommon');
    $widget['title'] = __('Publish', 'mywords');
    $widget['icon'] = '';
    $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : 0;
    $edit = false;
    if (isset($post) && is_a($post, 'MWPost') && !$post->isNew()) {
        $edit = true;
        switch ($post->getVar('status')) {
            case 'draft':
                $status = __('Draft', 'mywords');
                break;
            case 'pending':
                $status = __('Pending review', 'mywords');
                break;
            case 'publish':
                $status = __('Published', 'mywords');
                break;
            case 'scheduled':
                $status = __('Scheduled', 'mywords');
                break;
        }
        $visibility = $post->getVar('visibility') == 'public' ? 'Public' : ($post->getVar('visibility') == 'password' ? 'Password Protected' : 'Private');
    } else {
        $status = 'Published';
        $visibility = 'Public';
    }
    ob_start();
    ?>
<div class="rmc_widget_content_reduced publish_container">
<form id="mw-post-publish-form">
<!-- Opciones de Publicación -->
<div class="publish_options">
<?php 
    _e('Status:', 'mywords');
    ?>
 <strong id="publish-status-legend"><?php 
    _e($status, 'mywords');
    ?>
</strong> &nbsp; <a href="javascript:;" id="edit-publish"><?php 
    _e('Edit', 'mywords');
    ?>
</a>
	<div id="publish-options" style="display: none;">
		<select name="status" id="status">
            <option value="publish"<?php 
    echo $edit && $post->getVar('status') == 'publish' ? 'selected="selected"' : ($edit ? '' : 'selected="selected"');
    ?>
><?php 
    _e('Published', 'mywords');
    ?>
</option>
			<option value="draft"<?php 
    echo $edit && $post->getVar('status') == 'draft' ? 'selected="selected"' : '';
    ?>
><?php 
    _e('Draft', 'mywords');
    ?>
</option>
			<option value="pending"<?php 
    echo $edit && $post->getVar('status') == 'pending' ? 'selected="selected"' : '';
    ?>
><?php 
    _e('Pending Review', 'mywords');
    ?>
</option>
		</select>
		<input type="button" name="publish-ok" id="publish-ok" class="button" value="<?php 
    _e('Apply', 'mywords');
    ?>
" /><br />
		<a href="javascript:;" onclick="$('#publish-options').slideUp('slow'); $('#edit-publish').show();"><?php 
    _e('Cancel', 'mywords');
    ?>
</a>
	</div>
</div>
<!-- //Opciones de Publicación -->
<!-- Visibilidad -->
<div class="publish_options">
<?php 
    _e('Visibility:', 'mywords');
    ?>
 <strong id="visibility-caption"><?php 
    _e($visibility, 'mywords');
    ?>
</strong> &nbsp; <a href="javascript:;" id="visibility-edit"><?php 
    _e('Edit', 'mywords');
    ?>
</a>
<?php 
    if (!$edit) {
        $visibility = 'public';
    } else {
        $visibility = $post->getVar('visibility');
    }
    ?>
    <div id="visibility-options">
        <input type="radio" name="visibility" value="public" id="visibility-public"<?php 
    echo $visibility == 'public' ? ' checked="checked"' : '';
    ?>
 /> <label for="visibility-public"><?php 
    _e('Public', 'mywords');
    ?>
</label><br />
        <input type="radio" name="visibility" value="password" id="visibility-password"<?php 
    echo $visibility == 'password' ? ' checked="checked"' : '';
    ?>
 /> <label for="visibility-password"><?php 
    _e('Password protected', 'mywords');
    ?>
</label><br />
        <span id="vis-password-text" style="<?php 
    _e($visibility == 'password' ? '' : 'display: none');
    ?>
">
            <label>
            <?php 
    _e('Password:'******'mywords');
    ?>
            <input type="text" name="vis_password" id="vis-password" value="<?php 
    echo $edit ? $post->getVar('password') : '';
    ?>
" class="options_input" />
            </label>
        <br /></span>
        <input type="radio" name="visibility" value="private" id="visibility-private"<?php 
    echo $visibility == 'private' ? ' checked="checked"' : '';
    ?>
 /> <label for="visibility-private"><?php 
    _e('Private', 'mywords');
    ?>
</label><br /><br />
        <input type="button" name="vis-button" id="vis-button" value="<?php 
    _e('Apply', 'mywords');
    ?>
" class="button" />
        <a href="javascript:;" id="vis-cancel"><?php 
    _e('Cancel', 'mywords');
    ?>
</a>
    </div>
</div>
<!-- /Visibilidad -->
<!-- Schedule -->
<div class="publish_options">
<?php 
    _e('Publish', 'mywords');
    ?>
 <strong id="schedule-caption"><?php 
    echo $edit ? $post->getVar('pubdate') > 0 ? __('Inmediatly', 'mywords') : date("d, M Y \\@ H:i", $post->getVar('schedule')) : __('Inmediatly', 'mywords');
    ?>
</strong> &nbsp; <a href="javascript:;" class="edit-schedule"><?php 
    _e('Edit', 'mywords');
    ?>
</a>
    <div class="schedule-options" style="display: none;">
        <?php 
    // Determinamos la fecha correcta
    $time = $edit ? $post->getVar('pubdate') > 0 ? $post->getVar('pubdate') : $post->getVar('schedule') : time();
    $day = date("d", $time);
    $month = date("n", $time);
    $year = date("Y", $time);
    $hour = date("H", $time);
    $minute = date("i", $time);
    $months = array(__('Jan', 'mywords'), __('Feb', 'mywords'), __('Mar', 'mywords'), __('Apr', 'mywords'), __('May', 'mywords'), __('Jun', 'mywords'), __('Jul', 'mywords'), __('Aug', 'mywords'), __('Sep', 'mywords'), __('Oct', 'mywords'), __('Nov', 'mywords'), __('Dec', 'mywords'));
    ?>
        <input type="text" name="schedule_day" id="schedule-day" size="2" maxlength="2" value="<?php 
    _e($day);
    ?>
" />
        <select name="schedule_month" id="schedule-month">
            <?php 
    for ($i = 1; $i <= 12; $i++) {
        ?>
                <option value="<?php 
        echo $i;
        ?>
" <?php 
        if ($month == $i) {
            echo 'selected="selected"';
        }
        ?>
><?php 
        echo $months[$i - 1];
        ?>
</option>
            <?php 
    }
    ?>
        </select>
        <input type="text" name="schedule_year" id="schedule-year" size="2" maxlength="4" value="<?php 
    echo $year;
    ?>
" /> @
        <input type="text" name="schedule_hour" id="schedule-hour" size="2" maxlength="2" value="<?php 
    echo $hour;
    ?>
" /> :
        <input type="text" name="schedule_minute" id="schedule-minute" size="2" maxlength="2" value="<?php 
    echo $minute;
    ?>
" /><br /><br />
        <input type="button" class="button" name="schedule-ok" id="schedule-ok" value="<?php 
    _e('Apply', 'mywords');
    ?>
" />
        <a href="javascript:;" class="schedule-cancel"><?php 
    _e('Cancel', 'mywords');
    ?>
</a>
        <input type="hidden" name="schedule" id="schedule" value="<?php 
    echo "{$day}-{$month}-{$year}-{$hour}-{$minute}";
    ?>
" />
    </div>
</div>
<!-- /Shedule -->
    <?php 
    if (!$frontend) {
        ?>
        <div class="publish_options no_border">
        <?php 
        _e('Author:', 'mywords');
        ?>
        <?php 
        $user = new RMFormUser('', 'author', 0, $edit ? array($post->getVar('author')) : array($xoopsUser->uid()));
        if (!$xoopsUser->isAdmin()) {
            $user->button(false);
        }
        echo $user->render();
        ?>
        </div>
    <?php 
    } else {
        ?>
        <input type="hidden" name="author" value="<?php 
        echo $xoopsUser->uid();
        ?>
">
    <?php 
    }
    ?>
<div class="widget_button">

<button type="button" class="button default btn btn-primary" id="publish-submit"><?php 
    $edit ? _e('Update Post', 'mywords') : _e('Publish', 'mywords');
    ?>
</button>
</div>


</form>
</div>
<?php 
    $widget['content'] = ob_get_clean();
    return $widget;
}
예제 #2
0
                    <div class="form-group">
                        <label for="new-bio"><?php 
    _e('Biography:', 'mywords');
    ?>
</label>
                        <textarea name="bio" id="new-bio" class="form-control" rows="4"></textarea>
                    </div>

                    <div class="form-group">
                        <label for="new-user"><?php 
    _e('Registered user:'******'mywords');
    ?>
</label>
                        <?php 
    $ele = new RMFormUser('', 'new_user');
    echo $ele->render();
    ?>
                    </div>

                    <div class="form-group">
                        <label for="new-perm"><?php 
    _e('Privilieges:', 'mywords');
    ?>
</label>
                        <div class="checkbox">
                            <label><input type="checkbox" name="perms[]" value="tags" checked="checked" /> <?php 
    _e('Create tags', 'mywords');
    ?>
</label>
                        </div>
예제 #3
0
/**
* Author information
*/
function dt_widget_credits($edit = 0)
{
    global $xoopsUser;
    //$widget['title'] = __('Author Information','dtransport');
    //$widget['icon'] = '../images/author.png';
    if ($edit) {
        $sw = new DTSoftware(rmc_server_var($_GET, 'id', 0));
    } else {
        $sw = new DTSoftware();
    }
    $field = new RMFormUser('', 'user', 0, $edit ? array($sw->getVar('uid')) : $xoopsUser->uid(), 50);
    $user = $field->render();
    unset($field);
    ob_start();
    ?>
    <form name="frmCredits" id="frm-credits" method="post">
    <div id="tab-credits" class="widgets_forms">
        <div class="item">
            <label><?php 
    _e('Published by', 'dtransport');
    ?>
</label>
            <?php 
    echo $user;
    ?>
        </div>
        <div class="item">
            <label for="author"><?php 
    _e('Author name', 'dtransport');
    ?>
</label>
            <input type="text" name="author" id="author" value="<?php 
    echo $edit ? $sw->getVar('author_name') : '';
    ?>
" class="fullwidth" />
        </div>
        <div class="item">
            <label for="url"><?php 
    _e('Author URL', 'dtransport');
    ?>
</label>
            <input type="text" name="url" id="url" value="<?php 
    echo $edit ? $sw->getVar('author_url') : '';
    ?>
" class="fullwidth" />
        </div>
        <div class="item">
            <label for="email"><?php 
    _e('Author Email', 'dtransport');
    ?>
</label>
            <input type="text" name="email" id="email" value="<?php 
    echo $edit ? $sw->getVar('author_email') : $xoopsUser->email();
    ?>
" class="fullwidth" />
            <span class="description"><?php 
    _e('This email will not be visible for users', 'dtransport');
    ?>
</span>
        </div>
        <div class="item">
            <input type="checkbox" name="contact" id="contact" value="1"<?php 
    echo $sw->getVar('author_contact') ? ' checked="checked"' : '';
    ?>
 /> <?php 
    _e('Author can be contacted', 'dtransport');
    ?>
        </div>
    </div>
    </form>
    <?php 
    $content = ob_get_clean();
    return $content;
}
예제 #4
0
function configure_rm_plugin()
{
    $name = rmc_server_var($_GET, 'plugin', '');
    if ($name == '') {
        redirectMsg('plugins.php', __('You must specify a existing plugin', 'rmcommon'), 1);
        die;
    }
    $plugin = new RMPlugin($name);
    if ($plugin->isNew()) {
        redirectMsg('plugins.php', __('Specified plugin is not installed yet!', 'rmcommon'), 1);
        die;
    }
    if (!$plugin->getVar('status')) {
        redirectMsg('plugins.php', __('Specified plugin is not active!', 'rmcommon'), 1);
        die;
    }
    $rmc_config = RMFunctions::configs();
    $settings = RMFunctions::get()->plugin_settings($name, true);
    $form = new RMForm(sprintf(__('%s configuration', 'rmcommon'), $plugin->getVar('name')), 'frmconfig', 'plugins.php');
    $form->addElement(new RMFormHidden('plugin', $plugin->getVar('dir')));
    $form->addElement(new RMFormHidden('action', 'savesettings'));
    foreach ($plugin->options() as $config => $option) {
        if (isset($settings[$config])) {
            $option['value'] = $settings[$config];
        }
        if (isset($option['separator']) && !empty($option['separator'])) {
            $form->addElement(new RMFormSubTitle($option['separator']['title'], 1, '', $option['separator']['desc']));
            continue;
        }
        switch ($option['fieldtype']) {
            case 'checkbox_groups':
            case 'group_multi':
                $ele = new RMFormGroups($option['caption'], 'conf_' . $config, 1, 1, 3, $option['value']);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'radio_groups':
                $ele = new RMFormGroups($option['caption'], 'conf_' . $config, 0, 1, 3, $option['value']);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'group':
            case 'select_groups':
                $ele = new RMFormGroups($option['caption'], 'conf_' . $config, 0, 0, 3, $option['value']);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'select_groups_multi':
                $ele = new RMFormGroups($option['caption'], 'conf_' . $config, 1, 0, 3, $option['value']);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'editor':
                if ($rmc_config['editor_type'] == 'tiny') {
                    $tiny = TinyEditor::getInstance();
                    $tiny->add_config('elements', 'conf_' . $config);
                }
                $ele = new RMFormEditor($option['caption'], 'conf_' . $config, is_numeric($option['size']) ? '90%' : $option['size'], '300px', $option['value'], '', 1, array('op'));
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'theme':
            case 'select_theme':
                $ele = new RMFormTheme($option['caption'], 'conf_' . $config, 0, 0, $option['value'], 3);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'theme_multi':
            case 'select_theme_multi':
                $ele = new RMFormTheme($option['caption'], 'conf_' . $config, 0, 1, $option['value'], 3);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'checkbox_theme':
                $ele = new RMFormTheme($option['caption'], 'conf_' . $config, 1, 1, $option['value'], 4);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'select_theme_admin':
                $ele = new RMFormTheme($option['caption'], 'conf_' . $config, 0, 0, $option['value'], 3, 'GUI');
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'yesno':
                $ele = new RMFormYesNo($option['caption'], 'conf_' . $config, $option['value']);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'email':
                $ele = new RMFormText($option['caption'], 'conf_' . $config, $option['size'] > 0 ? $option['size'] : 50, null, $option['value']);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele, false, 'email');
                break;
            case 'select':
                $ele = new RMFormSelect($option['caption'], 'conf_' . $config);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                foreach ($option['options'] as $op => $opvalue) {
                    $ele->addOption($opvalue, $op, $opvalue == $option['value'] ? 1 : 0);
                }
                $form->addElement($ele);
                break;
            case 'select_multi':
                $ele = new RMFormSelect($option['caption'], 'conf_' . $config . '[]', 1, $option['value']);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                foreach ($option['options'] as $op => $opvalue) {
                    $ele->addOption($opvalue, $op);
                }
                $form->addElement($ele);
                break;
            case 'language':
            case 'select_language':
                $ele = new RMFormLanguageField($option['caption'], 'conf_' . $config, 0, 0, $option['value'], 3);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'select_language_multi':
                $ele = new RMFormLanguageField($option['caption'], 'conf_' . $config, 1, 0, $option['value'], 3);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'checkbox_language':
                $ele = new RMFormLanguageField($option['caption'], 'conf_' . $config, 1, 1, $option['value'], 3);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'startpage':
            case 'select_modules':
                $ele = new RMFormModules($option['caption'], 'conf_' . $config, 0, 0, $option['value'], 3);
                $ele->setInserted(array('--' => __('None', 'rmcommon')));
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'select_modules_multi':
                $ele = new RMFormModules($option['caption'], 'conf_' . $config, 1, 0, $option['value'], 3);
                $ele->setInserted(array('--' => __('None', 'rmcommon')));
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'checkbox_modules':
                $ele = new RMFormModules($option['caption'], 'conf_' . $config, 1, 1, $option['value'], 3);
                $ele->setInserted(array('--' => __('None', 'rmcommon')));
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'radio_modules':
                $ele = new RMFormModules($option['caption'], 'conf_' . $config, 0, 1, $option['value'], 3);
                $ele->setInserted(array('--' => __('None', 'rmcommon')));
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'timezone':
            case 'select_timezone':
                $ele = new RMFormTimeZoneField($option['caption'], 'conf_' . $config, 0, 0, $option['value'], 3);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'select_timezone_multi':
                $ele = new RMFormTimeZoneField($option['caption'], 'conf_' . $config, 0, 1, $option['value'], 3);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'checkbox_timezone':
                $ele = new RMFormTimeZoneField($option['caption'], 'conf_' . $config, 1, 1, $option['value'], 3);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'radio_timezone':
                $ele = new RMFormTimeZoneField($option['caption'], 'conf_' . $config, 1, 0, $option['value'], 3);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'tplset':
                $ele = new RMFormSelect($option['caption'], 'conf_' . $config);
                $tplset_handler =& exm_gethandler('tplset');
                $tplsetlist =& $tplset_handler->getList();
                asort($tplsetlist);
                foreach ($tplsetlist as $key => $name) {
                    $ele->addOption($key, $name, $option['value'] == $key ? 1 : 0);
                }
                $form->addElement($ele);
                break;
            case 'textarea':
                $ele = new RMFormTextArea($option['caption'], 'conf_' . $config, 5, $option['size'] > 0 ? $option['size'] : 50, $option['valuetype'] == 'array' ? $cleaner->htmlspecialchars(implode('|', $option['value'])) : $cleaner->htmlspecialchars($option['value']));
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'module_cache':
                $ele = new RMFormCacheModuleField($option['caption'], 'conf_' . $config, $option['value']);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'user_select':
                $ele = new RMFormUser($option['caption'], 'conf_' . $config, $form->getName(), $option['value'], 'select', $limit = '300', '');
                $ele->setOnPage("document.forms[0].op.value='config';");
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele);
                break;
            case 'radio':
                $ele = new RMFormRadio($option['caption'], 'conf_' . $config, 1);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                foreach ($option['options'] as $op => $opvalue) {
                    $ele->addOption($op, $opvalue, $opvalue == $option['value'] ? 1 : 0);
                }
                $form->addElement($ele);
                break;
            case 'font_select':
                $ele = new RMFormSelect($option['caption'], 'conf_' . $config, 0, array($option['value']));
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $fonts = EXMLists::getFileListAsArray(ABSPATH . '/rmcommon/fonts/');
                foreach ($fonts as $font) {
                    $info = pathinfo(ABSPATH . '/rmcommon/fonts/' . $font);
                    if (strtoupper($info['extension']) != 'TTF') {
                        continue;
                    }
                    $ele->addOption($font, $font);
                }
                $form->addElement($ele);
                break;
            case 'select_editor':
                $ele = new RMFormSelect($option['caption'], 'conf_' . $config, 0, array($option['value']));
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $ele->addOption('tiny', __('Visual Editor', 'rmcommon'));
                $ele->addOption('code', __('EXMCode Editor', 'rmcommon'));
                $ele->addOption('textarea', __('Simple Editor', 'rmcommon'));
                $ele->addOption('html', __('HTML Editor', 'rmcommon'));
                $form->addElement($ele);
                break;
            case 'textbox':
            case 'password':
            default:
                $ele = new RMFormText($option['caption'], 'conf_' . $config, $option['size'] > 0 ? $option['size'] : 50, null, $option['valuetype'] == 'array' ? implode('|', $option['value']) : $option['value'], $option['fieldtype'] == 'password' ? 1 : 0);
                if ($option['desc'] != '') {
                    $ele->setDescription($option['desc']);
                }
                $form->addElement($ele, false, $option['valuetype'] == 'int' || $option['valuetype'] == 'float' ? 'num' : '');
                break;
        }
    }
    $ele = new RMFormButtonGroup();
    $ele->addButton('', __('Save Settings', 'rmcommon'), 'submit');
    $ele->addButton('', __('Cancel', 'rmcommon'), 'button', 'onclick="history.go(-1);"');
    $form->addElement($ele);
    // Other components can add items to database
    $form = RMEvents::get()->run_event("rmcommon.settings.form", $form, $plugin);
    RMFunctions::create_toolbar();
    xoops_cp_header();
    $form->display();
    xoops_cp_footer();
}
예제 #5
0
/**
* @desc Formulario de creación de muchas imágenes
**/
function formBulkImages()
{
    global $mc, $xoopsUser, $tpl, $xoopsModule, $xoopsSecurity;
    $page = rmc_server_var($_REQUEST, 'page', 1);
    $owner = rmc_server_var($_REQUEST, 'owner', 0);
    $uid = rmc_server_var($_REQUEST, 'uid', 0);
    $sort = rmc_server_var($_REQUEST, 'sort', 'created');
    $mode = rmc_server_var($_REQUEST, 'mode', 1);
    $psets = rmc_server_var($_REQUEST, 'albums', array());
    $tags = rmc_server_var($_REQUEST, 'tags', '');
    $ruta = "page={$page}&owner={$owner}&sort={$sort}&mode={$mode}";
    $db = Database::getInstance();
    //Lista de albumes
    $sql = "SELECT * FROM " . $db->prefix('gs_sets') . " WHERE owner='" . ($uid ? $uid : $xoopsUser->uid()) . "' ORDER BY id_set DESC";
    $result = $db->query($sql);
    $sets = array();
    while ($rows = $db->fetchArray($result)) {
        $sets[] = array('id' => $rows['id_set'], 'title' => $rows['title'], 'selected' => in_array($rows['id_set'], $psets));
    }
    $show_controls = false;
    if ($uid > 0 && !empty($sets)) {
        $show_controls = true;
        $uploader = new RMFlashUploader('files-container', '../include/upload.php');
        $uploader->add_setting('scriptData', array('op' => 'savebulk', 'sets' => implode(',', $psets), 'uid' => $uid, 'owner' => $owner, 'sort' => $sort, 'mode' => $mode, 'page' => $page, 'tags' => $tags, 'token' => $xoopsSecurity->createToken(), 'rmsecurity' => TextCleaner::getInstance()->encrypt($xoopsUser->uid() . '|' . GS_URL . '/admin/images.php' . '|' . $xoopsSecurity->createToken(), true)));
        $uploader->add_setting('multi', true);
        $uploader->add_setting('fileExt', '*.jpg;*.png;*.gif;*.JPG');
        $uploader->add_setting('fileDesc', __('All Images (*.jpg, *.png, *.gif)', 'galleries'));
        $uploader->add_setting('sizeLimit', $mc['size_image'] * 1024);
        $uploader->add_setting('buttonText', __('Browse Images...', 'galleries'));
        $uploader->add_setting('queueSizeLimit', 100);
        $uploader->add_setting('onComplete', "function(event, id, file, resp, data){\n                eval('ret = '+resp);\n                if (ret.error){\n                    \$('#upload-errors').append('<span class=\"failed\"><strong>'+file.name+'</strong>: '+ret.message+'</span>');\n                } else {\n                    total++;\n                    ids[total-1] = ret.id;\n                    \$('#upload-errors').append('<span class=\"done\"><strong>'+file.name+'</strong>: " . __('Uploaded successfully!', 'rmcommon') . "</span>');\n                }\n                return true;\n            }");
        $uploader->add_setting('onAllComplete', "function(event, data){\n                \n                if(total<=0){ return; }\n                \n                \$('.select_image_cat').hide('slow');\n                \$('#upload-errors').hide('slow');\n                \$('#upload-errors').html('');\n                \$('#upload-controls').hide('slow');\n                \$('#resizer-bar').show('slow');\n                \$('#resizer-bar').effect('highlight',{},1000);\n                \$('#gen-thumbnails').show();\n                \n                var increments = 1/total*100;\n                url = '" . GS_URL . "/include/upload.php';\n                params = '" . TextCleaner::getInstance()->encrypt($xoopsUser->uid() . '|' . GS_URL . '/admin/images.php' . '|' . $xoopsSecurity->createToken(), true) . "';\n                resize_image(params);\n                \n            }");
        $uploader->add_setting('onError', 'function (event,ID,fileObj,errorObj) {
          alert(errorObj.type + \' Error: \' + errorObj.info);
        }');
        RMTemplate::get()->add_head($uploader->render());
    }
    $form = new RMForm('', 'frmImgs', 'images.php');
    $ele = new RMFormUser('', 'uid', 0, $uid ? array($uid) : array($xoopsUser->uid()), 0);
    $users_field = $ele->render();
    GSFunctions::toolbar();
    xoops_cp_location("<a href='./'>" . $xoopsModule->name() . "</a> &raquo; " . __('Create batch images', 'galleries'));
    RMTemplate::get()->assign('xoops_pagetitle', __('Create batch images', 'galleries'));
    RMTemplate::get()->add_local_script('images.js', 'galleries');
    RMTemplate::get()->add_style('uploader.css', 'galleries');
    xoops_cp_header();
    include RMTemplate::get()->get_template("admin/gs_formimages.php", 'module', 'galleries');
    xoops_cp_footer();
}