Exemple #1
0
                        <a href="thumbnails.php?album={$CURRENT_PIC['aid']}" class="admin_menu">{$lang_editpics_php['thumbnail_view']}</a>
                        </td>
        </tr>
        <tr>
                        <td class="tableb" style="white-space: nowrap;">
                                {$lang_editpics_php['pic_info']}
                        </td>
                        <td class="tableb">
                                {$pic_info}
                        </td>
                                <td class="tableb" align="center" rowspan="{$THUMB_ROWSPAN}">
                                <a href="{$thumb_link}"><img src="{$thumb_url}" class="image" border="0" alt="{$CURRENT_PIC['title']}"/></a><br />
            </td>
        </tr>
EOT;
form_alb_list_box();
if ($CONFIG['show_bbcode_help']) {
    $captionLabel = '&nbsp;' . cpg_display_help('f=index.html&base=64&h=' . urlencode(base64_encode(serialize($lang_bbcode_help_title))) . '&t=' . urlencode(base64_encode(serialize($lang_bbcode_help))), 470, 245);
}
print <<<EOT
        <tr>
                        <td class="tableb" style="white-space: nowrap;">
                        {$lang_editpics_php['title']}
                </td>
                <td width="100%" class="tableb" valign="top">
                                <input type="text" style="width: 100%" name="title" maxlength="255" value="{$CURRENT_PIC['title']}" class="textinput" />
                        </td>
        </tr>

        <tr>
                        <td class="tableb" style="white-space: nowrap;">
