function mcm_web_print_table($args)
{
    global $mcm;
    extract($args, EXTR_PREFIX_ALL, 'arg');
    /* 
     * required:
     *
     * $arg_action      - {prev,next} order
     * $arg_start       - query start offset
     * $arg_item_status - {accepted,rejected,undefined}
     * $arg_item_type   - user-defined item type
     *
     */
    $limit = 6;
    /* TODO: set this as a config option */
    $table_cols = 3;
    $start = $arg_start;
    $start = $arg_action == 'next' ? $start + $limit : $start;
    $start = $arg_action == 'prev' ? $start - $limit : $start;
    /* determine number of items available */
    $params = array('user_id' => $mcm['user_id'], 'item_status' => $arg_item_status, 'item_type' => $arg_item_type, 'order' => 'artist_name, album_name, item_quality', 'limit' => "{$start}, {$limit}");
    $items_list = mcm_action('lookup_itemlist', $params);
    $num_items = mcm_action('lookup_itemlist_count', $params);
    if ($num_items == 0) {
        mcm_web_nothing_to_review();
        return;
    }
    ?>
<form method="post" action="<?php 
    echo $mcm['self'];
    ?>
">
<table id="list-and-nav" class="center">
    <tr>
        <td id="nav-left" class="nav">
            <?php 
    print_navigation($start, $limit, $num_items, 'left');
    ?>
        </td>
        
        <td>
            <table id="list">
            <input type="hidden" name="start" value="<?php 
    echo $start;
    ?>
">
            <input type="hidden" name="item_status" value="<?php 
    echo $arg_item_status;
    ?>
">
            <input type="hidden" name="item_type" value="<?php 
    echo $arg_item_type;
    ?>
">
<?php 
    $row_number = 0;
    foreach ($items_list as $id => $row) {
        /* load current item status from db into session */
        if (!isset($_SESSION['status'][$id])) {
            $_SESSION['status'][$id] = $arg_item_status;
        }
        $row_number++;
        $album_dirname = "[{$row['artist_name']}] [{$row['album_name']}] [{$row['item_quality']}]";
        $cover_url = mcm_action('create_cover_url', $album_dirname);
        $playlist_url = create_player($album_dirname);
        echo ($row_number - 1) % $table_cols == 0 ? "       <tr>\n" : "";
        ?>
                    <td class="item" id="id<?php 
        echo $id;
        ?>
-item">
                        <div id="id<?php 
        echo $id;
        ?>
-artist" class="artist"><?php 
        echo $row['artist_name'];
        ?>
</div>
                        <div id="id<?php 
        echo $id;
        ?>
-album" class="album"><?php 
        echo $row['album_name'];
        ?>
</div>
                        <div class="cover-container" onmouseover="if (isMouseLeaveOrEnter(event, this)) showOverlay('id<?php 
        echo $id;
        ?>
')" onmouseout="if (isMouseLeaveOrEnter(event, this)) hideOverlay('id<?php 
        echo $id;
        ?>
')">
                            <a href="#" onmousedown="loadPlaylist('<?php 
        echo $playlist_url;
        ?>
', '<?php 
        echo $cover_url;
        ?>
'); return false;">
                                <img id="id<?php 
        echo $id;
        ?>
-overlay" src="images/overlay.png" class="overlay" alt="">
                                <img id="id<?php 
        echo $id;
        ?>
-cover" src="<?php 
        echo $cover_url;
        ?>
" class="cover<?php 
        print_cover_class($id, $_SESSION['status'][$id]);
        ?>
" alt="album cover" width="150" height="150">
                            </a>
                        </div>
                        <div class="choices">
                            <a href="#" onmousedown="clickRadio('id<?php 
        echo $id;
        ?>
', 'add'); return false;"><img id="id<?php 
        echo $id;
        ?>
-img-add" src="images/add<?php 
        print_button($id, 'accepted');
        ?>
.png" alt="Add" title="Add"></a>
                            <input type="radio" id="id<?php 
        echo $id;
        ?>
-add" name="id<?php 
        echo $id;
        ?>
" value="accepted"<?php 
        print_checkbox($id, 'accepted');
        ?>
>
                            <a href="#" onmousedown="clickRadio('id<?php 
        echo $id;
        ?>
', 'rem'); return false;"><img id="id<?php 
        echo $id;
        ?>
-img-rem" src="images/remove<?php 
        print_button($id, 'rejected');
        ?>
.png" alt="Remove" title="Remove"></a>
                            <input type="radio" id="id<?php 
        echo $id;
        ?>
-rem" name="id<?php 
        echo $id;
        ?>
" value="rejected"<?php 
        print_checkbox($id, 'rejected');
        ?>
>
                            <a href="#" onmousedown="clickRadio('id<?php 
        echo $id;
        ?>
', 'und'); return false;"><img id="id<?php 
        echo $id;
        ?>
-img-und" src="images/undecided<?php 
        print_button($id, 'undefined');
        ?>
.png" alt="Undecided" title="Undecided"></a>
                            <input type="radio" id="id<?php 
        echo $id;
        ?>
-und" name="id<?php 
        echo $id;
        ?>
" value="undefined"<?php 
        print_checkbox($id, 'undefined');
        ?>
>
                        </div>
                    </td>
<?php 
        echo $row_number % $table_cols == 0 ? "       </tr>\n" : "";
    }
    echo $row_number % $table_cols != 0 ? "     </tr>\n" : "";
    ?>
                </tr>
            </table>
        </td>
    
        <td id="nav-right" class="nav">
            <?php 
    print_navigation($start, $limit, $num_items, 'right');
    ?>
        </td>
    </tr>
</table>

<div id="selected-artist"></div>
<div id="selected-album"></div>

<table id="player-table" class="center">
    <tr>
        <td id="player-cover-container">
            <img id="player-cover" src="images/player-cover.png" alt="Album Cover" width="100" height="100">
        </td>
        <td rowspan="2" id="player-meta">
        <div id="player-artist"></div>
        <div id="player-album"></div>
        <div id="player-title"></div>
        <div id="player-next">
            <span id="player-next-label"></span><span id="player-next-title"></span>
        </div>
        </td>
    </tr>
    <tr>
        <td id="player-controls">
            <a href="#" onmousedown="player.sendEvent('PREV'); return false;"><img src="images/rew.png" alt="Rewind" title="Previous Track"></a>
            <a href="#" onmousedown="player.sendEvent('PLAY'); return false;"><img src="images/play-pause.png" alt="Play/Pause" title="Play/Pause"></a>
            <a href="#" onmousedown="player.sendEvent('NEXT'); return false;"><img src="images/fwd.png" alt="Forward" title="Next Track"></a>
        </td>
    </tr>
</table>

<div id="toolbar">
    <a href="#" onclick="alert('Help not implemented. Yet.'); return false;"><img src="images/help.png" title="Help" alt="Help"></a> | 
    <input type="image" src="images/save-exit.png" name="submit" value="finish" title="Save and Exit"> |
    <input type="image" src="images/exit.png" name="submit" value="exit" title="Exit Without Saving" onclick="return confirm('You will lose all current selections!\n\nAre you sure you want to exit without saving?');">
</div>
<p id="player" style="text-align: center;">Media player requires Adobe Flash Player to be installed. <a href="http://www.adobe.com/go/getflashplayer">Download now</a>.</p>

</form>
<?php 
}
Esempio n. 2
0
function display_init()
{
    global $gbl, $sgbl, $login, $ghtml;
    initProgram();
    initLanguage();
    if ($sgbl->is_this_slave()) {
        print "This is a Slave Server. You control it at the Master Server.\n";
        exit;
    }
    // The only thing that gets modified when the dbaction is not a modify action, is the ssession table. Other tables should get modified only inside non-form actions.
    if (isModifyAction() && isUpdating()) {
        $ghtml->print_redirect_back('system_is_updating_itself', '');
        exit;
    }
    try {
        do_display_init();
        main_system_lock();
        print_navigation($gbl->__navig);
        if (if_demo()) {
            //$url = $ghtml->get_get_from_current_post(null);
            //log_clicks($url);
        }
        print_warning();
        password_contact_check();
    } catch (Exception $e) {
        log_log("redirect_error", "exception");
        $gbl->setSessionV('__tmp_redirect_var', $ghtml->__http_vars);
        $gbl->c_session->write();
        if (is_array($e->variable)) {
            $evlist = implode(",", $e->variable);
        } else {
            $evlist = $e->variable;
        }
        $ghtml->print_redirect_back($e->getMessage(), $evlist, $e->value);
        exit;
    }
    //license_check();
    if ($ghtml->frm_filter) {
        $filtername = $gbl->__c_object->getFilterVariableForThis($ghtml->frm_o_cname);
        $list[$filtername] = $ghtml->frm_filter;
        $login->setupHpFilter($list);
        $login->setUpdateSubaction();
    }
    if ($ghtml->frm_hpfilter) {
        //dprintr($ghtml->frm_hpfilter);
        $login->setupHpFilter($ghtml->frm_hpfilter);
        $login->setUpdateSubaction();
    }
}
Esempio n. 3
0
        <div class="headermenu"><?php 
    echo $menu;
    ?>
