*/
static public function img($name = null, $options = array())
{
+ if (is_string($options)) {
+ $options = array('app' => $options);
+ }
+
return new Horde_Themes_Image($name, $options);
}
*/
static public function sound($name = null, $options = array())
{
+ if (is_string($options)) {
+ $options = array('app' => $options);
+ }
+
return new Horde_Themes_Sound($name, $options);
}
if (is_null($app)) {
$app = $GLOBALS['registry']->getApp();
}
+
/* Do search in reverse order - app + theme sounds have the highest
* priority and will overwrite previous sound definitions. */
$locations = array(
*
* @param string $name The element name. If null, will return the
* element directory.
- * @param mixed $options Additional options. If a string, is taken to be
- * the 'app' parameter. If an array, the following
- * options are available:
+ * @param array $options Additional options:
* <pre>
* 'app' - (string) Use this application instead of the current app.
* 'data' - (array) Contains 2 elements: 'fs' - filesystem path,
* 'uri' - (string) Use this as the URI value.
* </pre>
*/
- public function __construct($name = '', $options = array())
+ public function __construct($name = '', array $options = array())
{
+
+ $this->app = empty($options['app'])
+ ? $GLOBALS['registry']->getApp()
+ : $options['app'];
$this->_name = $name;
+ $this->_opts = $options;
- if (is_string($options)) {
- $this->app = $options;
- $this->_opts = array();
- } else {
- $this->app = empty($options['app'])
- ? $GLOBALS['registry']->getApp()
- : $options['app'];
- $this->_opts = $options;
- }
if ($GLOBALS['registry']->get('status', $this->app) == 'heading') {
$this->app = 'horde';
}