コード例 #1
0
    /**
     * Renders the form that contains the buttons and links to watch/download 
     * and item
     */
    private function renderForm()
    {
        // Render the form with all the retrieval options
        echo CHtml::beginForm($this->getPlayListAction(), 'get');
        echo CHtml::hiddenField('id', $this->details->getId());
        // Show the "Play in XBMC" button to administrators
        if (Yii::app()->user->role === User::ROLE_ADMIN) {
            ?>
			<section>
				<?php 
            $this->renderPlayOnBackendButton();
            ?>
			</section>
			<?php 
        }
        // Show the "Play in browser" button when applicable
        $helper = new MediaInfoHelper($this->details);
        if (!$helper->needsTranscoding() && count($this->_links) === 1) {
            ?>
			<section>
				<?php 
            $this->renderWatchInBrowserButton();
            ?>
			</section>
			<?php 
        }
        ?>
		<section>
			<?php 
        $this->renderWatchButton();
        ?>
		</section>
		<?php 
        // Render the download links and close the form
        $this->renderLinks();
        echo CHtml::endForm();
    }
コード例 #2
0
    /**
     * Renders the form that contains the buttons and links to watch/download 
     * and item
     */
    private function renderForm()
    {
        // Render the form with all the retrieval options
        echo CHtml::beginForm($this->getPlayListAction(), 'get');
        echo CHtml::hiddenField('id', $this->details->getId());
        // Show the "Play in browser" button when applicable
        $helper = new MediaInfoHelper($this->details);
        if (!$helper->needsTranscoding() && count($this->_links) === 1) {
            ?>
			<section>
				<?php 
            $this->renderWatchInBrowserButton();
            ?>
			</section>
			<?php 
        }
        // Show the "Watch as playlist" button if the file is streamable,
        // otherwise show an alert
        if ($helper->isStreamable()) {
            ?>
			<section>
				<?php 
            $this->renderWatchButton();
            ?>
			</section>
			<?php 
        } else {
            $this->renderMissingFile();
        }
        // Render the download links and close the form
        $this->renderLinks();
        echo CHtml::endForm();
    }