summaryrefslogtreecommitdiffstats
path: root/apps/media/js/music.js
Commit message (Expand)AuthorAgeFilesLines
* moved to apps repositoryFrank Karlitschek2012-08-261-57/+0
* renamed extention to extension, also now only showing lowercaseJan-Christoph Borchardt2012-04-151-3/+3
* Fixed OC-261 by modifying js files in apps/media/Deepak Mittal2012-04-121-1/+1
* UI problems solved. Bookmarks app updated.Marvin Thomas Rabe2012-02-221-7/+5
* reimplement auto playing music from location hash (like from search results)Robin Appelman2012-01-121-6/+13
* fix playing songs from search resultsRobin Appelman2011-09-291-1/+1
* media app: show current song, add margin, enable tooltipThomas Schmidt2011-09-281-1/+2
* make more strings translatableRobin Appelman2011-08-101-1/+1
* initial work on the media player interface reworkRobin Appelman2011-08-081-19/+1
* fix media sub navigation entriesRobin Appelman2011-08-021-5/+5
* some fixes for persistent playlistsRobin Appelman2011-08-011-4/+5
* persistent playlist for the media playerRobin Appelman2011-08-011-0/+1
* fix search results not displayingRobin Appelman2011-08-011-2/+2
* more tweaks for media search resultsRobin Appelman2011-07-311-19/+16
* dont show play and add-to-playlist at the same timeRobin Appelman2011-07-311-16/+19
* Show play and add-to-playlist buttons in instant search resultsRobin Appelman2011-07-311-0/+25
* open the correct subpage when the media player loadsRobin Appelman2011-07-301-0/+4
* Some much needed interface work on the media playerRobin Appelman2011-07-291-78/+13
* some refactoring of the media player codeRobin Appelman2011-07-261-327/+52
* import media appRobin Appelman2011-07-221-0/+378
olor: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
<?php
/**
 * @author Bart Visscher <bartv@thisnet.nl>
 * @author Joas Schilling <nickvergessen@owncloud.com>
 * @author Morris Jobke <hey@morrisjobke.de>
 * @author Robin McCorkell <robin@mccorkell.me.uk>
 * @author Thomas Müller <thomas.mueller@tmit.eu>
 *
 * @copyright Copyright (c) 2016, ownCloud, Inc.
 * @license AGPL-3.0
 *
 * This code is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * 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, version 3,
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 */

namespace OC;

/**
 * Manages the ownCloud navigation
 */
class NavigationManager implements \OCP\INavigationManager {
	protected $entries = array();
	protected $closureEntries = array();
	protected $activeEntry;

	/**
	 * Creates a new navigation entry
	 *
	 * @param array|\Closure $entry Array containing: id, name, order, icon and href key
	 *					The use of a closure is preferred, because it will avoid
	 * 					loading the routing of your app, unless required.
	 * @return void
	 */
	public function add($entry) {
		if ($entry instanceof \Closure) {
			$this->closureEntries[] = $entry;
			return;
		}

		$entry['active'] = false;
		if(!isset($entry['icon'])) {
			$entry['icon'] = '';
		}
		$this->entries[] = $entry;
	}

	/**
	 * returns all the added Menu entries
	 * @return array an array of the added entries
	 */
	public function getAll() {
		foreach ($this->closureEntries as $c) {
			$this->add($c());
		}
		$this->closureEntries = array();
		return $this->entries;
	}

	/**
	 * removes all the entries
	 */
	public function clear() {
		$this->entries = array();
		$this->closureEntries = array();
	}

	/**
	 * Sets the current navigation entry of the currently running app
	 * @param string $id of the app entry to activate (from added $entry)
	 */
	public function setActiveEntry($id) {
		$this->activeEntry = $id;
	}

	/**
	 * gets the active Menu entry
	 * @return string id or empty string
	 *
	 * This function returns the id of the active navigation entry (set by
	 * setActiveEntry
	 */
	public function getActiveEntry() {
		return $this->activeEntry;
	}
}