Example #1
0
if (!$is_share) {
    ?>
      <div class="player_actions">
<?php 
    if (AmpConfig::get('broadcast') && Access::check('interface', '25')) {
        ?>
        <div id="broadcast" class="broadcast action_button">
<?php 
        if (AmpConfig::get('broadcast_by_default')) {
            $broadcasts = Broadcast::get_broadcasts($GLOBALS['user']->id);
            if (count($broadcasts) < 1) {
                $broadcast_id = Broadcast::create(T_('My Broadcast'));
            } else {
                $broadcast_id = $broadcasts[0];
            }
            $broadcast = new Broadcast($broadcast_id);
            $key = Broadcast::generate_key();
            $broadcast->update_state(true, $key);
            echo Broadcast::get_unbroadcast_link($broadcast_id) . '<script type="text/javascript">startBroadcast(\'' . $key . '\');</script>';
        } else {
            echo Broadcast::get_broadcast_link();
        }
        ?>
        </div>
<?php 
    }
    if ($iframed) {
        ?>
        <?php 
        if (Access::check('interface', '25')) {
            ?>
 protected function registerBroadcast($from, $broadcast_key)
 {
     $broadcast = Broadcast::get_broadcast($broadcast_key);
     if ($broadcast) {
         $this->broadcasters[$from->resourceId] = $broadcast;
         $this->listeners[$broadcast->id] = array();
         if ($this->verbose) {
             echo "[info]Broadcast " . $broadcast->id . " registered." . "\r\n";
         }
     }
 }
Example #3
0
 */
require_once 'lib/init.php';
if (!AmpConfig::get('broadcast')) {
    UI::access_denied();
    exit;
}
UI::show_header();
/* Switch on the action passed in */
switch ($_REQUEST['action']) {
    case 'show_delete':
        $id = $_REQUEST['id'];
        $next_url = AmpConfig::get('web_path') . '/broadcast.php?action=delete&id=' . scrub_out($id);
        show_confirmation(T_('Broadcast Delete'), T_('Confirm Deletion Request'), $next_url, 1, 'delete_broadcast');
        UI::show_footer();
        exit;
    case 'delete':
        if (AmpConfig::get('demo_mode')) {
            UI::access_denied();
            exit;
        }
        $id = $_REQUEST['id'];
        $broadcast = new Broadcast($id);
        if ($broadcast->delete()) {
            $next_url = AmpConfig::get('web_path') . '/browse.php?action=broadcast';
            show_confirmation(T_('Broadcast Deleted'), T_('The Broadcast has been deleted'), $next_url);
        }
        UI::show_footer();
        exit;
}
// switch on the action
UI::show_footer();
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
?>

<ul>
<?php 
$broadcasts = Broadcast::get_broadcasts($GLOBALS['user']->id);
foreach ($broadcasts as $broadcast_id) {
    $broadcast = new Broadcast($broadcast_id);
    $broadcast->format();
    ?>
    <li>
        <a href="javascript:void(0);" id="rb_append_dbroadcast_<?php 
    echo $broadcast->id;
    ?>
" onclick="handleBroadcastAction('<?php 
    echo AmpConfig::get('ajax_url') . '?page=player&action=broadcast&broadcast_id=' . $broadcast->id;
    ?>
', 'rb_append_dbroadcast_<?php 
    echo $broadcast->id;
    ?>
');">
            <?php 
    echo $broadcast->f_name;
Example #5
0
        $results = ob_get_contents();
        ob_end_clean();
        echo $results;
        exit;
    case 'broadcast':
        $broadcast_id = $_GET['broadcast_id'];
        if (empty($broadcast_id)) {
            $broadcast_id = Broadcast::create(T_('My Broadcast'));
        }
        $broadcast = new Broadcast($broadcast_id);
        if ($broadcast->id) {
            $key = Broadcast::generate_key();
            $broadcast->update_state(true, $key);
            $results['broadcast'] = Broadcast::get_unbroadcast_link($broadcast_id) . '' . '<script type="text/javascript">startBroadcast(\'' . $key . '\');</script>';
        }
        break;
    case 'unbroadcast':
        $broadcast_id = $_GET['broadcast_id'];
        $broadcast = new Broadcast($broadcast_id);
        if ($broadcast->id) {
            $broadcast->update_state(false);
            $results['broadcast'] = Broadcast::get_broadcast_link() . '' . '<script type="text/javascript">stopBroadcast();</script>';
        }
        break;
    default:
        $results['rfc3514'] = '0x1';
        break;
}
// switch on action;
// We always do this
echo xoutput_from_array($results);
Example #6
0
?>
</th>
            <th class="cel_listeners optional"><?php 
echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&type=broadcast&sort=listeners', T_('Listeners'), 'broadcast_sort_listeners');
?>
</th>
            <th class="cel_action essential"><?php 
echo T_('Actions');
?>
</th>
        </tr>
    </thead>
    <tbody>
        <?php 
foreach ($object_ids as $broadcast_id) {
    $libitem = new Broadcast($broadcast_id);
    $libitem->format();
    ?>
        <tr class="<?php 
    echo UI::flip_class();
    ?>
" id="broadcast_row_<?php 
    echo $libitem->id;
    ?>
">
            <?php 
    require AmpConfig::get('prefix') . UI::find_template('show_broadcast_row.inc.php');
    ?>
        </tr>
        <?php 
}
Example #7
0
             }
             break;
         case 'live_stream_row':
             $key = 'live_stream_' . $_POST['id'];
             Radio::update($_POST);
             $radio = new Radio($_POST['id']);
             $radio->format();
             break;
         case 'channel_row':
             $key = 'channel_row_' . $_POST['id'];
             $channel = new Channel($_POST['id']);
             $channel->update($_POST);
             break;
         case 'broadcast_row':
             $key = 'broadcast_row_' . $_POST['id'];
             $broadcast = new Broadcast($_POST['id']);
             $broadcast->update($_POST);
             break;
         case 'tag_row':
             $tag = new Tag($_POST['id']);
             $tag->update($_POST['name']);
             break;
         default:
             $key = 'rfc3514';
             echo xoutput_from_array(array($key => '0x1'));
             exit;
     }
     // end switch on type
     $results['id'] = $new_id;
     break;
 case 'current_playlist':
Example #8
0
 public function get_broadcastsvis($id)
 {
     $broadcast = Broadcast::find($id);
     if ($broadcast->status == 0) {
         $broadcast->status = 1;
     } else {
         $broadcast->status = 0;
     }
     $broadcast->save();
     return Redirect::route('consolebroadcasts')->with('message', 'Broadcast Visibility Successfully Updated');
 }