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


PHP Browse::set_filter方法代码示例

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


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

示例1: playlists

 /**
  * playlists
  * This returns playlists based on the specified filter
  * @param array $input
  */
 public static function playlists($input)
 {
     self::$browse->reset_filters();
     self::$browse->set_type('playlist');
     self::$browse->set_sort('name', 'ASC');
     $method = $input['exact'] ? 'exact_match' : 'alpha_match';
     Api::set_filter($method, $input['filter']);
     self::$browse->set_filter('playlist_type', '1');
     $playlist_ids = self::$browse->get_objects();
     XML_Data::set_offset($input['offset']);
     XML_Data::set_limit($input['limit']);
     ob_end_clean();
     echo XML_Data::playlists($playlist_ids);
 }
开发者ID:nioc,项目名称:ampache,代码行数:19,代码来源:api.class.php

示例2: array

if (isset($_REQUEST['show_header']) && $_REQUEST['show_header']) {
    $browse->set_show_header($_REQUEST['show_header'] == 'true');
}
$argument = null;
if ($_REQUEST['argument']) {
    $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);
开发者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: Browse

', '<?php 
        echo T_('Album edit');
        ?>
', '')">
                <?php 
        echo UI::get_icon('edit', T_('Edit'));
        ?>
            </a>
        <?php 
    }
    ?>
    </div>
    <div id='reordered_list_<?php 
    echo $album_id;
    ?>
'>
    <?php 
    $browse = new Browse();
    $browse->set_show_header(false);
    $browse->set_type('song');
    $browse->set_simple_browse(true);
    $browse->set_filter('album', $album_id);
    $browse->set_sort('track', 'ASC');
    $browse->get_objects();
    $browse->show_objects(null, true);
    // true argument is set to show the reorder column
    $browse->store();
    ?>
    </div><br />
<?php 
}
开发者ID:cheese1,项目名称:ampache,代码行数:31,代码来源:show_album_group_disks.inc.php

示例5: isset

    case 'pvmsg':
    case 'podcast':
    case 'podcast_episode':
        $browse->set_type($_REQUEST['action']);
        $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'));
开发者ID:bl00m,项目名称:ampache,代码行数:31,代码来源:browse.php

示例6: xoutput_from_array

        $tag = new Tag($_GET['tag_id']);
        $tag->delete();
        header('Location: ' . AmpConfig::get('web_path') . '/browse.php?action=tag');
        exit;
    case 'remove_tag_map':
        debug_event('tag.ajax', 'Removing tag map...', '5');
        $tag = new Tag($_GET['tag_id']);
        $tag->remove_map($_GET['type'], $_GET['object_id']);
        break;
    case 'browse_type':
        $browse = new Browse($_GET['browse_id']);
        $browse->set_filter('object_type', $_GET['type']);
        $browse->store();
        break;
    case 'add_filter':
        $browse = new Browse($_GET['browse_id']);
        $browse->set_filter('tag', $_GET['tag_id']);
        $object_ids = $browse->get_objects();
        ob_start();
        $browse->show_objects($object_ids);
        $results[$browse->get_content_div()] = ob_get_clean();
        $browse->store();
        // Retrieve current objects of type based on combined filters
        break;
    default:
        $results['rfc3514'] = '0x1';
        break;
}
// switch on action;
// We always do this
echo xoutput_from_array($results);
开发者ID:nioc,项目名称:ampache,代码行数:31,代码来源:tag.ajax.php

示例7:

    case 'live_stream':
    case 'video':
    case 'song':
    case 'channel':
    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);
开发者ID:axelsimon,项目名称:ampache,代码行数:31,代码来源:browse.php


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