function create_form(&$data)
{
    foreach ($data as $element) {
        if (is_array($element)) {
            switch ($element[2]) {
                case 0:
                    form_input($element[0], $element[1], $element[3]);
                    break;
                case 1:
                    form_alb_list_box($element[0], $element[1]);
                    break;
                case 2:
                    form_textarea($element[0], $element[1], $element[3]);
                    break;
                case 3:
                    form_pic_info($element[0]);
                    break;
                default:
                    cpg_die(CRITICAL_ERROR, 'Invalid action for form creation', __FILE__, __LINE__);
            }
            // switch
        } else {
            form_label($element);
        }
    }
    // foreach
}
function create_form_swfupload()
{
    global $lang_common, $lang_upload_swf_php, $icon_array;
    form_alb_list_box($lang_common['album'], 'album');
    echo <<<EOT
    <tr>
        <td colspan="2" class="tableb tableb_alternate">
            <div id="upload_form">
                <div>
                    <span id="browse_button_place_holder"></span>
                    <button id="button_cancel" onclick="swfu.cancelQueue();" disabled="disabled" class="button">
                        {$icon_array['cancel']}
                        {$lang_upload_swf_php['cancel_all']}
                    </button>
                </div>
        </td>
    </tr>
    <tr>
        <td colspan="2" class="tableb">
                <div class="fieldset flash" id="upload_progress">
                    <span class="legend">{$lang_upload_swf_php['upload_queue']}</span>
                </div>
            </div>
        </td>
    </tr>
    <tr>
        <td colspan="2" class="tableb tableb_alternate">
            <button id="button_continue" class="button" onclick="return continue_upload();" style="display: none; margin-top: 5px;">
                {$icon_array['continue']}
                {$lang_common['continue']}
            </button>
        </td>
    </tr>
    <tr>
        <td colspan="2" class="tableh2">
            <div id="upload_status">
                <span id="upload_count">0</span> {$lang_upload_swf_php['files_uploaded']}:
            </div>
            <div id="uploadedThumbnails"></div>
        </td>
    </tr>
EOT;
}
Exemple #4
0
function create_form(&$data)
{
    global $CONFIG, $lang_upload_php;
    // Cycle through the elements in the data array.
    foreach ($data as $element) {
        // If the element is another array, parse the definition contained within the array.
        if (is_array($element)) {
            // Based on the type declared in the data array's third position, create a different form input.
            switch ($element[2]) {
                // If the type is a text box input
                case 0:
                    //Call the form input function.
                    text_box_input($element[0], $element[1], $element[3], $element[4], isset($element[5]) ? $element[5] : '');
                    break;
                    // If the type is a file input.
                // If the type is a file input.
                case 1:
                    // Call the file input function.
                    file_input($element[0], $element[1], $element[3]);
                    break;
                    // If the type is an album list dropdown.
                // If the type is an album list dropdown.
                case 2:
                    // Call the album list function.
                    form_alb_list_box($element[0], $element[1]);
                    break;
                    // If the type is a text area
                // If the type is a text area
                case 3:
                    // Call the text area function.
                    text_area_input($element[0], $element[1], $element[3], isset($element[4]) ? $element[4] : '');
                    break;
                    // If the type is a hidden form
                // If the type is a hidden form
                case 4:
                    // Call the hidden input funtion.
                    hidden_input($element[0], $element[1]);
                    break;
                    // If the type is not present, kill the script.
                // If the type is not present, kill the script.
                default:
                    cpg_die(ERROR, $lang_upload_php['reg_instr_1'], __FILE__, __LINE__);
            }
            // switch
        } else {
            // If the element is not an array, it is a label, so call the label function.
            form_label($element);
        }
    }
}
Exemple #5
0
xoopsCodeTarea("caption", 37, 8);
$xoopsTpl->assign('xoops_codes', ob_get_contents());
ob_end_clean();
ob_start();
xoopsSmilies("caption");
$xoopsTpl->assign('xoops_smilies', ob_get_contents());
ob_end_clean();
$xoopsTpl->assign('max_upl', sprintf(_MD_UPL_MAX_FSIZE, $xoopsModuleConfig['max_upl_size']));
$xoopsTpl->assign('lang_upload', _MD_UPL_TITLE);
$xoopsTpl->assign('lang_album', _MD_ALBUM);
$xoopsTpl->assign('lang_picture', _MD_UPL_PICTURE);
$xoopsTpl->assign('lang_picture_title', _MD_UPL_PIC_TITLE);
$xoopsTpl->assign('lang_keywords', _MD_UPL_KEYWORDS);
$xoopsTpl->assign('max_file_size', $xoopsModuleConfig['max_upl_size'] << 10);
$xoopsTpl->assign('lang_options', "_MD_OPTIONS");
$xoopsTpl->assign('lang_notify', "_MD_NOTIFYAPPROVE");
$xoopsTpl->assign('lang_description', _MD_UPL_DESCRIPTION);
$xoopsTpl->assign('lang_submit', _SUBMIT);
$xoopsTpl->assign('lang_cancel', _CANCEL);
$xoopsTpl->assign('lang_quote', _QUOTEC);
$xoopsTpl->assign('album_selbox', form_alb_list_box());
$xoopsTpl->assign('user1', $xoopsModuleConfig['user_field1_name']);
$xoopsTpl->assign('user2', $xoopsModuleConfig['user_field2_name']);
$xoopsTpl->assign('user3', $xoopsModuleConfig['user_field3_name']);
$xoopsTpl->assign('user4', $xoopsModuleConfig['user_field4_name']);
user_save_profile();
$xoopsTpl->assign('gallery', $xoopsModule->getVar('name'));
include_once "include/theme_func.php";
main_menu();
do_footer();
include_once "../../footer.php";
function html5_display_upload_form($upload_settings)
{
    global $CONFIG, $USER_DATA, $lang_common, $lang_upload_php, $lang_plugin_html5upload, $icon_array, $h5a_upload, $lang_bbcode_help_title, $lang_bbcode_help;
    list($upload_form, $upload_select) = $upload_settings;
    if ($upload_form != 'html5_upload') {
        return $upload_settings;
    }
    $plugpath = 'plugins/html5upload';
    $grpn = USER_ID > 0 ? (int) $USER_DATA['group_id'] : 0;
    $grpc = $grpn ? $grpn : '';
    $cfg = isset($CONFIG['html5upload_config' . $grpc]) ? unserialize($CONFIG['html5upload_config' . $grpc]) : unserialize($CONFIG['html5upload_config']);
    $maxfilesizebytes = $cfg['upldsize'] ? max($cfg['upldsize'], $h5a_upload->sys_max_upl_size) : $h5a_upload->sys_max_upl_size;
    $maxfilesize = sprintf($lang_upload_php['max_fsize'], $h5a_upload->to_KMG($maxfilesizebytes));
    list($timestamp, $form_token) = getFormToken(time() + 14400);
    //allow up to 4 hours for upload to complete
    set_js_var('timestamp', $timestamp - 14400);
    //subtract those 4 hours so edits happen correctly
    set_js_var('concurrent', $cfg['concurrent']);
    set_js_var('autoedit', $cfg['autoedit']);
    set_js_var('user_id', USER_ID);
    set_js_var('guest_edit', $CONFIG['allow_guests_enter_file_details']);
    set_js_var('H5uPath', "{$plugpath}/");
    set_js_var('maxfilesize', $maxfilesizebytes);
    set_js_var('maxchunksize', $h5a_upload->sys_max_chnk_size);
    set_js_var('fup_payload', array('event' => 'picture', 'process' => 1, 'form_token' => $form_token, 'timestamp' => $timestamp, 'MFU' => 1));
    set_js_var('h5uM', array('selAlb' => $lang_plugin_html5upload['albmSelMsg'], 'aborted' => $lang_plugin_html5upload['aborted'], 'type_err' => $lang_plugin_html5upload['type_err'], 'size_err' => $lang_plugin_html5upload['size_err'], 'extallow' => $lang_plugin_html5upload['extallow'], 'q_stop' => $lang_plugin_html5upload['q_stop'], 'q_go' => $lang_plugin_html5upload['q_resume'], 'q_can' => $lang_plugin_html5upload['q_cancel']));
    $allowed_types = array_merge(explode('/', $CONFIG['allowed_img_types']), explode('/', $CONFIG['allowed_mov_types']), explode('/', $CONFIG['allowed_snd_types']), explode('/', $CONFIG['allowed_doc_types']));
    set_js_var('allowed_file_types', $allowed_types);
    // include the javascript upload engine (minified unless in debug mode)
    $jsv = $CONFIG['debug_mode'] == 1 || $CONFIG['debug_mode'] == 2 && GALLERY_ADMIN_MODE ? '' : '.min';
    js_include('plugins/html5upload/js/upload' . $jsv . '.js');
    // add our style sheet
    $h5up_meta = '<link rel="stylesheet" href="plugins/html5upload/css/upload.css" type="text/css" />';
    pageheader($lang_plugin_html5upload['title'], $h5up_meta);
    $upload_help = $h5a_upload->help_button('use');
    $upload_table_header = <<<EOT
\t<table border="0" cellspacing="0" cellpadding="0" width="100%">
\t\t<tr>
\t\t\t<td>
\t\t\t\t{$icon_array['upload']}{$lang_plugin_html5upload['upldfiles']}{$upload_help}
\t\t\t</td>
\t\t\t<td style="text-align:right">
\t\t\t\t<span id="upload_method_selector">{$upload_select}</span>
\t\t\t</td>
\t\t</tr>
\t</table>
EOT;
    starttable('100%', $upload_table_header, 2);
    echo '<tr><td colspan="2" class="tableb tableb_alternate"><strong>' . $maxfilesize . '</strong></td></tr>';
    form_alb_list_box($lang_common['album'], 'h5u_album');
    echo <<<EOT
\t<tr id="navailrow" style="text-align:center;background-color:yellow;display:none">
\t\t<td colspan="2">{$lang_plugin_html5upload['notavail']}</td>
\t</tr>
\t<tr class="H5upV">
\t\t<td class="tableb" width="30%">{$lang_plugin_html5upload['flistitl']}</td>
\t\t<td class="tableb"><input type="checkbox" id="flistitl" onchange="shide_titlrow(this);" /></td>
\t</tr>
EOT;
    if (USER_ID > 0 || $CONFIG['allow_guests_enter_file_details'] == 1) {
        if ($cfg['enabtitl']) {
            echo '<tr id="titlrow"><td class="tableb">' . $lang_upload_php['pic_title'] . '</td><td class="tableb"><input type="text" name="title" id="title" class="textinput" maxlength="255" style="width:90%" /></td></tr>';
        }
        if ($cfg['enabdesc']) {
            $desclabl = $lang_upload_php['description'];
            if ($CONFIG['show_bbcode_help']) {
                $desclabl .= '&nbsp;' . cpg_display_help('f=empty.htm&amp;base=64&amp;h=' . urlencode(base64_encode(serialize($lang_bbcode_help_title))) . '&amp;t=' . urlencode(base64_encode(serialize($lang_bbcode_help))), 470, 245);
            }
            echo '<tr><td class="tableb">' . $desclabl . '</td><td class="tableb"><textarea name="caption" rows="2" id="caption" class="textinput" style="width:90%" /></textarea></td></tr>';
        }
        if ($cfg['enabkeys']) {
            $keywordLabel = sprintf($lang_common['keywords_insert1'], $lang_common['keyword_separators'][$CONFIG['keyword_separator']]) . '<br /><a href="keyword_select.php" class="greybox">' . $lang_common['keywords_insert2'] . '</a>';
            echo '<tr><td class="tableb">' . $keywordLabel . '</td><td class="tableb"><input type="text" name="keywords" id="keywords" class="textinput" maxlength="255" style="width:90%" /></td></tr>';
        }
        if ($cfg['enabusr1'] && !empty($CONFIG['user_field1_name'])) {
            echo '<tr><td class="tableb">' . $CONFIG['user_field1_name'] . '</td><td class="tableb"><input type="text" name="user1" id="user1" class="textinput" maxlength="255" style="width:90%" /></td></tr>';
        }
        if ($cfg['enabusr2'] && !empty($CONFIG['user_field2_name'])) {
            echo '<tr><td class="tableb">' . $CONFIG['user_field2_name'] . '</td><td class="tableb"><input type="text" name="user2" id="user2" class="textinput" maxlength="255" style="width:90%" /></td></tr>';
        }
        if ($cfg['enabusr3'] && !empty($CONFIG['user_field3_name'])) {
            echo '<tr><td class="tableb">' . $CONFIG['user_field3_name'] . '</td><td class="tableb"><input type="text" name="user3" id="user3" class="textinput" maxlength="255" style="width:90%" /></td></tr>';
        }
        if ($cfg['enabusr4'] && !empty($CONFIG['user_field4_name'])) {
            echo '<tr><td class="tableb">' . $CONFIG['user_field4_name'] . '</td><td class="tableb"><input type="text" name="user4" id="user4" class="textinput" maxlength="255" style="width:90%" /></td></tr>';
        }
    }
    $acptmime = $cfg['acptmime'] ? "accept=\"{$cfg['acptmime']}\"" : '';
    echo <<<EOT
\t<tr id="h5upldrow">
\t\t<td class="tableb">{$lang_plugin_html5upload['files']}</td>
\t\t<td class="tableb" style="padding:1em">
\t\t\t<div style="width:480px">
\t\t\t\t<input type="file" name="userpictures" id="upload_field" multiple="multiple" {$acptmime}/>
\t\t\t\t&nbsp;<br />
\t\t\t\t<div id="dropArea">{$lang_plugin_html5upload['drop_files']}</div>
\t\t\t\t&nbsp;<br />
\t\t\t\t<div id="progress_report" style="position:relative">
\t\t\t\t\t<div id="progress_report_name"></div>
\t\t\t\t\t<div id="progress_report_status" style="font-style: italic;"></div>
\t\t\t\t\t<div id="totprogress">
\t\t\t\t\t\t<div id="progress_report_bar" style="background-color: blue; width: 0; height: 100%;"></div>
\t\t\t\t\t</div>
\t\t\t\t\t<div>
\t\t\t\t\t\t{$lang_plugin_html5upload['files_left']}<span id="qcount">0</span><div class="acti" id="qstop"><img src="plugins/html5upload/css/stop.png" title="{$lang_plugin_html5upload['q_stop']}" onclick="H5uQctrl.stop()" /></div><div class="acti" id="qgocan"><img src="plugins/html5upload/css/play-green.png" title="{$lang_plugin_html5upload['q_resume']}" onclick="H5uQctrl.go()" /><img src="plugins/html5upload/css/cross.png" title="{$lang_plugin_html5upload['q_cancel']}" onclick="H5uQctrl.cancel()" /></div>
\t\t\t\t\t</div>
\t\t\t\t\t<div id="fprogress"></div>
\t\t\t\t\t<div id="server_response"></div>
\t\t\t\t</div>
\t\t\t</div>
\t\t</td>
\t</tr>
\t<tr id="gotoedit" style="display:none">
\t\t<td class="tableb tableb_alternate">{$lang_plugin_html5upload['continue']}</td>
\t\t<td class="tableb tableb_alternate">
\t\t\t<button type="button" onclick="window.location=redirURL">{$lang_plugin_html5upload['gotoedit']}</button>
\t\t</td>
\t</tr>
EOT;
    endtable();
    pagefooter();
    exit;
}