本文整理汇总了PHP中OC_App::getAppWebPath方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_App::getAppWebPath方法的具体用法?PHP OC_App::getAppWebPath怎么用?PHP OC_App::getAppWebPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_App
的用法示例。
在下文中一共展示了OC_App::getAppWebPath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doFind
/**
* @param string $script
*/
public function doFind($script)
{
$theme_dir = 'themes/' . $this->theme . '/';
if (strpos($script, '3rdparty') === 0 && $this->appendIfExist($this->thirdpartyroot, $script . '.js')) {
return;
}
if (strpos($script, '/l10n/') !== false) {
// For language files we try to load them all, so themes can overwrite
// single l10n strings without having to translate all of them.
$found = 0;
$found += $this->appendIfExist($this->serverroot, 'core/' . $script . '.js');
$found += $this->appendIfExist($this->serverroot, $theme_dir . 'core/' . $script . '.js');
$found += $this->appendIfExist($this->serverroot, $script . '.js');
$found += $this->appendIfExist($this->serverroot, $theme_dir . $script . '.js');
$found += $this->appendIfExist($this->serverroot, $theme_dir . 'apps/' . $script . '.js');
if ($found) {
return;
}
} else {
if ($this->appendIfExist($this->serverroot, $theme_dir . 'apps/' . $script . '.js') || $this->appendIfExist($this->serverroot, $theme_dir . $script . '.js') || $this->appendIfExist($this->serverroot, $script . '.js') || $this->appendIfExist($this->serverroot, $theme_dir . 'core/' . $script . '.js') || $this->appendIfExist($this->serverroot, 'core/' . $script . '.js')) {
return;
}
}
$app = substr($script, 0, strpos($script, '/'));
$script = substr($script, strpos($script, '/') + 1);
$app_path = \OC_App::getAppPath($app);
$app_url = \OC_App::getAppWebPath($app);
// missing translations files fill be ignored
if (strpos($script, 'l10n/') === 0) {
$this->appendIfExist($app_path, $script . '.js', $app_url);
return;
}
$this->append($app_path, $script . '.js', $app_url);
}
示例2: generateFileURL
/**
* @PublicPage
* @NoCSRFRequired
*
* @return TemplateResponse
*/
public function generateFileURL($file)
{
$url = sha1($file . mt_rand());
$app_path = \OC_App::getAppPath("libreonline");
$tmp_path = $app_path . '/tmp';
//FIXME: We should use owncloud api here.
copy("/var/www/owncloud/data/" . $this->userId . "/files{$file}", "{$tmp_path}/{$url}");
$uri = \OC_App::getAppWebPath('libreonline') . "/tmp/{$url}";
return $uri;
}
示例3: doFind
/**
* @param string $style
*/
public function doFind($style)
{
if (strpos($style, '3rdparty') === 0 && $this->appendIfExist($this->thirdpartyroot, $style . '.css') || $this->appendIfExist($this->serverroot, $style . '.css') || $this->appendIfExist($this->serverroot, 'core/' . $style . '.css')) {
return;
}
$app = substr($style, 0, strpos($style, '/'));
$style = substr($style, strpos($style, '/') + 1);
$app_path = \OC_App::getAppPath($app);
$app_url = \OC_App::getAppWebPath($app);
$this->append($app_path, $style . '.css', $app_url);
}
示例4: generateFileURL
/**
* @PublicPage
* @NoCSRFRequired
*
* @return TemplateResponse
*/
public function generateFileURL($file)
{
$url = sha1($file . mt_rand());
$app_path = \OC_App::getAppPath("libreonline");
$tmp_path = $app_path . '/tmp';
$config = \OC::$server->getConfig();
$datadirectory = $config->getSystemValue('datadirectory', false);
copy("{$datadirectory}/" . $this->userId . "/files{$file}", "{$tmp_path}/{$url}");
$uri = \OC_App::getAppWebPath('libreonline') . "/tmp/{$url}";
return $uri;
}
示例5: doFind
public function doFind($style)
{
if (strpos($style, '3rdparty') === 0 && $this->appendIfExist($this->thirdpartyroot, $style . '.css') || $this->appendIfExist($this->serverroot, $style . $this->form_factor . '.css') || $this->appendIfExist($this->serverroot, $style . '.css') || $this->appendIfExist($this->serverroot, 'core/' . $style . $this->form_factor . '.css') || $this->appendIfExist($this->serverroot, 'core/' . $style . '.css')) {
return;
}
$app = substr($style, 0, strpos($style, '/'));
$style = substr($style, strpos($style, '/') + 1);
$app_path = \OC_App::getAppPath($app);
$app_url = \OC_App::getAppWebPath($app);
if ($this->appendIfExist($app_path, $style . $this->form_factor . '.css', $app_url) || $this->appendIfExist($app_path, $style . '.css', $app_url)) {
return;
}
throw new \Exception('css file not found: style:' . $style);
}
示例6: doFind
public function doFind($script)
{
$theme_dir = 'themes/' . $this->theme . '/';
if (strpos($script, '3rdparty') === 0 && $this->appendIfExist($this->thirdpartyroot, $script . '.js') || $this->appendIfExist($this->serverroot, $theme_dir . 'apps/' . $script . $this->form_factor . '.js') || $this->appendIfExist($this->serverroot, $theme_dir . 'apps/' . $script . '.js') || $this->appendIfExist($this->serverroot, $theme_dir . $script . $this->form_factor . '.js') || $this->appendIfExist($this->serverroot, $theme_dir . $script . '.js') || $this->appendIfExist($this->serverroot, $script . $this->form_factor . '.js') || $this->appendIfExist($this->serverroot, $script . '.js') || $this->appendIfExist($this->serverroot, $theme_dir . 'core/' . $script . $this->form_factor . '.js') || $this->appendIfExist($this->serverroot, $theme_dir . 'core/' . $script . '.js') || $this->appendIfExist($this->serverroot, 'core/' . $script . $this->form_factor . '.js') || $this->appendIfExist($this->serverroot, 'core/' . $script . '.js')) {
return;
}
$app = substr($script, 0, strpos($script, '/'));
$script = substr($script, strpos($script, '/') + 1);
$app_path = \OC_App::getAppPath($app);
$app_url = \OC_App::getAppWebPath($app);
if ($this->appendIfExist($app_path, $script . $this->form_factor . '.js', $app_url) || $this->appendIfExist($app_path, $script . '.js', $app_url)) {
return;
}
throw new \Exception('js file not found: script:' . $script);
}
示例7: doFind
/**
* @param string $script
*/
public function doFind($script)
{
$theme_dir = 'themes/' . $this->theme . '/';
if (strpos($script, '3rdparty') === 0 && $this->appendIfExist($this->thirdpartyroot, $script . '.js') || $this->appendIfExist($this->serverroot, $theme_dir . 'apps/' . $script . '.js') || $this->appendIfExist($this->serverroot, $theme_dir . $script . '.js') || $this->appendIfExist($this->serverroot, $script . '.js') || $this->appendIfExist($this->serverroot, $theme_dir . 'core/' . $script . '.js') || $this->appendIfExist($this->serverroot, 'core/' . $script . '.js')) {
return;
}
$app = substr($script, 0, strpos($script, '/'));
$script = substr($script, strpos($script, '/') + 1);
$app_path = \OC_App::getAppPath($app);
$app_url = \OC_App::getAppWebPath($app);
// missing translations files fill be ignored
if (strpos($script, 'l10n/') === 0) {
$this->appendIfExist($app_path, $script . '.js', $app_url);
return;
}
$this->append($app_path, $script . '.js', $app_url);
}
示例8: array
<?php
/**
* Copyright (c) 2011 Jakob Sack <mail@jakobsack.de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
OCP\App::checkAppEnabled('calendar');
if (substr(OCP\Util::getRequestUri(), 0, strlen(OC_App::getAppWebPath('calendar') . '/caldav.php')) == OC_App::getAppWebPath('calendar') . '/caldav.php') {
$baseuri = OC_App::getAppWebPath('calendar') . '/caldav.php';
}
// only need authentication apps
$RUNTIME_APPTYPES = array('authentication');
OC_App::loadApps($RUNTIME_APPTYPES);
// Backends
$authBackend = new OC_Connector_Sabre_Auth();
$principalBackend = new OC_Connector_Sabre_Principal();
$caldavBackend = new OC_Connector_Sabre_CalDAV();
$requestBackend = new OC_Connector_Sabre_Request();
// Root nodes
$Sabre_CalDAV_Principal_Collection = new Sabre_CalDAV_Principal_Collection($principalBackend);
$Sabre_CalDAV_Principal_Collection->disableListing = true;
// Disable listening
$calendarRoot = new OC_Connector_Sabre_CalDAV_CalendarRoot($principalBackend, $caldavBackend);
$calendarRoot->disableListing = true;
// Disable listening
$nodes = array($Sabre_CalDAV_Principal_Collection, $calendarRoot);
// Fire up server
$server = new Sabre_DAV_Server($nodes);
$server->httpRequest = $requestBackend;
示例9: array
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library 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 along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
OCP\App::checkAppEnabled('contacts');
if (substr(OCP\Util::getRequestUri(), 0, strlen(OC_App::getAppWebPath('contacts') . '/carddav.php')) === OC_App::getAppWebPath('contacts') . '/carddav.php') {
$baseuri = OC_App::getAppWebPath('contacts') . '/carddav.php';
}
// only need authentication apps
$RUNTIME_APPTYPES = array('authentication');
OC_App::loadApps($RUNTIME_APPTYPES);
// Backends
$authBackend = new OC_Connector_Sabre_Auth();
$principalBackend = new OC_Connector_Sabre_Principal();
$addressbookbackends = array();
$addressbookbackends[] = new OCA\Contacts\Backend\Database(\OCP\User::getUser());
$carddavBackend = new OCA\Contacts\CardDAV\Backend(array('local', 'shared'));
$requestBackend = new OC_Connector_Sabre_Request();
// Root nodes
$principalCollection = new Sabre_CalDAV_Principal_Collection($principalBackend);
$principalCollection->disableListing = true;
// Disable listing
示例10: 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_Config::getValue( "theme" );
// 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();
}
}
示例11: getsourcepdf
private function getsourcepdf(array $data)
{
ini_set('memory_limit', '1024M');
if (!is_dir(dirname(__DIR__) . '/tmp')) {
mkdir(dirname(__DIR__) . '/tmp');
}
chmod(dirname(__DIR__) . '/tmp', 0777);
$params = ['error' => null, 'errorinfo' => ''];
$tmpFileName = 'gantt_export_' . Helper::randomString() . '.pdf';
$tmpFilePath = \OC::$SERVERROOT . \OC_App::getAppWebPath('owncollab_chart') . '/tmp/' . $tmpFileName;
$encodeData = 'data=' . urlencode($data['data']) . '&type=pdf';
ob_start();
system('curl --request POST "https://export.dhtmlx.com/gantt" --data "' . $encodeData . '"');
$result = ob_get_clean();
//$params['$encodeData'] = $encodeData;
//$params['$tmpFilePath'] = print_r($result, true);
//$params['result strlen'] = strlen($result);
$print_portrait = isset($data['printconf']['orientation']) && $data['printconf']['orientation'] == 'P';
$print_paper_size = isset($data['printconf']['paper_size']) ? $data['printconf']['paper_size'] : 'A4';
$print_notes = isset($data['pagenotes']) ? $data['pagenotes'] : false;
if ($result) {
if ($is_save = file_put_contents($tmpFilePath, $result)) {
$downloadPath = $this->explodePDF($tmpFilePath, $print_portrait, $print_paper_size, $print_notes);
if ($downloadPath) {
$params['download'] = $downloadPath;
} else {
$params['errorinfo'] = 'Error: download path exist';
}
} else {
$params['errorinfo'] = 'Saved PDF file fail. Temp path: ' . $tmpFilePath;
}
} else {
$params['errorinfo'] = 'Request to export.dhtmlx.com is failed. Or response is empty';
}
if (is_array($params)) {
return new DataResponse($params);
}
}
示例12: loadCSSFile
protected static function loadCSSFile()
{
$app = OC::$REQUESTEDAPP;
$file = OC::$REQUESTEDFILE;
$app_path = OC_App::getAppPath($app);
if (file_exists($app_path . '/' . $file)) {
$app_web_path = OC_App::getAppWebPath($app);
$filepath = $app_web_path . '/' . $file;
$minimizer = new OC_Minimizer_CSS();
$info = array($app_path, $app_web_path, $file);
$minimizer->output(array($info), $filepath);
}
}
示例13:
\OCP\Util::addStyle(K_APP_NAME, 'styles');
\OCP\Util::addScript(K_APP_NAME, 'go');
?>
<div id="apps2_games">
<div id="controls">
<div id="apps2_games_versions">
<?php
echo 'Apps2 - Games'.'<br>v'.\OC_Appconfig::getValue(K_APP_NAME,'installed_version').' / '.\OC_Util::getVersionString();
?>
</div>
<div id="apps2_games_back" class="button"><span>List of games</span></div>
</div>
<div id="apps2_games_list" class="hascontrols">
<ul class="apps2_games_grid">
<?php
$myPath = \OC_App::getAppWebPath(K_APP_NAME);
foreach ( $_['mainList'] as $myItem ) {
echo<<<EOG
<li class="apps2_games_item">
<a href="$myPath/{$myItem->js}" class="apps2_games_href">
<div class="apps2_games_item_icon">
<img src="$myPath/{$myItem->ico}">
</div>
<div class="apps2_games_item_caption">{$myItem->caption}</div>
</a>
{$myItem->title}
</li>
EOG;
}
?>
</ul>
示例14: 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);
}
}
示例15: WebPath
/**
* @return string
*/
public static function WebPath()
{
$sAppPath = '';
if (\RainLoop\Utils::IsOwnCloud()) {
if (\class_exists('OC_App')) {
$sAppPath = \rtrim(\trim(\OC_App::getAppWebPath('rainloop')), '\\/') . '/app/';
}
if (empty($sAppPath)) {
$sUrl = \MailSo\Base\Http::SingletonInstance()->GetUrl();
if ($sUrl && \preg_match('/\\/index\\.php\\/apps\\/rainloop/', $sUrl)) {
$sAppPath = \preg_replace('/\\/index\\.php\\/apps\\/rainloop.+$/', '/apps/rainloop/app/', $sUrl);
}
}
}
return $sAppPath;
}