public function onAfterTrackLink(&$item, $params, $TitleName = null) { $session = JFactory::getSession(); $app = JFactory::getApplication(); if ($app->isAdmin() && $this->params->get('plg_playjoom_barplayer_params_basic_view') == 'site' || $app->isSite() && $this->params->get('plg_playjoom_barplayer_params_basic_view') == 'admin') { return null; } else { $rootURL = rtrim(JURI::base(), '/'); $subpathURL = JURI::base(true); if (!empty($subpathURL) && $subpathURL != '/') { $rootURL = substr($rootURL, 0, -1 * strlen($subpathURL)); } if (isset($item->id) && isset($item->file)) { $html = ''; if ($app->isAdmin()) { $link = $rootURL . JRoute::_('index.php?option=com_playjoom&view=broadcast&format=raw&tlk=' . hash('sha256', $session->getId() . '+' . PlayJoomHelper::getUserIP() . '+' . $item->id) . '&id=' . $item->id) . '&track.mp3'; $track_link = str_replace('/administrator', '', $link); } else { $track_link = $rootURL . JRoute::_('index.php?option=com_playjoom&view=broadcast&format=raw&tlk=' . hash('sha256', $session->getId() . '+' . PlayJoomHelper::getUserIP() . '+' . $item->id) . '&id=' . $item->id) . '&track.mp3'; } //$html .= '<div class="ui360" style="margin-top:-0.55em;"><a href="'.JURI::root(false).'index.php?option=com_playjoom&view=broadcast&id='.$item->id.'&'.urlencode($item->file).'"></a></div>'; $html .= '<div class="ui360" style="margin-top:-0.55em;"><a href="' . $track_link . '"></a></div>'; } else { return null; } return $html; } }
/** * Method for to add the page title and toolbar for the audiotracks viewer. * * @since 1.6 * @return void */ protected function addToolBar() { // set some global property $canDo = PlayJoomHelper::getActions(); JToolBarHelper::title(JText::_('COM_PLAYJOOM_AUDIOTRACK_MANAGER_PLAYJOOM'), 'audiotracks'); if ($canDo->get('core.create')) { $bar = JToolBar::getInstance('toolbar'); //New tracks button $title = JText::_('COM_PLAYJOOM_TOOLBAR_ADD_TRACKS'); $dhtml = "<button onclick=\"window.location = 'index.php?option=com_playjoom&view=media';\" class=\"btn btn-small btn-success\">\n\t\t <i class=\"icon-music icon-white\" title=\"{$title}\"></i>\n\t\t {$title}</button>"; $bar->appendButton('Custom', $dhtml, 'Add_folder-tracks'); $bar->appendButton('Standard', 'music', 'COM_PLAYJOOM_TOOLBAR_ADD_TRACK', 'audiotrack.add', false); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('audiotrack.edit', 'COM_PLAYJOOM_TOOLBAR_EDIT_TRACK'); } if ($canDo->get('core.delete')) { JToolBarHelper::deleteList(JText::_('COM_PLAYJOOM_REALLY_DELETE'), 'audiotracks.delete', 'COM_PLAYJOOM_TOOLBAR_DELETE_TRACK'); } // Add a batch button if ($canDo->get('core.edit')) { JHtml::_('bootstrap.modal', 'collapseModal'); $title = JText::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button $layout = new JLayoutFile('joomla.toolbar.batch'); $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); } if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_playjoom'); } //Set sidebar content JHtmlSidebar::setAction('index.php?option=com_playjoom&view=audiotracks'); }
/** * Setting the toolbar */ protected function addToolBar() { JRequest::setVar('hidemainmenu', true); $user = JFactory::getUser(); $userId = $user->id; $isNew = $this->item->id == 0; $canDo = PlayJoomHelper::getActions($this->item->id); $document = JFactory::getDocument(); $document->addStyleDeclaration('.icon-48-addtrack {background-image: url(components/com_playjoom/images/header/icon-48-addtrack.gif);}'); JToolBarHelper::title($isNew ? JText::_('COM_PLAYJOOM_MANAGER_PLAYJOOM_NEW') : JText::_('COM_PLAYJOOM_MANAGER_PLAYJOOM_EDIT'), 'addtrack'); // Built the actions for new and existing records. if ($isNew) { // For new records, check the create permission. if ($canDo->get('core.create')) { JToolBarHelper::apply('audiotrack.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('audiotrack.save', 'JTOOLBAR_SAVE'); JToolBarHelper::custom('audiotrack.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } JToolBarHelper::cancel('audiotrack.cancel', 'JTOOLBAR_CANCEL'); } else { if ($canDo->get('core.edit')) { // We can save the new record JToolBarHelper::apply('audiotrack.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('audiotrack.save', 'JTOOLBAR_SAVE'); // We can save this record, but check the create permission to see if we can return to make a new one. if ($canDo->get('core.create')) { JToolBarHelper::custom('audiotrack.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } } if ($canDo->get('core.create')) { JToolBarHelper::custom('audiotrack.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } JToolBarHelper::cancel('audiotrack.cancel', 'JTOOLBAR_CLOSE'); } }
/** * Method for to set the toolbar items * * @return void */ protected function addToolBar() { $config = JComponentHelper::getParams('com_playjoom'); $session = JFactory::getSession(); $this->assignRef('session', $session); $this->assignRef('config', $config); JFactory::getApplication()->input->set('hidemainmenu', true); $user = JFactory::getUser(); $canDo = PlayJoomHelper::getActions(); if (isset($this->item->id) && is_numeric($this->item->id)) { JToolbarHelper::title(JText::_('COM_PLAYJOOM_MANAGER_PLAYJOOM_EDIT_COVER')); } else { JToolbarHelper::title(JText::_('COM_PLAYJOOM_MANAGER_PLAYJOOM_NEW_COVER')); } if ($canDo->get('core.edit') || $canDo->get('core.create')) { if (isset($this->item->id) && is_numeric($this->item->id)) { JToolbarHelper::apply('cover.apply'); JToolbarHelper::save('cover.save'); } else { JToolbarHelper::apply('addcover.apply'); } } if (empty($this->item->id)) { JToolbarHelper::cancel('cover.cancel'); } else { JToolbarHelper::cancel('cover.cancel', 'JTOOLBAR_CLOSE'); } }
/** * Setting the toolbar */ protected function addToolBar() { JRequest::setVar('hidemainmenu', true); $user = JFactory::getUser(); $userId = $user->id; $isNew = $this->item->id == 0; $canDo = PlayJoomHelper::getActions($this->item->id); JToolBarHelper::title($isNew ? JText::_('COM_PLAYJOOM_MANAGER_PLAYJOOM_NEW') : JText::_('COM_PLAYJOOM_MANAGER_PLAYJOOM_EDIT_ARTIST'), 'Edit Artist'); // Built the actions for new and existing records. if ($isNew) { // For new records, check the create permission. if ($canDo->get('core.create')) { JToolBarHelper::apply('album.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('album.save', 'JTOOLBAR_SAVE'); JToolBarHelper::custom('album.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } JToolBarHelper::cancel('album.cancel', 'JTOOLBAR_CANCEL'); } else { if ($canDo->get('core.edit')) { // We can save the new record JToolBarHelper::apply('album.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('album.save', 'JTOOLBAR_SAVE'); // We can save this record, but check the create permission to see if we can return to make a new one. if ($canDo->get('core.create')) { JToolBarHelper::custom('album.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } } if ($canDo->get('core.create')) { JToolBarHelper::custom('album.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } JToolBarHelper::cancel('album.cancel', 'JTOOLBAR_CLOSE'); } }
/** * Setting the toolbar */ protected function addToolBar() { $canDo = PlayJoomHelper::getActions(); JToolBarHelper::title(JText::_('COM_PLAYJOOM_MANAGER_PLAYJOOMS'), 'playjoom'); if ($canDo->get('core.admin')) { // place holder } }
function display($tpl = null) { $dispatcher = JDispatcher::getInstance(); // Get data from the model $items = $this->get('Items'); // Check for errors. if (count($errors = $this->get('Errors'))) { $dispatcher->trigger('onEventLogging', array(array('method' => __METHOD__ . ":" . __LINE__, 'message' => 'Problem with datadase request: ' . implode("\r\n", $errors), 'priority' => JLog::ERROR, 'section' => 'site'))); return false; } //Load helper files JLoader::import('helpers.download', JPATH_SITE . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_playjoom'); JLoader::import('helpers.playlist', JPATH_SITE . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_playjoom'); // Create folder name if (JRequest::getVar('source') == 'album') { $foldername = JApplication::stringURLSafe(base64_decode(JRequest::getVar('artist'))) . ' - ' . JApplication::stringURLSafe(base64_decode(JRequest::getVar('name'))); } else { $foldername = JApplication::stringURLSafe(base64_decode(JRequest::getVar('name'))); } $CreateArchivFile = new PlayJoomHelperDownload(); // Add the info file into the archive $CreateInfoFile = new PlayJoomHelperPlaylist(); $CreateInfoFile->createInfoFile($items); $CreateArchivFile->addFile($CreateInfoFile->file(), $foldername . DIRECTORY_SEPARATOR . 'readme.txt'); // Add the playlist files into the archive $CreateM3UPlaylistFile = new PlayJoomHelperPlaylist(); $CreateM3UPlaylistFile->CreateM3UList($items, true); $CreateArchivFile->addFile($CreateM3UPlaylistFile->file(), $foldername . DIRECTORY_SEPARATOR . 'playlist.m3u'); $CreatePLSPlaylistFile = new PlayJoomHelperPlaylist(); $CreatePLSPlaylistFile->CreatePLSList($items, true); $CreateArchivFile->addFile($CreatePLSPlaylistFile->file(), $foldername . DIRECTORY_SEPARATOR . 'playlist.pls'); $CreateXSPFPlaylistFile = new PlayJoomHelperPlaylist(); $CreateXSPFPlaylistFile->CreateXSPFList($items, true); $CreateArchivFile->addFile($CreateXSPFPlaylistFile->file(), $foldername . DIRECTORY_SEPARATOR . 'playlist.xspf'); $CreateWPLPlaylistFile = new PlayJoomHelperPlaylist(); $CreateWPLPlaylistFile->CreateWPLList($items, true); $CreateArchivFile->addFile($CreateWPLPlaylistFile->file(), $foldername . DIRECTORY_SEPARATOR . 'playlist.wpl'); $dispatcher->trigger('onEventLogging', array(array('method' => __METHOD__ . ":" . __LINE__, 'message' => 'Ready for to create a download archiv file: ' . JApplication::stringURLSafe(JRequest::getVar('name')) . '.zip', 'priority' => JLog::INFO, 'section' => 'site'))); // Add the audio files into the archive foreach ($items as $i => $item) { if (JRequest::getVar('source') == 'album') { $filename = $item->tracknumber . ' - ' . JApplication::stringURLSafe($item->title) . '.' . PlayJoomHelper::getFileExtension($item->mediatype); } else { $filename = $i + 1 . ' - ' . JApplication::stringURLSafe($item->artist) . ' - ' . JApplication::stringURLSafe($item->title) . '.' . PlayJoomHelper::getFileExtension($item->mediatype); } $CreateArchivFile->addFile(file_get_contents($item->pathatlocal . DIRECTORY_SEPARATOR . $item->file), $foldername . DIRECTORY_SEPARATOR . $filename); } // Add cover file into archive, if once existing. $covercontent = PlayJoomHelper::getAlbumCover(base64_decode(JRequest::getVar('name')), base64_decode(JRequest::getVar('artist'))); if ($covercontent) { $CreateArchivFile->addFile($covercontent->data, $foldername . DIRECTORY_SEPARATOR . 'cover.' . PlayJoomHelper::getFileExtension($covercontent->mime)); } $CreateArchivFile->setHeader(JApplication::stringURLSafe($foldername) . '.zip', 'application/zip', mb_strlen($CreateArchivFile->file(), '8bit')); // Send the archiv $CreateArchivFile->send($CreateArchivFile->file()); }
/** * Setting the toolbar */ protected function addToolBar() { $canDo = PlayJoomHelper::getActions(); JToolBarHelper::title(JText::_('COM_PLAYJOOM_COVER_MANAGER_PLAYJOOM'), 'covers'); if ($canDo->get('core.create')) { JToolBarHelper::addNew('cover.add', 'COM_PLAYJOOM_TOOLBAR_ADD_NEW_COVER'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('cover.edit', 'COM_PLAYJOOM_TOOLBAR_EDIT_COVER'); } if ($canDo->get('core.delete')) { JToolBarHelper::deleteList(JText::_('COM_PLAYJOOM_REALLY_DELETE'), 'covers.delete', 'COM_PLAYJOOM_TOOLBAR_DELETE_COVER'); } if ($canDo->get('core.admin')) { JToolBarHelper::divider(); JToolBarHelper::preferences('com_playjoom'); } }
/** * Setting the toolbar */ protected function addToolBar() { $canDo = PlayJoomHelper::getActions(); JToolBarHelper::title(JText::_('COM_PLAYJOOM_MANAGER_PLAYJOOMS'), 'playjoom'); if ($canDo->get('core.create')) { JToolBarHelper::addNew('playjoom.add', 'JTOOLBAR_NEW'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('playjoom.edit', 'JTOOLBAR_EDIT'); } if ($canDo->get('core.delete')) { JToolBarHelper::deleteList('', 'playjoom.delete', 'JTOOLBAR_DELETE'); } if ($canDo->get('core.admin')) { JToolBarHelper::divider(); JToolBarHelper::preferences('com_playjoom'); } }
/** * Method for to add the page title and toolbar for the audiotracks viewer. * * @since 1.6 * @return void */ protected function addToolBar() { $canDo = PlayJoomHelper::getActions(); JToolBarHelper::title(JText::_('COM_PLAYJOOM_ARTIST_MANAGER_PLAYJOOM'), 'artists'); if ($canDo->get('core.create')) { JToolBarHelper::addNew('artist.add', 'COM_PLAYJOOM_TOOLBAR_ADD_NEW_ARTIST'); } if ($canDo->get('core.edit')) { JToolBarHelper::editList('artist.edit', 'COM_PLAYJOOM_TOOLBAR_EDIT_ARTIST'); } if ($canDo->get('core.delete')) { JToolBarHelper::deleteList(JText::_('COM_PLAYJOOM_REALLY_DELETE'), 'artists.delete', 'COM_PLAYJOOM_TOOLBAR_DELETE_ARTIST'); } if ($canDo->get('core.admin')) { JToolBarHelper::divider(); JToolBarHelper::preferences('com_playjoom'); } JHtmlSidebar::setAction('index.php?option=com_playjoom&view=albums'); JHtmlSidebar::addFilter(JText::_('COM_PLAYJOOM_FILTER_GENRE'), 'filter_category_id', JHtml::_('select.options', $this->FilterItemsGenres, 'value', 'text', $this->state->get('filter.category_id'))); }
public function onPrepareTrackLink(&$item, $params = null, $TitleName = null, $Request = 'site') { $html = null; $session = JFactory::getSession(); //If the event call comes from the albumviewer, then the $TitleName haven´t null if ($TitleName != null) { $TrackTitle = $TitleName; } else { if (isset($item->title)) { $TrackTitle = $item->title; } else { return null; } } if ($Request == 'admin') { $html .= '<a href="' . $this->rootURL . JRoute::_('index.php?option=com_playjoom&task=audiotrack.edit&id=' . $item->id) . '">' . $TrackTitle . '</a>'; } else { //$html .= '<a href="'.$this->rootURL.JRoute::_('/components/com_playjoom/broadcasthandler/index.php?id='.$item->id,true).'&track.mp3" title="'.JText::_( 'PLG_PLAYJOOM_TRACKCONTROL_PLAYTITLE' ).'" target="_blank" class="direct_link">'.$TrackTitle.'</a>'; $html .= '<a href="' . $this->rootURL . JRoute::_('index.php?option=com_playjoom&view=broadcast&format=raw&tlk=' . hash('sha256', $session->getId() . '+' . PlayJoomHelper::getUserIP() . '+' . $item->id) . '&id=' . $item->id, true) . '&track.mp3" title="' . JText::_('PLG_PLAYJOOM_TRACKCONTROL_PLAYTITLE') . '" target="_blank" class="direct_link">' . $TrackTitle . '</a>'; } return $html; }
public function onAfterTrackLink(&$item, $params, $TitleName = null) { $session = JFactory::getSession(); $app = JFactory::getApplication(); if ($app->isAdmin() && $this->params->get('plg_playjoom_playbutton_params_basic_view', 'both') == 'site' || $app->isSite() && $this->params->get('plg_playjoom_playbutton_params_basic_view', 'both') == 'admin') { return null; } else { $html = ''; $rootURL = rtrim(JURI::base(), '/'); $subpathURL = JURI::base(true); if (!empty($subpathURL) && $subpathURL != '/') { $rootURL = substr($rootURL, 0, -1 * strlen($subpathURL)); } if ($app->isAdmin()) { $link = $rootURL . JRoute::_('index.php?option=com_playjoom&view=broadcast&format=raw&tlk=' . hash('sha256', $session->getId() . '+' . PlayJoomHelper::getUserIP() . '+' . $item->id) . '&id=' . $item->id) . '&track.mp3'; $track_link = str_replace('/administrator', '', $link); } else { $track_link = $rootURL . JRoute::_('index.php?option=com_playjoom&view=broadcast&format=raw&tlk=' . hash('sha256', $session->getId() . '+' . PlayJoomHelper::getUserIP() . '+' . $item->id) . '&id=' . $item->id) . '&track.mp3'; } $html .= '<a href="' . $track_link . '" class="sm2_button" style="margin-left:15px;"></a>'; return $html; } }
function writeLogRow($content) { $params = JComponentHelper::getParams('com_playjoom'); if ($params->get('logging_active') == 1) { //set path for log file $log_path = '..' . DS . $params->get('logging_path') . DS; $log_file = $log_path . 'playjoom0.log'; if (!is_writable($log_path)) { return null; } //set ip setting if ($params->get('logging_ip', 0) == 1) { $client = 'Client: ' . $_SERVER['REMOTE_ADDR'] . ', '; } else { $client = null; } $sessionid = PlayJoomHelper::getSessionID(); //get time $log_time = PlayJoomLogging::getLogTime(); /* * check log file site * arrSize 0 -> all * arrSize 1 -> numbers * arrSize 2 -> letters */ preg_match("/([0-9]+)([a-z]+)/i", $params->get('logging_filesize'), $arrSize); if (file_exists($log_file)) { if (filesize($log_file) >= $arrSize[1] * PlayJoomLogging::getFactor($arrSize[2])) { rename($log_file, $log_path . 'playjoom1.log'); } } //write log row file_put_contents($log_file, $log_time . ' - ' . $client . $sessionid . ' - ' . $content . "\r\n", FILE_APPEND); } return null; }
*/ // No direct access to this file defined('_JEXEC') or die('Restricted Access'); //Get plugin contents $item_onBeforePJContent = $this->events->onBeforePJContent; $item_onAfterPJContent = $this->events->onAfterPJContent; // load tooltip behavior JHtml::_('behavior.tooltip'); JHtml::_('formbehavior.chosen', 'select'); //load javascript and css script $document = JFactory::getDocument(); // add style sheet if ($this->params->get('css_type', 'pj_css') == 'pj_css') { $document->addStyleSheet(JURI::root(true) . '/components/com_playjoom/assets/css/playlist_view.css'); } echo '<form action="' . JRoute::_('index.php?option=com_playjoom&&view=adminplaylist&listid=' . JRequest::getVar('listid') . '&Itemid=' . JRequest::getVar('Itemid')) . '" method="post" name="adminForm">'; echo $this->loadTemplate('toolbar'); //check if one or more track in the playlist if (PlayJoomHelper::getPlaylistEntries(JRequest::getVar('listid')) >= 1) { echo $item_onBeforePJContent; echo '<table class="adminlist">'; echo '<thead>' . $this->loadTemplate('head') . '</thead>'; echo '<tfoot>' . $this->loadTemplate('foot') . '</tfoot>'; echo '<tbody>' . $this->loadTemplate('body') . '</tbody>'; echo '</table>'; echo JHtml::_('form.token'); echo '</form>'; echo $item_onAfterPJContent; } else { echo JText::_('COM_PLAYJOOM_PLAYLIST_EMPTY'); }
/** * Method for to check if the requested track has a valid open session * * @param string $tlk hash of current session ID, track ID and user IP address. * * @return boolean */ public function checkValidSession($user_id, $pk) { $dispatcher = JDispatcher::getInstance(); $db = $this->getDbo(); $query = $db->getQuery(true); $query->from('#__session as s'); $query->select('s.session_id, s.userid'); $query->where('s.userid=' . (int) $user_id); $db->setQuery($query); $Valid_Sessions = $db->loadObjectList(); if (count($Valid_Sessions) >= 1) { foreach ($Valid_Sessions as $Valid_Session) { $session_form_db = hash('sha256', $Valid_Session->session_id . '+' . PlayJoomHelper::getUserIP() . '+' . $pk); $session_form_post = JFactory::getApplication()->input->get('tlk'); if ($session_form_db != $session_form_post) { $dispatcher->trigger('onEventLogging', array(array('method' => __METHOD__ . ":" . __LINE__, 'message' => 'Access denied! No valid session found for this request.', 'priority' => JLog::WARNING, 'section' => 'site'))); $valid_session = false; } else { return true; } } } else { $dispatcher->trigger('onEventLogging', array(array('method' => __METHOD__ . ":" . __LINE__, 'message' => 'Access denied! No valid session found for this request.', 'priority' => JLog::WARNING, 'section' => 'site'))); $valid_session = false; } return $valid_session; }
protected function DeletePlaylist($playlist_id) { $db = JFactory::getDBO(); // Delete playlist $query = $db->getQuery(true); $query->delete(); $query->from('#__jpplaylists'); $query->where('id = "' . $playlist_id . '"'); $db->setQuery($query); // Check for a database error. if (!$this->_db->query()) { $e = new JException(JText::_('JLIB_DATABASE_ERROR_DELETE_FAILED', get_class($this), $this->_db->getErrorMsg())); $this->setError($e); return false; } if (PlayJoomHelper::getPlaylistEntries($playlist_id) >= 1) { //Delete playlist content as well, if something exists $query = $db->getQuery(true); $query->delete(); $query->from('#__jpplaylist_content'); $query->where('list_id = "' . $playlist_id . '"'); $db->setQuery($query); // Check for a database error. if (!$this->_db->query()) { $e = new JException(JText::_('JLIB_DATABASE_ERROR_DELETE_FAILED', get_class($this), $this->_db->getErrorMsg())); $this->setError($e); return false; } } return true; }
$AboutInfo = array('artist' => base64_encode($item->artist), 'album' => null, 'genre' => $genresting); /* * - Check for additional artist infos * - and whether the button is active */ if ($this->params->get('show_additional_info_artist_alphabetical', 0) == 1) { $ArtistChecker = PlayJoomHelper::getInfoButton('artist', $AboutInfo, $modal_artist_config, $this->params); } else { $ArtistChecker = null; } /* * - Check for additional genre infos * - and whether the button is active */ if ($this->params->get('show_additional_info_genre_alphabetical', 0) == 1) { $GenreChecker = PlayJoomHelper::getInfoButton('genre', $AboutInfo, $modal_genre_config, $this->params); } else { $GenreChecker = null; } $counter = $counter + 1; echo '<fieldset class="batch">'; echo '<legend><a href="' . $artistlink . '" title="Continue to the artist view" class="ArtistLink">' . $item->artist . '</a>' . $ArtistChecker . ' | <a href="' . $genrelink . '" class="GenreLink" title="Continue to the genre view">' . $item->category_title . '</a>' . $GenreChecker . '</legend>'; echo '<ul class="ListOfAlbums">'; foreach ($album_list as $j => $albenitem) { $cover_counter = $cover_counter + 1; $albumsting = base64_encode($albenitem->album); $artiststing = base64_encode($albenitem->artist); $albumlink = 'index.php?option=com_playjoom&view=album&album=' . $albumsting . '&artist=' . $artiststing . '&Itemid=' . JRequest::getVar('Itemid'); //create album string $AlbumLenght = strlen($albenitem->album); if ($AlbumLenght > 14) {
/** * Batch to change the filter of a track. * * @param integer $value The new value matching a User ID. * @param array $pks An array of row IDs. * @param array $contexts An array of item contexts. * * @return boolean True if successful, false otherwise and internal error is set. * * @since 0.9.5xx */ protected function batchTrackfilter($value, $pks, $contexts) { // Set the variables $user = JFactory::getUser(); $canDo = PlayJoomHelper::getActions(); $userId = $user->get('id'); $table = $this->getTable(); $datetime = JFactory::getDate('now', null); foreach ($pks as $pk) { if ($canDo->get('core.edit') || JAccess::check($user->get('id'), 'core.admin') == 1) { $table->reset(); $table->load($pk); $table->trackfilterid = (int) $value; $table->mod_datetime = $datetime; $table->mod_by = $userId; if (!$table->store()) { $this->setError($table->getError()); return false; } } else { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); return false; } } // Clean the cache $this->cleanCache(); return true; }
echo '<div class="tab-pane active" id="general">'; echo '<div class="row-fluid">'; echo '<div class="span90">'; foreach ($this->form->getFieldset('details') as $field) { echo '<div class="control-group">'; echo '<div class="control-label">' . $field->label . '</div>'; echo '<div class="controls">' . $field->input . '</div>'; echo '</div>'; } echo '</div>'; echo '</div>'; echo '</div>'; echo '<div class="tab-pane" id="cover_img">'; echo '<div class="row-fluid">'; echo '<div class="span90">'; echo PlayJoomHelper::getCoverThumb($this->item, '../tmp/admin_tmp_img_albumtumb', 550); echo '</div>'; echo '</div>'; echo '</div>'; echo '</div>'; echo '</div>'; //<!-- End Tabs --> echo '</div>'; // End Content --> echo '</div>'; echo '<input type="hidden" name="task" value="playjoom.edit" />'; echo JHtml::_('form.token'); echo '</form>'; } else { echo '<form action="' . JRoute::_('index.php?option=com_playjoom&layout=edit&id=' . (int) $this->item->id) . '" method="post" name="adminForm" id="cover-form" class="form-validate form-horizontal" enctype="multipart/form-data">'; echo '<fieldset>';
public function onAfterPJContent(&$item, $params, $source = null, $TitleName = null) { $session = JFactory::getSession(); $rootURL = rtrim(JURI::base(), '/'); $subpathURL = JURI::base(true); if (!empty($subpathURL) && $subpathURL != '/') { $rootURL = substr($rootURL, 0, -1 * strlen($subpathURL)); } //Check for Trackcontrol if (JPluginHelper::isEnabled('playjoom', 'trackcontrol') == false) { $html = null; } else { $html = ''; $html .= '<div class="sm2-bar-ui full-width fixed flat"> <div class="bd sm2-main-controls"> <div class="sm2-inline-texture"></div> <div class="sm2-inline-gradient"></div> <div class="sm2-inline-element sm2-button-element"> <div class="sm2-button-bd"> <a href="#play" class="sm2-inline-button play-pause">Play / pause</a> </div> </div> <div class="sm2-inline-element sm2-inline-status"> <div class="sm2-playlist"> <div class="sm2-playlist-target"> <noscript><p>JavaScript is required.</p></noscript> </div> </div> <div class="sm2-progress"> <div class="sm2-row"> <div class="sm2-inline-time">0:00</div> <div class="sm2-progress-bd"> <div class="sm2-progress-track"> <div class="sm2-progress-bar"></div> <div class="sm2-progress-ball"> <div class="icon-overlay"> </div> </div> </div> </div> <div class="sm2-inline-duration">0:00</div> </div> </div> </div> <div class="sm2-inline-element sm2-button-element sm2-volume"> <div class="sm2-button-bd"> <span class="sm2-inline-button sm2-volume-control volume-shade"></span> <a href="#volume" class="sm2-inline-button sm2-volume-control">volume</a> </div> </div> <div class="sm2-inline-element sm2-button-element"> <div class="sm2-button-bd"> <a href="#prev" title="Previous" class="sm2-inline-button previous">< previous</a> </div> </div> <div class="sm2-inline-element sm2-button-element"> <div class="sm2-button-bd"> <a href="#next" title="Next" class="sm2-inline-button next">> next</a> </div> </div> </div> <div class="bd sm2-playlist-drawer sm2-element"> <div class="sm2-inline-texture"> <div class="sm2-box-shadow"></div> </div> <div class="sm2-playlist-wrapper"> <ul class="sm2-playlist-bd"> '; foreach ($item as $i => $playlist_item) { if (JFile::exists($playlist_item->pathatlocal . DIRECTORY_SEPARATOR . $playlist_item->file)) { //$html .= '<li><a href="'.$rootURL.JRoute::_('/components/com_playjoom/broadcasthandler/index.php?id='.$playlist_item->id).'&track.mp3"><b>'.$playlist_item->artist.'</b> - '.$playlist_item->title.'</a></li>'; $html .= '<li><a href="' . $rootURL . JRoute::_('index.php?option=com_playjoom&view=broadcast&format=raw&tlk=' . hash('sha256', $session->getId() . '+' . PlayJoomHelper::getUserIP() . '+' . $playlist_item->id) . '&id=' . $playlist_item->id) . '&track.mp3"><b>' . $playlist_item->artist . '</b> - ' . $playlist_item->title . '</a></li>'; } } $html .= '</ul> </div> </div> </div>'; return $html; } }
* source software licenses. See COPYRIGHT.php for copyright notices and * details. * * @PlayJoom Component * @copyright Copyright (C) 2010-2012 by www.teglo.info * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * @date $Date$ * @revision $Revision$ * @author $Author$ * @headurl $HeadURL$ */ // No direct access to this file defined('_JEXEC') or die('Restricted Access'); //Get User Objects $user = JFactory::getUser(); $canDo = PlayJoomHelper::getActions(); foreach ($this->items as $i => $item) { echo '<tr class="row' . $i % 2 . '">'; echo '<td>' . $item->id . '</td>'; echo '<td>' . JHtml::_('grid.id', $i, $item->id) . '</td>'; echo '<td>'; if ($canDo->get('core.edit') || JAccess::check($user->get('id'), 'core.admin') == 1) { echo '<a href="' . JRoute::_('index.php?option=com_playjoom&task=album.edit&id=' . $item->id) . '">'; echo $item->title; echo '</a>'; } else { echo $item->title; } echo '</td>'; echo '<td>' . $item->artist . '</td>'; echo '<td>' . $item->category . '</td>';
$counter++; echo '<tr class="row' . $i % 2 . '">'; echo '<td valign="top">' . $counter . '</td>'; echo '<td valign="top"><a href="' . $artistlink . '">' . $artistname . '</a></td>'; echo '<td valign="top"><a href="' . $albumlink . '" title="Continue to the album view">' . $coverthumb . $item->album . '</a></td>'; if ($numbers_of_title_genre >= 1) { echo '<td valign="top">'; //list of titles $album_item = PlayJoomModelGenre::getAlbumItems($item->album); echo '<ul class="circle">'; foreach ($album_item as $j => $item_entrie) { if (JFile::exists($item->pathatlocal . DIRECTORY_SEPARATOR . $item->file)) { if ($j < $numbers_of_title_genre) { //Check for displaying the running time if ($running_time_genre == 1) { $running_time = ' [' . PlayJoomHelper::Playtime($item_entrie->length) . ' ' . JText::_('COM_PLAYJOOM_ALBUM_MINUTES_SHORT') . ']'; } else { $running_time = null; } //Check for displaying the hits if ($hits_genre == 1) { $hits = ' [' . $item_entrie->hits . ']'; } else { $hits = null; } //Plugins integration $this->events = new stdClass(); $results = $dispatcher->trigger('onPrepareTrackLink', array(&$item_entrie, $this->params)); $this->events->PrepareTrackLink = trim(implode("\n", $results)); $results = $dispatcher->trigger('onBeforeTrackLink', array(&$item_entrie, $this->params)); $this->events->BeforeTrackLink = trim(implode("\n", $results));
$SamplerCheck = PlayJoomHelper::checkForSampler($item->album, $item->artist); //Get Album cover if ($this->params->get(JRequest::getVar('view') . '_show_cover', 1) == 1) { $cover = new PlayJoomHelperCover(); $coverthumb = $cover->getCoverHTMLTag($item, $SamplerCheck, $this->params); } echo '<div class="cover-row">'; //Output cover image echo '<div class="coverimg">'; echo $coverthumb; echo '</div>'; $length_counter = null; $size_counter = null; foreach ($this->items as $i => $item) { //Couters for the total line $length_counter = $length_counter + $item->length; $size_counter = $size_counter + $item->filesize; //calculate the average values if (isset($i) && $i >= 3) { $length_average = $length_counter / $i; $size_average = $size_counter / $i; if ($i == count($this->items) - 1) { echo '<ul class="album-sum">'; echo '<li>' . JText::_('COM_PLAYJOOM_ALBUM_NO_TRACKS') . ' ' . count($this->items) . '</li>'; echo '<li>' . JText::_('COM_PLAYJOOM_ALBUM_TOTAL') . ' ' . PlayJoomHelper::Playtime($length_counter) . ' ' . JText::_('COM_PLAYJOOM_ALBUM_MINUTES_SHORT') . '</li>'; echo '<li>' . JText::_('COM_PLAYJOOM_ALBUM_AVERAGE') . ' ' . PlayJoomHelper::Playtime($length_average) . ' ' . JText::_('COM_PLAYJOOM_ALBUM_MINUTES_SHORT') . '</li>'; echo '</ul>'; } } } echo '</div>';
$return = JRequest::getVar('return', '', 'method', 'base64'); $return = base64_decode($return); if (!JURI::isInternal($return)) { $return = ''; } // Redirect the user. $app->redirect(JRoute::_($return, false)); } else { $app->redirect(JRoute::_('index.php?option=com_users&view=login&return=' . base64_encode($uri), false)); } } //Create PJ links $artiststing = base64_encode($item->artist); $albumsting = base64_encode($item->album); $album_link = PlayJoomHelperRoute::getPJlink('albums', '&album=' . $albumsting . '&artist=' . $artiststing); $artist_link = PlayJoomHelperRoute::getPJlink('artists', '&artist=' . $artiststing); if (JFile::exists($item->pathatlocal . DIRECTORY_SEPARATOR . $item->file)) { echo '<li><a href="index.php?option=com_playjoom&view=broadcast&id=' . $item->track_id . '" title="Continue to play this title" target="_blank" class="direct_link">' . $item->title . '</a> <span class="trackminutes">[' . PlayJoomHelper::Playtime($item->length) . ']</span><img src="components/com_playjoom/images/icons/application_form_delete.png" alt="delete icon" width="16px" height="16px" style="margin-right:3px;margin-top:2px;vertical-align:bottom;" /><a href="index.php?option=com_playjoom&view=adminplaylist&layout=deltrack&id=' . $item->track_id . '&listid=' . JRequest::getVar('listid') . '&Itemid=' . JRequest::getVar('Itemid') . '" title="Continue to delete this track from the playlist">Delete</a></li>'; echo '<li class="artistalbumline">' . JText::_('COM_PLAYJOOM_PLAYJOOM_HEADING_ARTIST') . ': <a href="' . $artist_link . '" title="Continue to the artist view">' . $item->artist . '</a>, ' . JText::_('COM_PLAYJOOM_PLAYJOOM_HEADING_ALBUM') . ': <a href="' . $album_link . '" title="Continue to the album view">' . $item->album . '</a></li>'; echo '<li class="addline">' . JText::_('COM_PLAYJOOM_PLAYJOOM_HEADING_CREATE') . ' ' . $item->add_date . '</li>'; echo '<li class="divider"></li>'; $length_counter = $length_counter + $item->length; $track_counter = $track_counter + 1; } else { echo '<li>' . $item->track_id . ' ' . JText::_('COM_PLAYJOOM_PLAYLIST_NOT_AVAILABLE') . ', ' . $item->title . '<br><img src="components/com_playjoom/images/icons/application_form_delete.png" alt="delete icon" width="16px" height="16px" style="margin-right:3px;margin-top:2px;vertical-align:bottom;" /><a href="index.php?option=com_playjoom&view=adminplaylist&layout=deltrack&id=' . $item->track_id . '&listid=' . JRequest::getVar('listid') . '&Itemid=' . JRequest::getVar('Itemid') . '" title="Continue to delete this track from the playlist">Delete</a></li>'; echo '<li class="divider"></li>'; } } echo '<li class="divider"></li>'; echo '<li>' . JText::_('COM_PLAYJOOM_PLAYLIST_TOTAL') . '<br />' . $track_counter . ' ' . JText::_('COM_PLAYJOOM_PLAYLIST_TRACKS') . ' - ' . PlayJoomHelper::Playtime($length_counter) . ' ' . JText::_('COM_PLAYJOOM_PLAYLIST_MINUTES') . '</li>';
} //Plugins integration $this->events = new stdClass(); $results = $dispatcher->trigger('onInTrackbox', array($item, $this->params)); $this->events->InTrackbox = trim(implode("\n", $results)); $results = $dispatcher->trigger('onPrepareTrackLink', array(&$item, $this->params, $item->title)); $this->events->PrepareTrackLink = trim(implode("\n", $results)); $results = $dispatcher->trigger('onBeforeTrackLink', array(&$item, $this->params)); $this->events->BeforeTrackLink = trim(implode("\n", $results)); $results = $dispatcher->trigger('onAfterTrackLink', array(&$item, $this->params)); $this->events->AfterTrackLink = trim(implode("\n", $results)); //Check for Trackcontrol if (JPluginHelper::isEnabled('playjoom', 'trackcontrol') == false) { $TitleLink = $item->title; } else { $TitleLink = $this->events->PrepareTrackLink; } $track_text = '<span class="trackno">' . sprintf("%02d", $item->tracknumber) . ' - ' . $this->events->BeforeTrackLink . '<span class="tracktitle">' . $TitleLink . '</span> <span class="trackminutes">[' . PlayJoomHelper::Playtime($item->length) . ' ' . JText::_('COM_PLAYJOOM_ALBUM_MINUTES_SHORT') . ']</span>' . $this->events->AfterTrackLink . ' <span class="add2playlist"><a href="index.php?option=com_playjoom&view=addtoplaylist&layout=modal&tmpl=component&id=' . $item->id . '" class="modal" style="margin-left: 45px;" rel="' . $modal_add2playlist_config . '">' . JText::_('COM_PLAYJOOM_ALBUM_ADD2PLAYLIST') . '</span></a>'; echo '<div class="title">'; echo JHtml::_('PlayJoomSliders.addSlide', 'moduleOptions', $track_text, JText::_('COM_PLAYJOOM_ALBUM_MORE_INFO'), 'collapse' . $i++, ''); echo '</div>'; echo '<div class="accordion-content">'; echo $content_left; echo $content_right; echo $this->events->InTrackbox; echo '</div>'; echo JHtml::_('PlayJoomSliders.endSlide'); } } echo JHtml::_('PlayJoomSliders.endAccordion'); echo '</div>';
<?php foreach ($this->items as $i => $item) { ?> <tr class="row<?php echo $i % 2; ?> "> <td> <?php echo $item->albumid; ?> </td> <td> <?php echo $item->albumyear; ?> </td> <td> <?php echo $item->albumtitle; ?> </td> <td> <?php echo PlayJoomHelper::getPlaylistEntries($item->albumid); ?> </td> </tr> <?php }
// No direct access to this file defined('_JEXEC') or die('Restricted Access'); JPluginHelper::importPlugin('playjoom'); $counter = null; $coverwidth = $this->params->get('maxsize_cover'); $coverstate = $this->params->get('show_cover'); $dispatcher = JDispatcher::getInstance(); foreach ($this->items as $i => $item) { if (JFile::exists($item->pathatlocal . DIRECTORY_SEPARATOR . $item->file)) { if ($coverstate == 1) { $coverthumb = PlayJoomHelper::getCoverThumb($item->album, $item->artist, JPATH_BASE . DS . 'tmp' . DS . 'tmp_img_albumtumb' . $i, $coverwidth, $i) . '<br />'; } else { $coverthumb = null; } //Check for albumname as sampler if (PlayJoomHelper::checkForSampler($item->album, $item->artist)) { $albumname = JText::_('COM_PLAYJOOM_ALBUM_SAMPLER'); } else { $albumname = $item->album; } //Create strings $albumsting = base64_encode($item->album); $genresting = base64_encode($item->category_title); $artiststing = base64_encode($item->artist); //Create links $albumlink = 'index.php?option=com_playjoom&view=album&album=' . $albumsting . '&artist=' . $artiststing . '&Itemid=' . JRequest::getVar('Itemid'); $genrelink = 'index.php?option=com_playjoom&view=genre&cat=' . $genresting . '&catid=' . $item->catid . '&Itemid=' . JRequest::getVar('Itemid'); $artistlink = 'index.php?option=com_playjoom&view=artist&artist=' . $artiststing . '&Itemid=' . JRequest::getVar('Itemid'); $counter++; echo '<tr>'; echo '<td>' . $counter . '</td>';
$artist_link = PlayJoomHelperRoute::getPJlink('artists', '&artist=' . $artiststing); //Plugins integration $this->events = new stdClass(); $results = $dispatcher->trigger('onBeforeTrackLink', array(&$item, $this->params)); $this->events->BeforeTrackLink = trim(implode("\n", $results)); $results = $dispatcher->trigger('onAfterTrackLink', array(&$item, $this->params)); $this->events->AfterTrackLink = trim(implode("\n", $results)); if (JFile::exists($item->pathatlocal . DIRECTORY_SEPARATOR . $item->file)) { //table row only if the file exists echo '<tr class="row' . $i % 2 . '">'; echo '<td>' . $this->events->BeforeTrackLink . '<a href="index.php?option=com_playjoom&view=broadcast&id=' . $item->track_id . '" title="Continue to play this title" target="_blank" class="direct_link">' . $item->title . '</a> [' . PlayJoomHelper::Playtime($item->length) . ']<br /><img src="components/com_playjoom/images/icons/application_form_delete.png" alt="delete icon" width="16px" height="16px" style="margin-right:3px;margin-top:2px;vertical-align:bottom;" /><a href="index.php?option=com_playjoom&view=adminplaylist&layout=deltrack&id=' . $item->track_id . '&listid=' . JRequest::getVar('listid') . '&Itemid=' . JRequest::getVar('Itemid') . '" title="Continue to delete this track from the playlist">Delete</a>' . $this->events->AfterTrackLink . '</td>'; echo '<td><a href="' . $artist_link . '" title="Continue to the artist view">' . $item->artist . '</a></td>'; echo '<td><a href="' . $album_link . '" title="Continue to the album view">' . $item->album . '</a></td>'; echo '<td>' . $item->genre . '</td>'; echo '<td>' . $item->add_date . '</td>'; echo '</tr>'; $length_counter = $length_counter + $item->length; $track_counter = $track_counter + 1; } else { //table row for the files that doesn´t exists or available echo '<tr class="row' . $i % 2 . '">'; echo '<td>' . $item->track_id . '</td>'; echo '<td colspan="6">' . JText::_('COM_PLAYJOOM_PLAYLIST_NOT_AVAILABLE') . ', ' . $item->title . '<br><img src="components/com_playjoom/images/icons/application_form_delete.png" alt="delete icon" width="16px" height="16px" style="margin-right:3px;margin-top:2px;vertical-align:bottom;" /><a href="index.php?option=com_playjoom&view=adminplaylist&layout=deltrack&id=' . $item->track_id . '&listid=' . JRequest::getVar('listid') . '&Itemid=' . JRequest::getVar('Itemid') . '" title="Continue to delete this track from the playlist">Delete</a></td>'; echo '</tr>'; } } //$track_counter = $i +1; echo '<tr>'; echo '<td colspan="5" align="right">' . JText::_('COM_PLAYJOOM_PLAYLIST_TOTAL') . '<br />' . $track_counter . ' ' . JText::_('COM_PLAYJOOM_PLAYLIST_TRACKS') . ' - ' . PlayJoomHelper::Playtime($length_counter) . ' ' . JText::_('COM_PLAYJOOM_PLAYLIST_MINUTES') . '</td>'; //echo '<td colspan="2" valign="bottom">'.PlayJoomHelper::Playtime($length_counter).' '.JText::_('COM_PLAYJOOM_PLAYLIST_MINUTES').'</td>'; echo '</tr>';
* details. * * @PlayJoom Component * @copyright Copyright (C) 2010 by www.teglo.info * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * @date $Date$ * @revision $Revision$ * @author $Author$ * @headurl $HeadURL$ */ // No direct access to this file defined('_JEXEC') or die('Restricted access'); $user = JFactory::getUser(); JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); //get Playlist infos $track_content = PlayJoomHelper::getTrackInfo(JRequest::getVar('id')); echo '<form action="' . JRoute::_('index.php?option=com_playjoom&view=adminplaylist&action=del&listid=' . JRequest::getVar('listid') . '&Itemid=' . JRequest::getVar('Itemid')) . '" method="post" name="adminForm" id="adminForm">'; echo '<fieldset class="addtrack">'; echo $this->loadTemplate('toolbar'); echo '<div class="filter-select fltrt">'; if (JFile::exists($item->pathatlocal . DIRECTORY_SEPARATOR . $item->file)) { echo '<ul class="playlist">'; echo '<li id="playlist_info">' . JText::_('COM_PLAYJOOM_PLAYJOOM_HEADING_TITLE') . ': ' . $track_content->title . '</li>'; echo '<li id="playlist_info">' . JText::_('COM_PLAYJOOM_PLAYJOOM_HEADING_ALBUM') . ': ' . $track_content->album . '</li>'; echo '<li id="playlist_info">' . JText::_('COM_PLAYJOOM_PLAYJOOM_HEADING_ARTIST') . ': ' . $track_content->artist . '</li>'; echo '</ul>'; } echo '</div>'; echo '</fieldset>'; echo '<div>'; echo '<input type="hidden" name="task" value="" />';
* @PlayJoom Component * @date $Date: 2012-04-08 14:07:01 +0200 (So, 08. Apr 2012) $ * @revision $Revision: 455 $ * @author $Author: toto $ * @headurl $HeadURL: http://dev.teglo.info/svn/playjoom/components/com_playjoom/helpers/playjoom.php $ */ // No direct access to this file defined('_JEXEC') or die('Restricted Access'); JPluginHelper::importPlugin('playjoom'); $counter = null; foreach ($this->items as $i => $item) { //Create strings $albumsting = base64_encode($item->album); $artiststing = base64_encode($item->artist); //Check for sampler $SamplerCheck = PlayJoomHelper::checkForSampler($item->album, $item->artist); if ($SamplerCheck) { $artistname = JText::_('COM_PLAYJOOM_ALBUM_SAMPLER'); } else { $artistlink = PlayJoomHelperRoute::getPJlink('artists', '&artist=' . $artiststing); $artistname = '<a href="' . $artistlink . '">' . $item->artist . '</a>'; } //Create links $albumlink = 'index.php?option=com_playjoom&view=album&album=' . $albumsting . '&artist=' . $artiststing . '&Itemid=' . JRequest::getVar('Itemid'); $genrelink = PlayJoomHelperRoute::getPJlink('genres', '&catid=' . $item->catid); //Get Album thumbnail if ($this->params->get(JRequest::getVar('view') . '_show_cover', 1) == 1) { $cover = new PlayJoomHelperCover(); $coverthumb = $cover->getCoverHTMLTag($albenitem, $SamplerCheck); } $genre = null;