Ejemplo n.º 1
0
/**
* edits or creates an album
*
* @param    int     album_id    album_id to edit
* @param    string  mode        create or edit
* @param    string  actionURL   where to redirection on finish
* @param    int     oldaid      original album id
* @return   string              HTML
*
*/
function MG_editAlbum($mode = '', $actionURL = '', $oldaid = 0)
{
    global $_USER, $_CONF, $_TABLES, $_MG_CONF, $LANG_MG00, $LANG_MG01, $LANG_MG03, $LANG_ACCESS;
    if ($actionURL == '') {
        $actionURL = $_CONF['site_admin_url'] . '/plugins/mediagallery/index.php';
    }
    if ($oldaid > 0 && $mode == 'edit') {
        $album = new mgAlbum($oldaid);
        $album_id = $album->id;
    } else {
        // create
        $album = new mgAlbum();
        $album->id = -1;
        $album_id = -1;
    }
    $retval = '';
    $T = COM_newTemplate(MG_getTemplatePath($album_id));
    $T->set_file('admin', 'editalbum.thtml');
    if ($album_id != 0 && $mode == 'edit') {
        // If edit, pull up the existing album information...
        if ($album->access != 3) {
            COM_errorLog("MediaGallery: Someone has tried to illegally edit a Media Gallery Album. " . "User id: {$_USER['uid']}, Username: {$_USER['username']}, IP: {$REMOTE_ADDR}", 1);
            return COM_showMessageText($LANG_MG00['access_denied_msg']);
        }
    }
    $block_title = $mode == 'create' ? $LANG_MG01['create_album'] : $LANG_MG01['edit_album'] . ' - ' . strip_tags($album->title);
    // construct the album jumpbox
    $select = $mode == 'create' ? $oldaid : $album->parent;
    $valid_albums = 0;
    $album_selectbox = '<select name="parentaid">';
    $root_album = new mgAlbum(0);
    $valid_albums += $root_album->buildAlbumBox($album_selectbox, $select, 3, $album_id, $mode);
    $album_selectbox .= '</select>';
    if ($valid_albums == 0) {
        COM_errorLog("MediaGallery: Someone has tried to illegally create a Media Gallery Album. " . "User id: {$_USER['uid']}, Username: {$_USER['username']}, IP: {$REMOTE_ADDR}", 1);
        return COM_showMessageText($LANG_MG00['access_denied_msg']);
    }
    // build exif select box...
    $exif_select = MG_optionlist(array('name' => 'enable_exif', 'current' => $album->exif_display, 'values' => array('0' => $LANG_MG01['disable_exif'], '1' => $LANG_MG01['display_below_media'], '2' => $LANG_MG01['display_in_popup'], '3' => $LANG_MG01['both'])));
    $full_select = MG_optionlist(array('name' => 'full_display', 'current' => $album->full, 'values' => array('0' => $LANG_MG01['always'], '1' => $LANG_MG01['members_only'], '2' => $LANG_MG01['disabled']), 'disabled' => $_MG_CONF['discard_original']));
    $ranking_select = MG_optionlist(array('name' => 'enable_rating', 'current' => $album->enable_rating, 'values' => array('0' => $LANG_MG01['disabled'], '1' => $LANG_MG01['members_only'], '2' => $LANG_MG01['always'])));
    $podcast_select = MG_checkbox(array('name' => 'podcast', 'checked' => $album->podcast, 'value' => '1'));
    $mp3ribbon_select = MG_checkbox(array('name' => 'mp3ribbon', 'checked' => $album->mp3ribbon, 'value' => '1'));
    $rsschildren_select = MG_checkbox(array('name' => 'rsschildren', 'checked' => $album->rssChildren, 'value' => '1'));
    $comment_select = MG_checkbox(array('name' => 'enable_comments', 'checked' => $album->enable_comments, 'value' => '1'));
    $ss_select = MG_optionlist(array('name' => 'enable_slideshow', 'current' => $album->enable_slideshow, 'values' => array('0' => $LANG_MG01['disabled'], '1' => $LANG_MG01['js_slideshow'], '2' => $LANG_MG01['lightbox'], '3' => $LANG_MG01['flash_slideshow_disp'], '4' => $LANG_MG01['flash_slideshow_full'], '5' => $LANG_MG01['mp3_jukebox'])));
    $views_select = MG_checkbox(array('name' => 'enable_views', 'checked' => $album->enable_views, 'value' => '1'));
    $keywords_select = MG_checkbox(array('name' => 'enable_keywords', 'checked' => $album->enable_keywords, 'value' => '1'));
    $sort_select = MG_checkbox(array('name' => 'enable_sort', 'checked' => $album->enable_sort, 'value' => '1'));
    $rss_select = MG_checkbox(array('name' => 'enable_rss', 'checked' => $album->enable_rss, 'value' => '1'));
    $afirst_select = MG_checkbox(array('name' => 'albums_first', 'checked' => $album->albums_first, 'value' => '1'));
    $usealternate_select = MG_checkbox(array('name' => 'usealternate', 'checked' => $album->useAlternate, 'value' => '1'));
    $album_views_select = MG_checkbox(array('name' => 'enable_album_views', 'checked' => $album->enable_album_views, 'value' => '1'));
    $display_album_desc_select = MG_checkbox(array('name' => 'display_album_desc', 'checked' => $album->display_album_desc, 'value' => '1'));
    $tn_size_select = MG_optionlist(array('name' => 'tn_size', 'current' => $album->tn_size, 'values' => array('0' => $LANG_MG01['include_small'], '1' => $LANG_MG01['include_medium'], '2' => $LANG_MG01['include_large'], '3' => $LANG_MG01['include_custom'], '10' => $LANG_MG01['crop_small'], '11' => $LANG_MG01['crop_medium'], '12' => $LANG_MG01['crop_large'], '13' => $LANG_MG01['crop_custom'])));
    $display_image_size_select = MG_optionlist(array('name' => 'display_image_size', 'current' => $album->display_image_size, 'values' => array('0' => $LANG_MG01['size_500x375'], '1' => $LANG_MG01['size_600x450'], '2' => $LANG_MG01['size_620x465'], '3' => $LANG_MG01['size_720x540'], '4' => $LANG_MG01['size_800x600'], '5' => $LANG_MG01['size_912x684'], '6' => $LANG_MG01['size_1024x768'], '7' => $LANG_MG01['size_1152x864'], '8' => $LANG_MG01['size_1280x1024'], '9' => $LANG_MG01['size_custom'] . $_MG_CONF['custom_image_width'] . 'x' . $_MG_CONF['custom_image_height'])));
    $rows_input = MG_input(array('type' => 'text', 'size' => '3', 'name' => 'display_rows', 'value' => $album->display_rows));
    $columns_input = MG_input(array('type' => 'text', 'size' => '3', 'name' => 'display_columns', 'value' => $album->display_columns));
    $max_image_height_input = MG_input(array('type' => 'text', 'size' => '4', 'name' => 'max_image_height', 'value' => $album->max_image_height));
    $max_image_width_input = MG_input(array('type' => 'text', 'size' => '4', 'name' => 'max_image_width', 'value' => $album->max_image_width));
    $tnheight_input = MG_input(array('type' => 'text', 'size' => '3', 'name' => 'tnheight', 'value' => $album->tnHeight));
    $tnwidth_input = MG_input(array('type' => 'text', 'size' => '3', 'name' => 'tnwidth', 'value' => $album->tnWidth));
    $max_filesize = 0;
    if ($album->max_filesize != 0) {
        $max_filesize = $album->max_filesize / 1024;
    }
    $max_filesize_input = MG_input(array('type' => 'text', 'size' => '10', 'name' => 'max_filesize', 'value' => $max_filesize));
    $email_mod_select = MG_checkbox(array('name' => 'email_mod', 'checked' => $album->email_mod, 'value' => '1'));
    $playback_type = MG_optionlist(array('name' => 'playback_type', 'current' => $album->playback_type, 'values' => array('0' => $LANG_MG01['play_in_popup'], '1' => $LANG_MG01['download_to_local'], '2' => $LANG_MG01['play_inline'], '3' => $LANG_MG01['use_mms'])));
    $themes = MG_getThemes();
    $album_theme_select = '<select name="album_theme">';
    for ($i = 0; $i < count($themes); $i++) {
        $album_theme_select .= '<option value="' . $themes[$i] . '"' . ($album->skin == $themes[$i] ? ' selected="selected"' : '') . '>' . $themes[$i] . '</option>';
    }
    $album_theme_select .= '</select>';
    $attach_select = MG_checkbox(array('name' => 'attach_tn', 'checked' => $album->tn_attached, 'value' => '1'));
    $result = DB_query("SELECT * FROM {$_TABLES['users']}");
    $nRows = DB_numRows($result);
    $owner_select = '<select name="owner_id">';
    for ($i = 0; $i < $nRows; $i++) {
        $row = DB_fetchArray($result);
        if ($row['uid'] == 1) {
            continue;
        }
        $owner_select .= '<option value="' . $row['uid'] . '"' . ($album->owner_id == $row['uid'] ? ' selected="selected"' : '') . '>' . COM_getDisplayName($row['uid']) . '</option>';
    }
    $owner_select .= '</select>';
    $album_sort_select = MG_optionlist(array('name' => 'album_sort_order', 'current' => $album->album_sort_order, 'values' => array('0' => $LANG_MG03['no_sort'], '1' => $LANG_MG03['sort_capture_asc'], '2' => $LANG_MG03['sort_capture'], '3' => $LANG_MG03['sort_upload_asc'], '4' => $LANG_MG03['sort_upload'], '5' => $LANG_MG03['sort_alpha'], '6' => $LANG_MG03['sort_alpha_asc'])));
    if (SEC_hasRights('mediagallery.admin')) {
        //
        // -- build the featured selects and info...
        //
        $featured_select = MG_checkbox(array('name' => 'featured', 'checked' => $album->featured, 'value' => '1'));
        // build featurepage select...
        $featurepage_select = '<select name="featurepage">';
        $featurepage_select .= MG_options(array('current' => $album->cbpage, 'values' => array('all' => $LANG_MG01['all'], 'allnhp' => $LANG_MG01['all_nhp'], 'none' => $LANG_MG01['homepage_only'])));
        $featurepage_select .= COM_topicList('tid,topic', $album->cbpage);
        $featurepage_select .= '</select>';
        // position
        $feature_pos = MG_optionlist(array('name' => 'featureposition', 'current' => $album->cbposition, 'values' => array('1' => $LANG_MG01['top'], '2' => $LANG_MG01['after_featured_articles'], '3' => $LANG_MG01['bottom'])));
        $ri_select = MG_checkbox(array('name' => 'enable_random', 'checked' => $album->enable_random, 'value' => '1'));
        $T->set_var(array('featured_select' => $featured_select, 'feature_page_select' => $featurepage_select, 'feature_position' => $feature_pos, 'height_input' => $max_image_height_input, 'width_input' => $max_image_width_input, 'max_size_input' => $max_filesize_input, 'ri_select' => $ri_select, 'jpg_checked' => $album->valid_formats & MG_JPG ? ' checked="checked"' : '', 'png_checked' => $album->valid_formats & MG_PNG ? ' checked="checked"' : '', 'tif_checked' => $album->valid_formats & MG_TIF ? ' checked="checked"' : '', 'gif_checked' => $album->valid_formats & MG_GIF ? ' checked="checked"' : '', 'bmp_checked' => $album->valid_formats & MG_BMP ? ' checked="checked"' : '', 'tga_checked' => $album->valid_formats & MG_TGA ? ' checked="checked"' : '', 'psd_checked' => $album->valid_formats & MG_PSD ? ' checked="checked"' : '', 'mp3_checked' => $album->valid_formats & MG_MP3 ? ' checked="checked"' : '', 'ogg_checked' => $album->valid_formats & MG_OGG ? ' checked="checked"' : '', 'asf_checked' => $album->valid_formats & MG_ASF ? ' checked="checked"' : '', 'swf_checked' => $album->valid_formats & MG_SWF ? ' checked="checked"' : '', 'mov_checked' => $album->valid_formats & MG_MOV ? ' checked="checked"' : '', 'mp4_checked' => $album->valid_formats & MG_MP4 ? ' checked="checked"' : '', 'mpg_checked' => $album->valid_formats & MG_MPG ? ' checked="checked"' : '', 'zip_checked' => $album->valid_formats & MG_ZIP ? ' checked="checked"' : '', 'flv_checked' => $album->valid_formats & MG_FLV ? ' checked="checked"' : '', 'rflv_checked' => $album->valid_formats & MG_RFLV ? ' checked="checked"' : '', 'emb_checked' => $album->valid_formats & MG_EMB ? ' checked="checked"' : '', 'other_checked' => $album->valid_formats & MG_OTHER ? ' checked="checked"' : '', 'lang_featured_album' => $LANG_MG01['featured_album'], 'lang_set_featured' => $LANG_MG01['set_featured'], 'lang_featured_help' => $LANG_MG01['featured_help'], 'lang_position' => $LANG_MG01['position'], 'lang_topic' => $LANG_MG01['topic'], 'lang_ri_enable' => $LANG_MG01['ri_enable'], 'lang_max_image_height' => $LANG_MG01['max_image_height'], 'lang_max_image_width' => $LANG_MG01['max_image_width'], 'lang_max_filesize' => $LANG_MG01['max_filesize'], 'lang_jpg' => $LANG_MG01['jpg'], 'lang_png' => $LANG_MG01['png'], 'lang_tif' => $LANG_MG01['tif'], 'lang_gif' => $LANG_MG01['gif'], 'lang_bmp' => $LANG_MG01['bmp'], 'lang_tga' => $LANG_MG01['tga'], 'lang_psd' => $LANG_MG01['psd'], 'lang_mp3' => $LANG_MG01['mp3'], 'lang_ogg' => $LANG_MG01['ogg'], 'lang_asf' => $LANG_MG01['asf'], 'lang_swf' => $LANG_MG01['swf'], 'lang_mov' => $LANG_MG01['mov'], 'lang_mp4' => $LANG_MG01['mp4'], 'lang_mpg' => $LANG_MG01['mpg'], 'lang_zip' => $LANG_MG01['zip'], 'lang_flv' => $LANG_MG01['flv'], 'lang_rflv' => $LANG_MG01['rflv'], 'lang_emb' => $LANG_MG01['emb'], 'lang_other' => $LANG_MG01['other'], 'lang_allowed_formats' => $LANG_MG01['allowed_media_formats'], 'lang_image' => $LANG_MG01['image'], 'lang_audio' => $LANG_MG01['audio'], 'lang_video' => $LANG_MG01['video']));
    }
    $r = rand();
    if ($album->tn_attached) {
        list($album_last_image, $media_size) = MG_getImageUrl('covers/cover_' . $album_id);
        if ($media_size != false) {
            $T->set_var('thumbnail', '<img src="' . $album_last_image . '?r=' . $r . '" alt=""' . XHTML . '>');
        }
    }
    $filename_title_select = MG_checkbox(array('name' => 'filename_title', 'checked' => $album->filename_title, 'value' => '1'));
    // watermark stuff...
    $wm_auto_select = MG_checkbox(array('name' => 'wm_auto', 'checked' => $album->wm_auto, 'value' => '1'));
    $wm_opacity_select = MG_optionlist(array('name' => 'wm_opacity', 'current' => $album->wm_opacity, 'values' => array('10' => '10%', '20' => '20%', '30' => '30%', '40' => '40%', '50' => '50%', '60' => '60%', '70' => '70%', '80' => '80%', '90' => '90%')));
    $wm_location_select = MG_optionlist(array('name' => 'wm_location', 'current' => $album->wm_location, 'values' => array('1' => $LANG_MG01['top_left'], '2' => $LANG_MG01['top_center'], '3' => $LANG_MG01['top_right'], '4' => $LANG_MG01['middle_left'], '5' => $LANG_MG01['middle_center'], '6' => $LANG_MG01['middle_right'], '7' => $LANG_MG01['bottom_left'], '8' => $LANG_MG01['bottom_center'], '9' => $LANG_MG01['bottom_right'])));
    // now select what watermarks we have permission to use...
    $whereClause = "WHERE wm_id<>0 AND ";
    if (SEC_hasRights('mediagallery.admin')) {
        $whereClause .= "1=1 ";
    } else {
        $whereClause .= "(owner_id=" . intval($_USER['uid']) . " OR owner_id=0) ";
    }
    $sql = "SELECT * FROM {$_TABLES['mg_watermarks']} " . $whereClause . "ORDER BY owner_id";
    $result = DB_query($sql);
    $nRows = DB_numRows($result);
    $wm_select = '<select name="wm_id" onchange="change(this)">';
    $wm_select .= '<option value="blank.png">' . $LANG_MG01['no_watermark'] . '</option>';
    $wm_current = '<img src="' . $_MG_CONF['site_url'] . '/watermarks/blank.png" name="myImage" alt=""' . XHTML . '>';
    for ($i = 0; $i < $nRows; $i++) {
        $row = DB_fetchArray($result);
        $wm_select .= '<option value="' . $row['filename'] . '"' . ($album->wm_id == $row['wm_id'] ? ' selected="selected"' : '') . '>' . $row['filename'] . '</option>';
        if ($album->wm_id == $row['wm_id']) {
            $wm_current = '<img src="' . $_MG_CONF['site_url'] . '/watermarks/' . $row['filename'] . '" name="myImage" alt=""' . XHTML . '>';
        }
    }
    $wm_select .= '</select>';
    $skins = MG_getFrames();
    $tmp = array();
    for ($i = 0; $i < count($skins); $i++) {
        $tmp[$skins[$i]['dir']] = $skins[$i]['name'];
    }
    $skin_select = MG_optionlist(array('name' => 'skin', 'current' => $album->image_skin, 'values' => $tmp));
    $askin_select = MG_optionlist(array('name' => 'askin', 'current' => $album->album_skin, 'values' => $tmp));
    $dskin_select = MG_optionlist(array('name' => 'dskin', 'current' => $album->display_skin, 'values' => $tmp));
    // permission template
    $usergroups = SEC_getUserGroups();
    $groupdd = '<select name="group_id">';
    $moddd = '<select name="mod_id">';
    for ($i = 0; $i < count($usergroups); $i++) {
        if ($usergroups[key($usergroups)] != 2 && $usergroups[key($usergroups)] != 13) {
            $groupdd .= '<option value="' . $usergroups[key($usergroups)] . '"';
            $moddd .= '<option value="' . $usergroups[key($usergroups)] . '"';
            if ($album->group_id == $usergroups[key($usergroups)]) {
                $groupdd .= ' selected="selected"';
            }
            if ($album->mod_group_id == $usergroups[key($usergroups)]) {
                $moddd .= ' selected="selected"';
            }
            $groupdd .= '>' . key($usergroups) . '</option>';
            $moddd .= '>' . key($usergroups) . '</option>';
        }
        next($usergroups);
    }
    $groupdd .= '</select>';
    $moddd .= '</select>';
    $upload_select = MG_checkbox(array('name' => 'uploads', 'checked' => $album->member_uploads, 'value' => '1'));
    $moderate_select = MG_checkbox(array('name' => 'moderate', 'checked' => $album->moderate, 'value' => '1'));
    $child_update_select = MG_checkbox(array('name' => 'force_child_update', 'checked' => false, 'value' => '1'));
    $hidden_select = MG_checkbox(array('name' => 'hidden', 'checked' => $album->hidden, 'value' => '1'));
    $allow_download_select = MG_checkbox(array('name' => 'allow_download', 'checked' => $album->allow_download, 'value' => '1'));
    if (SEC_hasRights('mediagallery.admin')) {
        $perm_editor = SEC_getPermissionsHTML($album->perm_owner, $album->perm_group, $album->perm_members, $album->perm_anon);
    } else {
        $perm_editor = MG_getMemberPermissionsHTML($album->perm_members, $album->perm_anon);
    }
    $T->set_var(array('site_url' => $_CONF['site_url'], 'site_admin_url' => $_CONF['site_admin_url'], 'xhtml' => XHTML, 'start_block' => COM_startBlock($block_title), 'end_block' => COM_endBlock(), 'owner_username' => DB_getItem($_TABLES['users'], 'username', "uid={$album->owner_id}"), 'owner_id' => $album->owner_id, 'permissions_editor' => $perm_editor, 'old_album_id' => $oldaid, 'group_dropdown' => $groupdd, 'mod_dropdown' => $moddd, 'uploads' => $upload_select, 'moderate' => $moderate_select, 'hidden' => $hidden_select, 'force_child_update' => $child_update_select, 'owner_select' => $owner_select, 'email_mod_select' => $email_mod_select, 'action' => 'album', 'path_mg' => $_MG_CONF['site_url'], 'attach_select' => $attach_select, 'comment_select' => $comment_select, 'exif_select' => $exif_select, 'ranking_select' => $ranking_select, 'podcast_select' => $podcast_select, 'mp3ribbon_select' => $mp3ribbon_select, 'rsschildren_select' => $rsschildren_select, 'full_select' => $full_select, 'ss_select' => $ss_select, 'sf_select' => $sf_select, 'views_select' => $views_select, 'keywords_select' => $keywords_select, 'album_views_select' => $album_views_select, 'display_album_desc_select' => $display_album_desc_select, 'sort_select' => $sort_select, 'rss_select' => $rss_select, 'afirst_select' => $afirst_select, 'tn_size_select' => $tn_size_select, 'display_image_size' => $display_image_size_select, 'rows_input' => $rows_input, 'columns_input' => $columns_input, 'playback_type' => $playback_type, 'album_title' => $album->title, 'album_desc' => $album->description, 'album_id' => $album_id, 'parent_select' => $album_selectbox, 'album_cover' => $album->cover, 'album_owner' => $album->owner_id, 'album_order' => $album->order, 'album_cover_filename' => $album->cover_filename, 'last_update' => $album->last_update, 'media_count' => $album->media_count, 'wm_auto_select' => $wm_auto_select, 'wm_opacity_select' => $wm_opacity_select, 'wm_location_select' => $wm_location_select, 'wm_select' => $wm_select, 'wm_current' => $wm_current, 'album_theme_select' => $album_theme_select, 'album_sort_select' => $album_sort_select, 'allow_download_select' => $allow_download_select, 'filename_title_select' => $filename_title_select, 'skin_select' => $skin_select, 'askin_select' => $askin_select, 'dskin_select' => $dskin_select, 'tnheight_input' => $tnheight_input, 'tnwidth_input' => $tnwidth_input, 'usealternate_select' => $usealternate_select, 's_form_action' => $actionURL, 'lang_uploads' => $LANG_MG01['anonymous_uploads_prompt'], 'lang_accessrights' => $LANG_ACCESS['accessrights'], 'lang_owner' => $LANG_ACCESS['owner'], 'lang_group' => $LANG_ACCESS['group'], 'lang_permissions' => $LANG_ACCESS['permissions'], 'lang_perm_key' => $LANG_ACCESS['permissionskey'], 'lang_hidden' => $LANG_MG01['hidden'], 'permissions_msg' => $LANG_ACCESS['permmsg'], 'lang_member_upload' => $LANG_MG01['member_upload'], 'lang_moderate_album' => $LANG_MG01['mod_album'], 'lang_mod_group' => $LANG_MG01['moderation_group'], 'lang_force_child_update' => $LANG_MG01['force_child_update'], 'lang_allow_download' => $LANG_MG01['allow_download'], 'lang_email_mods_on_submission' => $LANG_MG01['email_mods_on_submission'], 'lang_usealternate' => $LANG_MG01['use_alternate_url'], 'lang_tnheight' => $LANG_MG01['tn_height'], 'lang_tnwidth' => $LANG_MG01['tn_width'], 'lang_save' => $LANG_MG01['save'], 'lang_edit_title' => $mode == 'create' ? $LANG_MG01['create_album'] : $LANG_MG01['edit_album'], 'lang_image_skin' => $LANG_MG01['image_skin'], 'lang_album_skin' => $LANG_MG01['album_skin'], 'lang_display_skin' => $LANG_MG01['display_skin'], 'lang_album_edit_help' => $LANG_MG01['album_edit_help'], 'lang_title' => $LANG_MG01['title'], 'lang_podcast' => $LANG_MG01['podcast'], 'lang_mp3ribbon' => $LANG_MG01['mp3ribbon'], 'lang_rsschildren' => $LANG_MG01['rsschildren'], 'lang_parent_album' => $LANG_MG01['parent_album'], 'lang_description' => $LANG_MG01['description'], 'lang_cancel' => $LANG_MG01['cancel'], 'lang_delete' => $LANG_MG01['delete'], 'lang_comments' => $LANG_MG01['comments_prompt'], 'lang_enable_exif' => $LANG_MG01['enable_exif'], 'lang_enable_ratings' => $LANG_MG01['enable_ratings'], 'lang_ss_enable' => $LANG_MG01['ss_enable'], 'lang_sf_enable' => $LANG_MG01['sf_enable'], 'lang_tn_size' => $LANG_MG01['tn_size'], 'lang_rows' => $LANG_MG01['rows'], 'lang_columns' => $LANG_MG01['columns'], 'lang_av_play_album' => $LANG_MG01['av_play_album'], 'lang_av_play_options' => $LANG_MG01['av_play_options'], 'lang_attached_thumbnail' => $LANG_MG01['attached_thumbnail'], 'lang_thumbnail' => $LANG_MG01['thumbnail'], 'lang_album_attributes' => $LANG_MG01['album_attributes'], 'lang_album_cover' => $LANG_MG01['album_cover'], 'lang_enable_views' => $LANG_MG01['enable_views'], 'lang_enable_keywords' => $LANG_MG01['enable_keywords'], 'lang_enable_album_views' => $LANG_MG01['enable_album_views'], 'lang_enable_sort' => $LANG_MG01['enable_sort'], 'lang_enable_rss' => $LANG_MG01['enable_rss'], 'lang_albums_first' => $LANG_MG01['albums_first'], 'lang_full_display' => $LANG_MG01['full_display'], 'lang_display_image_size' => $LANG_MG01['display_image_size'], 'lang_album_sort' => $LANG_MG01['default_album_sort'], 'lang_watermark' => $LANG_MG01['watermark'], 'lang_wm_auto' => $LANG_MG01['watermark_auto'], 'lang_wm_opacity' => $LANG_MG01['watermark_opacity'], 'lang_wm_location' => $LANG_MG01['watermark_location'], 'lang_wm_id' => $LANG_MG01['watermark_image'], 'lang_unlimited' => $LANG_MG01['zero_unlimited'], 'lang_display_album_desc' => $LANG_MG01['display_album_desc'], 'lang_filename_title' => $LANG_MG01['filename_title'], 'lang_media_attributes' => $LANG_MG01['media_attributes'], 'lang_theme_select' => $LANG_MG01['album_theme']));
    if (SEC_hasRights('mediagallery.admin')) {
        $T->set_var('perms_editor_admin', '1');
    } else {
        $T->set_var('perms_editor_member', '1');
    }
    if ($_MG_CONF['htmlallowed'] == 1) {
        $T->set_var('allowed_html', COM_allowedHTML());
    }
    $retval .= $T->finish($T->parse('output', 'admin'));
    return $retval;
}
Ejemplo n.º 2
0
function MG_buildSortbox($album_id, $sortOrder, $page)
{
    global $_MG_CONF, $LANG_MG03;
    $action = $_MG_CONF['site_url'] . '/album.php';
    $retval = '<form name="sortbox" id="sortbox" action="' . $action . '" method="get" class="uk-form"><div>' . LB;
    $retval .= '<input type="hidden" name="aid" value="' . $album_id . '"' . XHTML . '>' . LB;
    $retval .= '<input type="hidden" name="page" value="' . $page . '"' . XHTML . '>' . LB;
    $retval .= $LANG_MG03['sort_by'] . ':&nbsp;' . '<select name="sort" onchange="forms[\'sortbox\'].submit()">' . LB;
    $retval .= MG_options(array('current' => $sortOrder, 'values' => array('0' => $LANG_MG03['sort_default'], '1' => $LANG_MG03['sort_default_asc'], '2' => $LANG_MG03['sort_upload'], '3' => $LANG_MG03['sort_upload_asc'], '4' => $LANG_MG03['sort_capture'], '5' => $LANG_MG03['sort_capture_asc'], '6' => $LANG_MG03['sort_rating'], '7' => $LANG_MG03['sort_rating_asc'], '8' => $LANG_MG03['sort_views'], '9' => $LANG_MG03['sort_views_asc'], '10' => $LANG_MG03['sort_alpha'], '11' => $LANG_MG03['sort_alpha_asc'])));
    $retval .= '</select>' . LB;
    $retval .= '<input type="submit" value="' . $LANG_MG03['go'] . '"' . XHTML . '>' . LB;
    $retval .= '</div></form>' . LB;
    return $retval;
}