</div>
    </div>
<?php 
}
?>

<?php 
if ($navigation) {
    // This is the navigation bar with breadcrumbs
    ?>
    <div class="navbar clearfix">
        <div class="breadcrumb"><?php 
    print_navigation($navigation);
    ?>
</div>
        <div class="navbutton"><?php 
    echo $PAGE->button;
    ?>
</div>
    </div>
<?php 
} else {
    if ($PAGE->heading) {
        // If no navigation, but a heading, then print a line
        ?>
    <hr />
<?php 
    }
Esempio n. 4
0
function display_init()
{
    global $gbl, $sgbl, $login, $ghtml;
    initProgram();
    init_language();
    if ($sgbl->is_this_slave()) {
        print _("This is a Slave Server. Operate it at the Master.") . "\n";
        exit;
    }
    if (isModifyAction() && isUpdating()) {
        $ghtml->print_redirect_back('system_is_updating_itself', '');
        exit;
    }
    try {
        do_display_init();
        print "<!-- Load Navigation -->\n";
        print_navigation($gbl->__navig);
        print "<!-- Load Warning -->\n";
        print_warning();
        print "<!-- Load Password Contact Check -->\n";
        password_contact_check();
    } catch (Exception $e) {
        log_log("redirect_error", "exception");
        $gbl->setSessionV('__tmp_redirect_var', $ghtml->__http_vars);
        $gbl->c_session->write();
        if (is_array($e->variable)) {
            $evlist = implode(",", $e->variable);
        } else {
            $evlist = $e->variable;
        }
        $ghtml->print_redirect_back($e->getMessage(), $evlist, $e->value);
        exit;
    }
    if ($ghtml->frm_filter) {
        $filtername = $gbl->__c_object->getFilterVariableForThis($ghtml->frm_o_cname);
        $list[$filtername] = $ghtml->frm_filter;
        $login->setupHpFilter($list);
        $login->setUpdateSubaction();
    }
    if ($ghtml->frm_hpfilter) {
        $login->setupHpFilter($ghtml->frm_hpfilter);
        $login->setUpdateSubaction();
    }
}