示例#1
0
function songlist($criteria, $table_prefix = 'cb_')
{
    global $database, $mainframe;
    // get the limits
    $limit = $mainframe->getUserStateFromRequest("viewlistlimit", 'limit', 10);
    $limitstart = $mainframe->getUserStateFromRequest("view{$option}limitstart", 'limitstart', 0);
    $chordBase = new ChordBase($database, "#__cb_");
    $chordBase->setCriteria($criteria);
    $songs = $chordBase->songlist($limitstart, $limit);
    $categories = $chordBase->getCategories();
    $writers = $chordBase->getWriters();
    include_once "includes/pageNavigation.php";
    $pageNav = new mosPageNav($chordBase->numSongs(), $limitstart, $limit);
    HTML_chordbase::songlist($songs, $categories, $writers, users_array(), $search, &$pageNav);
}
示例#2
0
 case "unpublished":
     $reqArray = $_SERVER['REQUEST_METHOD'] == "GET" ? $_GET : $_POST;
     $criteria["writerSearch"] = mosGetParam($reqArray, 'writerSearch', _WRITER . '...');
     $criteria["titleSearch"] = mosGetParam($reqArray, 'titleSearch', _TITLE . '...');
     $criteria["lyricSearch"] = mosGetParam($reqArray, 'lyricSearch', _LYRIC . '...');
     $criteria["initial"] = mosGetParam($_GET, 'initial', '');
     $criteria["mode"] = mosGetParam($_GET, 'mode', '');
     $criteria["search"] = mosGetParam($_GET, 'search', '');
     $criteria["order_by"] = mosGetParam($_GET, 'order_by', '');
     $criteria["search"] = $mainframe->getUserStateFromRequest("search{$option}", 'search', '');
     $criteria["unpublished_only"] = TRUE;
     // get the limits
     $criteria["limit"] = trim(mosGetParam($_REQUEST, 'limit', 20));
     $criteria["limitstart"] = trim(mosGetParam($_REQUEST, 'limitstart', 0));
     $chordBase->setCriteria($criteria);
     $songs = $chordBase->songlist();
     $categories = $chordBase->getCategories();
     $writers = $chordBase->getWriters();
     include_once "includes/pageNavigation.php";
     if (!$criteria["showAll"]) {
         $pageNav = new mosPageNav($chordBase->numSongs(), $criteria["limitstart"], $criteria["limit"]);
     } else {
         $pageNav = new mosPageNav($chordBase->numSongs(), 0, $chordBase->numSongs());
     }
     $permissions["Add Song"] = $chordBase->has_permission("Add Song", $cb_user_permission);
     $permissions["Publish Song"] = $chordBase->has_permission("Publish Song", $cb_user_permission);
     HTML_chordbase::songlist($songs, $categories, $writers, $search, &$pageNav, $permissions, $criteria);
     HTML_chordbase::footer();
     break;
 case "setlist":
     break;