当前位置: 首页>>代码示例>>PHP>>正文


PHP Browse::set_sort方法代码示例

本文整理汇总了PHP中Browse::set_sort方法的典型用法代码示例。如果您正苦于以下问题:PHP Browse::set_sort方法的具体用法?PHP Browse::set_sort怎么用?PHP Browse::set_sort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Browse的用法示例。


在下文中一共展示了Browse::set_sort方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: videos

 /**
  * videos
  * This returns video objects!
  * @param array $input
  */
 public static function videos($input)
 {
     self::$browse->reset_filters();
     self::$browse->set_type('video');
     self::$browse->set_sort('title', 'ASC');
     $method = $input['exact'] ? 'exact_match' : 'alpha_match';
     Api::set_filter($method, $input['filter']);
     $video_ids = self::$browse->get_objects();
     XML_Data::set_offset($input['offset']);
     XML_Data::set_limit($input['limit']);
     echo XML_Data::videos($video_ids);
 }
开发者ID:nioc,项目名称:ampache,代码行数:17,代码来源:api.class.php

示例2: array

    $argument = scrub_in($_REQUEST['argument']);
}
$results = array();
switch ($_REQUEST['action']) {
    case 'browse':
        $object_ids = array();
        // Check 'value' with isset because it can null
        //(user type a "start with" word and deletes it)
        if ($_REQUEST['key'] && (isset($_REQUEST['multi_alpha_filter']) or isset($_REQUEST['value']))) {
            // Set any new filters we've just added
            $browse->set_filter($_REQUEST['key'], $_REQUEST['multi_alpha_filter']);
            $browse->set_catalog($_SESSION['catalog']);
        }
        if ($_REQUEST['sort']) {
            // Set the new sort value
            $browse->set_sort($_REQUEST['sort']);
        }
        if ($_REQUEST['catalog_key'] || $_SESSION['catalog'] != 0) {
            $browse->set_filter('catalog', $_REQUEST['catalog_key']);
            $_SESSION['catalog'] = $_REQUEST['catalog_key'];
        } elseif ($_REQUEST['catalog_key'] == 0) {
            $browse->set_filter('catalog', null);
            unset($_SESSION['catalog']);
        }
        ob_start();
        $browse->show_objects(null, $argument);
        $results[$browse->get_content_div()] = ob_get_clean();
        break;
    case 'set_sort':
        if ($_REQUEST['sort']) {
            $browse->set_sort($_REQUEST['sort']);
开发者ID:nioc,项目名称:ampache,代码行数:31,代码来源:browse.ajax.php

示例3: Playlist

require_once '../lib/init.php';
debug_event('refresh_reordered.server.php', 'Called for action: {' . $_REQUEST['action'] . '}', '5');
/* Switch on the action passed in */
switch ($_REQUEST['action']) {
    case 'refresh_playlist_medias':
        $playlist = new Playlist($_REQUEST['id']);
        $playlist->format();
        $object_ids = $playlist->get_items();
        $browse = new Browse();
        $browse->set_type('playlist_media');
        $browse->add_supplemental_object('playlist', $playlist->id);
        $browse->set_static_content(true);
        $browse->show_objects($object_ids);
        $browse->store();
        break;
    case 'refresh_album_songs':
        $browse = new Browse();
        $browse->set_show_header(true);
        $browse->set_type('song');
        $browse->set_simple_browse(true);
        $browse->set_filter('album', $_REQUEST['id']);
        $browse->set_sort('track', 'ASC');
        $browse->get_objects();
        echo "<div id='browse_content_song' class='browse_content'>";
        $browse->show_objects(null, true);
        // true argument is set to show the reorder column
        $browse->store();
        echo "</div>";
        break;
}
// switch on the action
开发者ID:bl00m,项目名称:ampache,代码行数:31,代码来源:refresh_reordered.server.php

示例4: User

            $history = $working_user->get_ip_history(0, 1);
        } else {
            $history = $working_user->get_ip_history();
        }
        require AmpConfig::get('prefix') . '/templates/show_ip_history.inc.php';
        break;
    case 'show_add_user':
        if (AmpConfig::get('demo_mode')) {
            break;
        }
        require_once AmpConfig::get('prefix') . '/templates/show_add_user.inc.php';
        break;
    case 'show_preferences':
        $client = new User($_REQUEST['user_id']);
        $preferences = Preference::get_all($client->id);
        require_once AmpConfig::get('prefix') . '/templates/show_user_preferences.inc.php';
        break;
    default:
        $browse = new Browse();
        $browse->reset_filters();
        $browse->set_type('user');
        $browse->set_simple_browse(true);
        $browse->set_sort('name', 'ASC');
        $user_ids = $browse->get_objects();
        $browse->show_objects($user_ids);
        $browse->store();
        break;
}
// end switch on action
/* Show the footer */
UI::show_footer();
开发者ID:nioc,项目名称:ampache,代码行数:31,代码来源:users.php

示例5: isset

        $browse->set_simple_browse(true);
        break;
}
// end switch
UI::show_header();
// Browser is able to save page on current session. Only applied to main menus.
$browse->set_update_session(true);
switch ($_REQUEST['action']) {
    case 'file':
        break;
    case 'album':
        $browse->set_filter('catalog', $_SESSION['catalog']);
        if (AmpConfig::get('catalog_disable')) {
            $browse->set_filter('catalog_enabled', '1');
        }
        $browse->set_sort('name', 'ASC');
        $browse->update_browse_from_session();
        // Update current index depending on what is in session.
        $browse->show_objects();
        break;
    case 'tag':
        //FIXME: This whole thing is ugly, even though it works.
        $browse->set_sort('count', 'ASC');
        // This one's a doozy
        $browse_type = isset($_REQUEST['type']) ? $_REQUEST['type'] : 'artist';
        $browse->set_simple_browse(false);
        $browse->save_objects(Tag::get_tags($browse_type, 0, 'name'));
        // Should add a pager?
        $object_ids = $browse->get_saved();
        $keys = array_keys($object_ids);
        Tag::build_cache($keys);
开发者ID:bl00m,项目名称:ampache,代码行数:31,代码来源:browse.php

示例6: Browse

    case 'broadcast':
        $browse->set_type($_REQUEST['action']);
        $browse->set_simple_browse(true);
        break;
}
// end switch
UI::show_header();
switch ($_REQUEST['action']) {
    case 'file':
        break;
    case 'album':
        $browse->set_filter('catalog', $_SESSION['catalog']);
        if (AmpConfig::get('catalog_disable')) {
            $browse->set_filter('catalog_enabled', '1');
        }
        $browse->set_sort('name', 'ASC');
        $browse->show_objects();
        break;
    case 'tag':
        //FIXME: This whole thing is ugly, even though it works.
        $browse->set_sort('count', 'ASC');
        // This one's a doozy
        $browse->set_simple_browse(false);
        $browse->save_objects(Tag::get_tags());
        // Should add a pager?
        $object_ids = $browse->get_saved();
        $keys = array_keys($object_ids);
        Tag::build_cache($keys);
        UI::show_box_top(T_('Tag Cloud'), 'box box_tag_cloud');
        $browse2 = new Browse();
        $browse2->set_type('song');
开发者ID:axelsimon,项目名称:ampache,代码行数:31,代码来源:browse.php


注:本文中的Browse::set_sort方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。