當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Song::update_enabled方法代碼示例

本文整理匯總了PHP中Song::update_enabled方法的典型用法代碼示例。如果您正苦於以下問題:PHP Song::update_enabled方法的具體用法?PHP Song::update_enabled怎麽用?PHP Song::update_enabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Song的用法示例。


在下文中一共展示了Song::update_enabled方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Song

 */
/**
 * Sub-Ajax page, requires AJAX_INCLUDE
 */
if (!defined('AJAX_INCLUDE')) {
    exit;
}
switch ($_REQUEST['action']) {
    case 'flip_state':
        if (!Access::check('interface', '75')) {
            debug_event('DENIED', $GLOBALS['user']->username . ' attempted to change the state of a song', '1');
            exit;
        }
        $song = new Song($_REQUEST['song_id']);
        $new_enabled = $song->enabled ? false : true;
        $song->update_enabled($new_enabled, $song->id);
        $song->enabled = $new_enabled;
        $song->format();
        //Return the new Ajax::button
        $id = 'button_flip_state_' . $song->id;
        $button = $song->enabled ? 'disable' : 'enable';
        $results[$id] = Ajax::button('?page=song&action=flip_state&song_id=' . $song->id, $button, T_(ucfirst($button)), 'flip_state_' . $song->id);
        break;
    case 'shouts':
        ob_start();
        $type = $_REQUEST['object_type'];
        $id = $_REQUEST['object_id'];
        if ($type == "song") {
            $media = new Song($id);
            $shouts = Shoutbox::get_shouts($type, $id);
            echo "<script type='text/javascript'>\r\n";
開發者ID:cheese1,項目名稱:ampache,代碼行數:31,代碼來源:song.ajax.php

示例2: show_confirmation

     $next_url = AmpConfig::get('web_path') . '/admin/catalog.php';
     show_confirmation(T_('Catalog Deleted'), T_('The Catalog and all associated records have been deleted'), $next_url);
     break;
 case 'show_delete_catalog':
     $catalog_id = scrub_in($_GET['catalog_id']);
     $next_url = AmpConfig::get('web_path') . '/admin/catalog.php?action=delete_catalog&catalog_id=' . scrub_out($catalog_id);
     show_confirmation(T_('Catalog Delete'), T_('Confirm Deletion Request'), $next_url, 1, 'delete_catalog');
     break;
 case 'enable_disabled':
     if (AmpConfig::get('demo_mode')) {
         break;
     }
     $songs = $_REQUEST['song'];
     if (count($songs)) {
         foreach ($songs as $song_id) {
             Song::update_enabled(true, $song_id);
         }
         $body = count($songs) . ngettext(' Song Enabled', ' Songs Enabled', count($songs));
     } else {
         $body = T_('No Disabled Songs selected');
     }
     $url = AmpConfig::get('web_path') . '/admin/catalog.php';
     $title = count($songs) . ngettext(' Disabled Song Processed', ' Disabled Songs Processed', count($songs));
     show_confirmation($title, $body, $url);
     break;
 case 'clean_all_catalogs':
     $_REQUEST['catalogs'] = Catalog::get_catalogs();
 case 'clean_catalog':
     toggle_visible('ajax-loading');
     ob_end_flush();
     /* If they are in demo mode stop them here */
開發者ID:axelsimon,項目名稱:ampache,代碼行數:31,代碼來源:catalog.php


注:本文中的Song::update_enabled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。