本文整理汇总了PHP中OC_Util::getTheme方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Util::getTheme方法的具体用法?PHP OC_Util::getTheme怎么用?PHP OC_Util::getTheme使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_Util
的用法示例。
在下文中一共展示了OC_Util::getTheme方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
$this->l = \OC::$server->getL10N('lib');
$version = OC_Util::getVersion();
$this->defaultEntity = 'ownCloud';
/* e.g. company name, used for footers and copyright notices */
$this->defaultName = 'ownCloud';
/* short name, used when referring to the software */
$this->defaultTitle = 'ownCloud';
/* can be a longer name, for titles */
$this->defaultBaseUrl = 'https://owncloud.org';
$this->defaultSyncClientUrl = 'https://owncloud.org/sync-clients/';
$this->defaultiOSClientUrl = 'https://itunes.apple.com/us/app/owncloud/id543672169?mt=8';
$this->defaultiTunesAppId = '543672169';
$this->defaultAndroidClientUrl = 'https://play.google.com/store/apps/details?id=com.owncloud.android';
$this->defaultDocBaseUrl = 'https://doc.owncloud.org';
$this->defaultDocVersion = $version[0] . '.' . $version[1];
// used to generate doc links
$this->defaultSlogan = $this->l->t('web services under your control');
$this->defaultLogoClaim = '';
$this->defaultMailHeaderColor = '#1d2d44';
/* header color of mail notifications */
$themePath = OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/defaults.php';
if (file_exists($themePath)) {
// prevent defaults.php from printing output
ob_start();
require_once $themePath;
ob_end_clean();
if (class_exists('OC_Theme')) {
$this->theme = new OC_Theme();
}
}
}
示例2: __construct
/**
* @brief Constructor
* @param string $app app providing the template
* @param string $name of the template file (without suffix)
* @param string $renderas = ""; produce a full page
* @return OC_Template object
*
* This function creates an OC_Template object.
*
* If $renderas is set, OC_Template will try to produce a full page in the
* according layout. For now, renderas can be set to "guest", "user" or
* "admin".
*/
public function __construct($app, $name, $renderas = "")
{
// Read the selected theme from the config file
$theme = OC_Util::getTheme();
// Read the detected formfactor and use the right file name.
$fext = self::getFormFactorExtension();
$requesttoken = OC::$session ? OC_Util::callRegister() : '';
$parts = explode('/', $app);
// fix translation when app is something like core/lostpassword
$l10n = OC_L10N::get($parts[0]);
$themeDefaults = new OC_Defaults();
list($path, $template) = $this->findTemplate($theme, $app, $name, $fext);
// Set the private data
$this->renderas = $renderas;
$this->path = $path;
parent::__construct($template, $requesttoken, $l10n, $themeDefaults);
// Some headers to enhance security
header('X-XSS-Protection: 1; mode=block');
// Enforce browser based XSS filters
header('X-Content-Type-Options: nosniff');
// Disable sniffing the content type for IE
// iFrame Restriction Policy
$xFramePolicy = OC_Config::getValue('xframe_restriction', true);
if ($xFramePolicy) {
header('X-Frame-Options: Sameorigin');
// Disallow iFraming from other domains
}
// Content Security Policy
// If you change the standard policy, please also change it in config.sample.php
$policy = OC_Config::getValue('custom_csp_policy', 'default-src \'self\'; ' . 'script-src \'self\' \'unsafe-eval\'; ' . 'style-src \'self\' \'unsafe-inline\'; ' . 'frame-src *; ' . 'img-src *; ' . 'font-src \'self\' data:; ' . 'media-src *');
header('Content-Security-Policy:' . $policy);
// Standard
}
示例3: themeExist
private function themeExist($method)
{
if (OC_Util::getTheme() !== '' && method_exists('OC_Theme', $method)) {
return true;
}
return false;
}
示例4: imagePath
/**
* @brief Creates path to an image
* @param string $app app
* @param string $image image name
* @return string the url
*
* Returns the path to the image.
*/
public function imagePath($app, $image)
{
// Read the selected theme from the config file
$theme = \OC_Util::getTheme();
//if a theme has a png but not an svg always use the png
$basename = substr(basename($image), 0, -4);
// Check if the app is in the app folder
if (file_exists(\OC::$SERVERROOT . "/themes/{$theme}/apps/{$app}/img/{$image}")) {
return \OC::$WEBROOT . "/themes/{$theme}/apps/{$app}/img/{$image}";
} elseif (!file_exists(\OC::$SERVERROOT . "/themes/{$theme}/apps/{$app}/img/{$basename}.svg") && file_exists(\OC::$SERVERROOT . "/themes/{$theme}/apps/{$app}/img/{$basename}.png")) {
return \OC::$WEBROOT . "/themes/{$theme}/apps/{$app}/img/{$basename}.png";
} elseif (file_exists(\OC_App::getAppPath($app) . "/img/{$image}")) {
return \OC_App::getAppWebPath($app) . "/img/{$image}";
} elseif (!file_exists(\OC_App::getAppPath($app) . "/img/{$basename}.svg") && file_exists(\OC_App::getAppPath($app) . "/img/{$basename}.png")) {
return \OC_App::getAppPath($app) . "/img/{$basename}.png";
} elseif (!empty($app) and file_exists(\OC::$SERVERROOT . "/themes/{$theme}/{$app}/img/{$image}")) {
return \OC::$WEBROOT . "/themes/{$theme}/{$app}/img/{$image}";
} elseif (!empty($app) and !file_exists(\OC::$SERVERROOT . "/themes/{$theme}/{$app}/img/{$basename}.svg") && file_exists(\OC::$SERVERROOT . "/themes/{$theme}/{$app}/img/{$basename}.png")) {
return \OC::$WEBROOT . "/themes/{$theme}/{$app}/img/{$basename}.png";
} elseif (!empty($app) and file_exists(\OC::$SERVERROOT . "/{$app}/img/{$image}")) {
return \OC::$WEBROOT . "/{$app}/img/{$image}";
} elseif (!empty($app) and !file_exists(\OC::$SERVERROOT . "/{$app}/img/{$basename}.svg") && file_exists(\OC::$SERVERROOT . "/{$app}/img/{$basename}.png")) {
return \OC::$WEBROOT . "/{$app}/img/{$basename}.png";
} elseif (file_exists(\OC::$SERVERROOT . "/themes/{$theme}/core/img/{$image}")) {
return \OC::$WEBROOT . "/themes/{$theme}/core/img/{$image}";
} elseif (!file_exists(\OC::$SERVERROOT . "/themes/{$theme}/core/img/{$basename}.svg") && file_exists(\OC::$SERVERROOT . "/themes/{$theme}/core/img/{$basename}.png")) {
return \OC::$WEBROOT . "/themes/{$theme}/core/img/{$basename}.png";
} elseif (file_exists(\OC::$SERVERROOT . "/core/img/{$image}")) {
return \OC::$WEBROOT . "/core/img/{$image}";
} else {
throw new RuntimeException('image not found: image:' . $image . ' webroot:' . \OC::$WEBROOT . ' serverroot:' . \OC::$SERVERROOT);
}
}
示例5: __construct
function __construct()
{
$this->l = \OC::$server->getL10N('lib');
$version = OC_Util::getVersion();
$this->defaultEntity = '';
/* e.g. company name, used for footers and copyright notices */
$this->defaultName = '';
/* short name, used when referring to the software */
$this->defaultTitle = '';
/* can be a longer name, for titles */
$this->defaultBaseUrl = '';
$this->defaultSyncClientUrl = '';
$this->defaultiOSClientUrl = '';
$this->defaultiTunesAppId = '';
$this->defaultAndroidClientUrl = '';
$this->defaultDocBaseUrl = 'https://doc.owncloud.org';
$this->defaultDocVersion = $version[0] . '.' . $version[1];
// used to generate doc links
$this->defaultSlogan = $this->l->t('Web Master - Mayank Agarwal <br>UI - Sambhav Kothari');
$this->defaultLogoClaim = '';
$this->defaultMailHeaderColor = '#1d2d44';
/* header color of mail notifications */
$themePath = OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/defaults.php';
if (file_exists($themePath)) {
// prevent defaults.php from printing output
ob_start();
require_once $themePath;
ob_end_clean();
if (class_exists('OC_Theme')) {
$this->theme = new OC_Theme();
}
}
}
示例6: __construct
/**
* Constructor
* @param string $app app providing the template
* @param string $name of the template file (without suffix)
* @param string $renderas = ""; produce a full page
* @param bool $registerCall = true
* @return OC_Template object
*
* This function creates an OC_Template object.
*
* If $renderas is set, OC_Template will try to produce a full page in the
* according layout. For now, renderas can be set to "guest", "user" or
* "admin".
*/
public function __construct($app, $name, $renderas = "", $registerCall = true)
{
// Read the selected theme from the config file
$theme = OC_Util::getTheme();
$requesttoken = (OC::$server->getSession() and $registerCall) ? OC_Util::callRegister() : '';
$parts = explode('/', $app);
// fix translation when app is something like core/lostpassword
$l10n = \OC::$server->getL10N($parts[0]);
$themeDefaults = new OC_Defaults();
list($path, $template) = $this->findTemplate($theme, $app, $name);
// Set the private data
$this->renderas = $renderas;
$this->path = $path;
$this->app = $app;
parent::__construct($template, $requesttoken, $l10n, $themeDefaults);
}
示例7: __construct
/**
* @brief Constructor
* @param string $app app providing the template
* @param string $name of the template file (without suffix)
* @param string $renderas = ""; produce a full page
* @return OC_Template object
*
* This function creates an OC_Template object.
*
* If $renderas is set, OC_Template will try to produce a full page in the
* according layout. For now, renderas can be set to "guest", "user" or
* "admin".
*/
public function __construct($app, $name, $renderas = "")
{
// Read the selected theme from the config file
$theme = OC_Util::getTheme();
// Read the detected formfactor and use the right file name.
$fext = self::getFormFactorExtension();
$requesttoken = OC::$session ? OC_Util::callRegister() : '';
$parts = explode('/', $app);
// fix translation when app is something like core/lostpassword
$l10n = OC_L10N::get($parts[0]);
$themeDefaults = new OC_Defaults();
list($path, $template) = $this->findTemplate($theme, $app, $name, $fext);
// Set the private data
$this->renderas = $renderas;
$this->path = $path;
parent::__construct($template, $requesttoken, $l10n, $themeDefaults);
}
示例8: findJavascriptFiles
/**
* @param array $scripts
* @return array
*/
public static function findJavascriptFiles($scripts)
{
// Read the selected theme from the config file
$theme = OC_Util::getTheme();
// Read the detected formfactor and use the right file name.
$fext = self::getFormFactorExtension();
$locator = new \OC\Template\JSResourceLocator($theme, $fext, array(OC::$SERVERROOT => OC::$WEBROOT), array(OC::$THIRDPARTYROOT => OC::$THIRDPARTYWEBROOT));
$locator->find($scripts);
return $locator->getResources();
}
示例9: findJavascriptFiles
/**
* @param array $scripts
* @return array
*/
public static function findJavascriptFiles($scripts)
{
// Read the selected theme from the config file
$theme = OC_Util::getTheme();
$locator = new \OC\Template\JSResourceLocator(OC::$server->getLogger(), $theme, array(OC::$SERVERROOT => OC::$WEBROOT), array(OC::$THIRDPARTYROOT => OC::$THIRDPARTYWEBROOT));
$locator->find($scripts);
return $locator->getResources();
}
示例10: header
// Set the content type to Javascript
header("Content-type: text/javascript");
// Disallow caching
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
// Enable l10n support
$l = \OC::$server->getL10N('core');
// Enable OC_Defaults support
$defaults = new OC_Defaults();
// Get the config
$apps_paths = array();
foreach (OC_App::getEnabledApps() as $app) {
$apps_paths[$app] = OC_App::getAppWebPath($app);
}
$config = \OC::$server->getConfig();
$value = $config->getAppValue('core', 'shareapi_default_expire_date', 'no');
$defaultExpireDateEnabled = $value === 'yes' ? true : false;
$defaultExpireDate = $enforceDefaultExpireDate = null;
if ($defaultExpireDateEnabled) {
$defaultExpireDate = (int) $config->getAppValue('core', 'shareapi_expire_after_n_days', '7');
$value = $config->getAppValue('core', 'shareapi_enforce_expire_date', 'no');
$enforceDefaultExpireDate = $value === 'yes' ? true : false;
}
$outgoingServer2serverShareEnabled = $config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes';
$array = array("oc_debug" => $config->getSystemValue('debug', false) ? 'true' : 'false', "oc_isadmin" => OC_User::isAdminUser(OC_User::getUser()) ? 'true' : 'false', "oc_webroot" => "\"" . OC::$WEBROOT . "\"", "oc_appswebroots" => str_replace('\\/', '/', json_encode($apps_paths)), "datepickerFormatDate" => json_encode($l->getDateFormat()), "dayNames" => json_encode(array((string) $l->t('Sunday'), (string) $l->t('Monday'), (string) $l->t('Tuesday'), (string) $l->t('Wednesday'), (string) $l->t('Thursday'), (string) $l->t('Friday'), (string) $l->t('Saturday'))), "dayNamesShort" => json_encode(array((string) $l->t('Sun.'), (string) $l->t('Mon.'), (string) $l->t('Tue.'), (string) $l->t('Wed.'), (string) $l->t('Thu.'), (string) $l->t('Fri.'), (string) $l->t('Sat.'))), "dayNamesMin" => json_encode(array((string) $l->t('Su'), (string) $l->t('Mo'), (string) $l->t('Tu'), (string) $l->t('We'), (string) $l->t('Th'), (string) $l->t('Fr'), (string) $l->t('Sa'))), "monthNames" => json_encode(array((string) $l->t('January'), (string) $l->t('February'), (string) $l->t('March'), (string) $l->t('April'), (string) $l->t('May'), (string) $l->t('June'), (string) $l->t('July'), (string) $l->t('August'), (string) $l->t('September'), (string) $l->t('October'), (string) $l->t('November'), (string) $l->t('December'))), "monthNamesShort" => json_encode(array((string) $l->t('Jan.'), (string) $l->t('Feb.'), (string) $l->t('Mar.'), (string) $l->t('Apr.'), (string) $l->t('May.'), (string) $l->t('Jun.'), (string) $l->t('Jul.'), (string) $l->t('Aug.'), (string) $l->t('Sep.'), (string) $l->t('Oct.'), (string) $l->t('Nov.'), (string) $l->t('Dec.'))), "firstDay" => json_encode($l->getFirstWeekDay()), "oc_config" => json_encode(array('session_lifetime' => min(\OCP\Config::getSystemValue('session_lifetime', ini_get('session.gc_maxlifetime')), ini_get('session.gc_maxlifetime')), 'session_keepalive' => \OCP\Config::getSystemValue('session_keepalive', true), 'version' => implode('.', OC_Util::getVersion()), 'versionstring' => OC_Util::getVersionString(), 'enable_avatars' => \OC::$server->getConfig()->getSystemValue('enable_avatars', true))), "oc_appconfig" => json_encode(array("core" => array('defaultExpireDateEnabled' => $defaultExpireDateEnabled, 'defaultExpireDate' => $defaultExpireDate, 'defaultExpireDateEnforced' => $enforceDefaultExpireDate, 'enforcePasswordForPublicLink' => \OCP\Util::isPublicLinkPasswordRequired(), 'sharingDisabledForUser' => \OCP\Util::isSharingDisabledForUser(), 'resharingAllowed' => \OCP\Share::isResharingAllowed(), 'remoteShareAllowed' => $outgoingServer2serverShareEnabled, 'federatedCloudShareDoc' => \OC::$server->getURLGenerator()->linkToDocs('user-sharing-federated')))), "oc_defaults" => json_encode(array('entity' => $defaults->getEntity(), 'name' => $defaults->getName(), 'title' => $defaults->getTitle(), 'baseUrl' => $defaults->getBaseUrl(), 'syncClientUrl' => $defaults->getSyncClientUrl(), 'docBaseUrl' => $defaults->getDocBaseUrl(), 'slogan' => $defaults->getSlogan(), 'logoClaim' => $defaults->getLogoClaim(), 'shortFooter' => $defaults->getShortFooter(), 'longFooter' => $defaults->getLongFooter(), 'folder' => OC_Util::getTheme())));
// Allow hooks to modify the output values
OC_Hook::emit('\\OCP\\Config', 'js', array('array' => &$array));
// Echo it
foreach ($array as $setting => $value) {
echo "var " . $setting . "=" . $value . ";\n";
}
示例11: getSystemInfo
/**
* Gathers system information like database type and does
* a few system checks.
*
* @return array of system info, including an "errors" value
* in case of errors/warnings
*/
public function getSystemInfo()
{
$hasSQLite = class_exists('SQLite3');
$hasMySQL = is_callable('mysql_connect');
$hasPostgreSQL = is_callable('pg_connect');
$hasOracle = is_callable('oci_connect');
$hasMSSQL = is_callable('sqlsrv_connect');
$databases = array();
if ($hasSQLite) {
$databases['sqlite'] = 'SQLite';
}
if ($hasMySQL) {
$databases['mysql'] = 'MySQL/MariaDB';
}
if ($hasPostgreSQL) {
$databases['pgsql'] = 'PostgreSQL';
}
if ($hasOracle) {
$databases['oci'] = 'Oracle';
}
if ($hasMSSQL) {
$databases['mssql'] = 'MS SQL';
}
$datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT . '/data');
$vulnerableToNullByte = false;
if (@file_exists(__FILE__ . "Nullbyte")) {
// Check if the used PHP version is vulnerable to the NULL Byte attack (CVE-2006-7243)
$vulnerableToNullByte = true;
}
$errors = array();
// Protect data directory here, so we can test if the protection is working
\OC_Setup::protectDataDirectory();
try {
$htaccessWorking = \OC_Util::isHtaccessWorking();
} catch (\OC\HintException $e) {
$errors[] = array('error' => $e->getMessage(), 'hint' => $e->getHint());
$htaccessWorking = false;
}
if (\OC_Util::runningOnMac()) {
$l10n = \OC::$server->getL10N('core');
$themeName = \OC_Util::getTheme();
$theme = new \OC_Defaults();
$errors[] = array('error' => $l10n->t('Mac OS X is not supported and %s will not work properly on this platform. ' . 'Use it at your own risk! ', $theme->getName()), 'hint' => $l10n->t('For the best results, please consider using a GNU/Linux server instead.'));
}
return array('hasSQLite' => $hasSQLite, 'hasMySQL' => $hasMySQL, 'hasPostgreSQL' => $hasPostgreSQL, 'hasOracle' => $hasOracle, 'hasMSSQL' => $hasMSSQL, 'databases' => $databases, 'directory' => $datadir, 'htaccessWorking' => $htaccessWorking, 'vulnerableToNullByte' => $vulnerableToNullByte, 'errors' => $errors);
}
示例12:
<?php
if (file_exists(OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/defaults.php')) {
require_once 'themes/' . OC_Util::getTheme() . '/defaults.php';
}
/**
* Default strings and values which differ between the enterprise and the
* community edition. Use the get methods to always get the right strings.
*/
class OC_Defaults
{
private $theme;
private $l;
private $defaultEntity;
private $defaultName;
private $defaultTitle;
private $defaultBaseUrl;
private $defaultSyncClientUrl;
private $defaultDocBaseUrl;
private $defaultDocVersion;
private $defaultSlogan;
private $defaultLogoClaim;
private $defaultMailHeaderColor;
function __construct()
{
$this->l = OC_L10N::get('lib');
$version = OC_Util::getVersion();
$this->defaultEntity = "ownCloud";
/* e.g. company name, used for footers and copyright notices */
$this->defaultName = "ownCloud";
/* short name, used when referring to the software */
示例13: imagePath
/**
* @brief Creates path to an image
* @param string $app app
* @param string $image image name
* @return string the url
*
* Returns the path to the image.
*/
public static function imagePath($app, $image)
{
// Read the selected theme from the config file
$theme = OC_Util::getTheme();
// Check if the app is in the app folder
if (file_exists(OC::$SERVERROOT . "/themes/{$theme}/apps/{$app}/img/{$image}")) {
return OC::$WEBROOT . "/themes/{$theme}/apps/{$app}/img/{$image}";
} elseif (file_exists(OC_App::getAppPath($app) . "/img/{$image}")) {
return OC_App::getAppWebPath($app) . "/img/{$image}";
} elseif (!empty($app) and file_exists(OC::$SERVERROOT . "/themes/{$theme}/{$app}/img/{$image}")) {
return OC::$WEBROOT . "/themes/{$theme}/{$app}/img/{$image}";
} elseif (!empty($app) and file_exists(OC::$SERVERROOT . "/{$app}/img/{$image}")) {
return OC::$WEBROOT . "/{$app}/img/{$image}";
} elseif (file_exists(OC::$SERVERROOT . "/themes/{$theme}/core/img/{$image}")) {
return OC::$WEBROOT . "/themes/{$theme}/core/img/{$image}";
} elseif (file_exists(OC::$SERVERROOT . "/core/img/{$image}")) {
return OC::$WEBROOT . "/core/img/{$image}";
} else {
echo 'image not found: image:' . $image . ' webroot:' . OC::$WEBROOT . ' serverroot:' . OC::$SERVERROOT;
die;
}
}
示例14: json_encode
'resharingAllowed' => \OCP\Share::isResharingAllowed(),
'remoteShareAllowed' => $outgoingServer2serverShareEnabled,
'federatedCloudShareDoc' => \OC::$server->getURLGenerator()->linkToDocs('user-sharing-federated')
)
)
),
"oc_defaults" => json_encode(
array(
'entity' => $defaults->getEntity(),
'name' => $defaults->getName(),
'title' => $defaults->getTitle(),
'baseUrl' => $defaults->getBaseUrl(),
'syncClientUrl' => $defaults->getSyncClientUrl(),
'docBaseUrl' => $defaults->getDocBaseUrl(),
'slogan' => $defaults->getSlogan(),
'logoClaim' => $defaults->getLogoClaim(),
'shortFooter' => $defaults->getShortFooter(),
'longFooter' => $defaults->getLongFooter(),
'folder' => OC_Util::getTheme(),
)
)
);
// Allow hooks to modify the output values
OC_Hook::emit('\OCP\Config', 'js', array('array' => &$array));
// Echo it
foreach ($array as $setting => $value) {
echo("var ". $setting ."=".$value.";\n");
}
示例15: imagePath
/**
* Creates path to an image
* @param string $app app
* @param string $image image name
* @throws \RuntimeException If the image does not exist
* @return string the url
*
* Returns the path to the image.
*/
public function imagePath($app, $image)
{
$cache = $this->cacheFactory->create('imagePath');
$cacheKey = $app . '-' . $image;
if ($key = $cache->get($cacheKey)) {
return $key;
}
// Read the selected theme from the config file
$theme = \OC_Util::getTheme();
//if a theme has a png but not an svg always use the png
$basename = substr(basename($image), 0, -4);
$appPath = \OC_App::getAppPath($app);
// Check if the app is in the app folder
$path = '';
if (file_exists(\OC::$SERVERROOT . "/themes/{$theme}/apps/{$app}/img/{$image}")) {
$path = \OC::$WEBROOT . "/themes/{$theme}/apps/{$app}/img/{$image}";
} elseif (!file_exists(\OC::$SERVERROOT . "/themes/{$theme}/apps/{$app}/img/{$basename}.svg") && file_exists(\OC::$SERVERROOT . "/themes/{$theme}/apps/{$app}/img/{$basename}.png")) {
$path = \OC::$WEBROOT . "/themes/{$theme}/apps/{$app}/img/{$basename}.png";
} elseif ($appPath && file_exists($appPath . "/img/{$image}")) {
$path = \OC_App::getAppWebPath($app) . "/img/{$image}";
} elseif ($appPath && !file_exists($appPath . "/img/{$basename}.svg") && file_exists($appPath . "/img/{$basename}.png")) {
$path = \OC_App::getAppWebPath($app) . "/img/{$basename}.png";
} elseif (!empty($app) and file_exists(\OC::$SERVERROOT . "/themes/{$theme}/{$app}/img/{$image}")) {
$path = \OC::$WEBROOT . "/themes/{$theme}/{$app}/img/{$image}";
} elseif (!empty($app) and !file_exists(\OC::$SERVERROOT . "/themes/{$theme}/{$app}/img/{$basename}.svg") && file_exists(\OC::$SERVERROOT . "/themes/{$theme}/{$app}/img/{$basename}.png")) {
$path = \OC::$WEBROOT . "/themes/{$theme}/{$app}/img/{$basename}.png";
} elseif (!empty($app) and file_exists(\OC::$SERVERROOT . "/{$app}/img/{$image}")) {
$path = \OC::$WEBROOT . "/{$app}/img/{$image}";
} elseif (!empty($app) and !file_exists(\OC::$SERVERROOT . "/{$app}/img/{$basename}.svg") && file_exists(\OC::$SERVERROOT . "/{$app}/img/{$basename}.png")) {
$path = \OC::$WEBROOT . "/{$app}/img/{$basename}.png";
} elseif (file_exists(\OC::$SERVERROOT . "/themes/{$theme}/core/img/{$image}")) {
$path = \OC::$WEBROOT . "/themes/{$theme}/core/img/{$image}";
} elseif (!file_exists(\OC::$SERVERROOT . "/themes/{$theme}/core/img/{$basename}.svg") && file_exists(\OC::$SERVERROOT . "/themes/{$theme}/core/img/{$basename}.png")) {
$path = \OC::$WEBROOT . "/themes/{$theme}/core/img/{$basename}.png";
} elseif (file_exists(\OC::$SERVERROOT . "/core/img/{$image}")) {
$path = \OC::$WEBROOT . "/core/img/{$image}";
}
if ($path !== '') {
$cache->set($cacheKey, $path);
return $path;
} else {
throw new RuntimeException('image not found: image:' . $image . ' webroot:' . \OC::$WEBROOT . ' serverroot:' . \OC::$SERVERROOT);
}
}