예제 #1
0
 /**
  * @NoAdminRequired
  * @NoCSRFRequired
  */
 public function index()
 {
     \OCP\Util::addscript('core', 'tags');
     \OCP\Util::addStyle($this->appName, 'style');
     \OCP\Util::addStyle($this->appName, 'jquery.Jcrop');
     \OCP\Util::addStyle($this->appName, '3rdparty/fontello/css/animation');
     \OCP\Util::addStyle($this->appName, '3rdparty/fontello/css/fontello');
     \OCP\Util::addStyle($this->appName, '3rdparty/jquery.webui-popover');
     \OCP\Util::addscript($this->appName, 'app');
     \OCP\Util::addscript($this->appName, '3rdparty/jquery.webui-popover');
     \OCP\Util::addscript($this->appName, 'settings');
     \OCP\Util::addscript($this->appName, 'loader');
     \OCP\Util::addscript($this->appName, 'jquery.scrollTo.min');
     \OCP\Util::addscript($this->appName, 'jquery.nicescroll.min');
     \OCP\Util::addscript('files', 'jquery.fileupload');
     \OCP\Util::addscript($this->appName, 'jquery.Jcrop');
     $iosSupport = $this->configInfo->getUserValue($this->userId, $this->appName, 'iossupport');
     $maxUploadFilesize = \OCP\Util::maxUploadFilesize('/');
     $addressbooks = Addressbook::all($this->userId);
     if (count($addressbooks) == 0) {
         Addressbook::addDefault($this->userId);
         $addressbooks = Addressbook::all($this->userId);
     }
     //ContactsApp::addingDummyContacts(50);
     $params = ['uploadMaxFilesize' => $maxUploadFilesize, 'uploadMaxHumanFilesize' => \OCP\Util::humanFileSize($maxUploadFilesize), 'iossupport' => $iosSupport, 'addressbooks' => $addressbooks];
     $csp = new \OCP\AppFramework\Http\ContentSecurityPolicy();
     $csp->addAllowedImageDomain('*');
     $csp->addAllowedFrameDomain('*');
     $response = new TemplateResponse($this->appName, 'index');
     $response->setContentSecurityPolicy($csp);
     $response->setParams($params);
     return $response;
 }
예제 #2
0
 /**
  * Load the frontend files needed
  */
 public function loadFrontend()
 {
     \OCP\Util::addStyle('ocusagecharts', 'c3js/c3');
     \OCP\Util::addScript('ocusagecharts', 'c3js/d3.min');
     \OCP\Util::addScript('ocusagecharts', 'c3js/c3.min');
     \OCP\Util::addScript('ocusagecharts', 'c3js/initGraphs');
 }
예제 #3
0
 /**
  * @NoAdminRequired
  * @NoCSRFRequired
  */
 public function index()
 {
     if (defined('DEBUG') && DEBUG) {
         \OCP\Util::addScript('tasks', 'vendor/angularjs/angular');
         \OCP\Util::addScript('tasks', 'vendor/angularjs/angular-route');
         \OCP\Util::addScript('tasks', 'vendor/angularjs/angular-animate');
         \OCP\Util::addScript('tasks', 'vendor/momentjs/moment');
         \OCP\Util::addScript('tasks', 'vendor/bootstrap/ui-bootstrap-custom-tpls-0.10.0');
     } else {
         \OCP\Util::addScript('tasks', 'vendor/angularjs/angular.min');
         \OCP\Util::addScript('tasks', 'vendor/angularjs/angular-route.min');
         \OCP\Util::addScript('tasks', 'vendor/angularjs/angular-animate.min');
         \OCP\Util::addScript('tasks', 'vendor/momentjs/moment.min');
         \OCP\Util::addScript('tasks', 'vendor/bootstrap/ui-bootstrap-custom-tpls-0.10.0.min');
     }
     \OCP\Util::addScript('tasks', 'public/app');
     \OCP\Util::addScript('tasks', 'vendor/appframework/app');
     \OCP\Util::addScript('tasks', 'vendor/timepicker/jquery.ui.timepicker');
     \OCP\Util::addStyle('tasks', 'style');
     \OCP\Util::addStyle('tasks', 'vendor/bootstrap/bootstrap');
     $date = new \DateTimeZone(\OC_Calendar_App::getTimezone());
     $day = new \DateTime('today', $date);
     $day = $day->format('d');
     // TODO: Make a HTMLTemplateResponse class
     $response = new TemplateResponse('tasks', 'main');
     $response->setParams(array('DOM' => $day));
     return $response;
 }
예제 #4
0
 /**
  * Load additional scripts when the files app is visible
  */
 public static function onLoadFilesAppScripts()
 {
     Util::addScript('snannyowncloudapi', 'tabview');
     Util::addScript('snannyowncloudapi', 'filesplugin');
     Util::addScript('snannyowncloudapi', 'fileupload');
     Util::addScript('snannyowncloudapi', 'templateutil');
     Util::addStyle('snannyowncloudapi', 'style');
 }
예제 #5
0
파일: compat.php 프로젝트: arun-TK/chat
 function vendor_style($app, $files)
 {
     if (is_array($files)) {
         foreach ($files as $file) {
             \OCP\Util::addStyle('chat', '../vendor/' . $file);
         }
     } else {
         \OCP\Util::addStyle('chat', '../vendor/' . $files);
     }
 }
예제 #6
0
 /**
  * @NoAdminRequired
  * @NoCSRFRequired
  */
 public function index()
 {
     if (\OC::$server->getAppManager()->isEnabledForUser('calendarplus')) {
         $csp = new \OCP\AppFramework\Http\ContentSecurityPolicy();
         $csp->addAllowedImageDomain(':data');
         $config = \OC::$server->getConfig();
         $response = new TemplateResponse($this->appName, 'index');
         $response->setParams(array('allowShareWithLink' => $config->getAppValue('core', 'shareapi_allow_links', 'yes'), 'mailNotificationEnabled' => $config->getAppValue('core', 'shareapi_allow_mail_notification', 'no'), 'mailPublicNotificationEnabled' => $config->getAppValue('core', 'shareapi_allow_public_notification', 'no'), 'appname' => TasksApp::$appname, 'calappname' => CalendarApp::$appname));
         $response->setContentSecurityPolicy($csp);
     } else {
         \OCP\Util::addStyle($this->appName, 'style');
         $response = new TemplateResponse($this->appName, 'no-calendar-app');
     }
     return $response;
 }
예제 #7
0
 /**
  * @NoAdminRequired
  * @NoCSRFRequired
  */
 public function index()
 {
     \OC::$server->getNavigationManager()->setActiveEntry($this->appName);
     $importManager = new ImportManager();
     $imppTypes = Properties::getTypesForProperty('IMPP');
     $adrTypes = Properties::getTypesForProperty('ADR');
     $phoneTypes = Properties::getTypesForProperty('TEL');
     $emailTypes = Properties::getTypesForProperty('EMAIL');
     $ims = Properties::getIMOptions();
     $imProtocols = array();
     foreach ($ims as $name => $values) {
         $imProtocols[$name] = $values['displayname'];
     }
     $maxUploadFilesize = \OCP\Util::maxUploadFilesize('/');
     \OCP\Util::addScript('', 'jquery.multiselect');
     \OCP\Util::addScript('', 'tags');
     \OCP\Util::addScript('placeholder');
     \OCP\Util::addScript('3rdparty', 'md5/md5.min');
     \OCP\Util::addScript('jquery.avatar');
     \OCP\Util::addScript('avatar');
     \OCP\Util::addScript('contacts', 'jquery.combobox');
     \OCP\Util::addScript('contacts', 'modernizr.custom');
     \OCP\Util::addScript('contacts', 'app');
     \OCP\Util::addScript('contacts', 'addressbooks');
     \OCP\Util::addScript('contacts', 'contacts');
     \OCP\Util::addScript('contacts', 'storage');
     \OCP\Util::addScript('contacts', 'groups');
     \OCP\Util::addScript('contacts', 'jquery.ocaddnew');
     \OCP\Util::addScript('contacts', 'otherbackendconfig');
     \OCP\Util::addScript('files', 'jquery.fileupload');
     \OCP\Util::addScript('3rdparty/Jcrop', 'jquery.Jcrop');
     \OCP\Util::addStyle('', 'jquery.multiselect');
     \OCP\Util::addStyle('contacts', 'jquery.combobox');
     \OCP\Util::addStyle('contacts', 'jquery.ocaddnew');
     \OCP\Util::addStyle('3rdparty/Jcrop', 'jquery.Jcrop');
     \OCP\Util::addStyle('contacts', 'contacts');
     $response = new TemplateResponse($this->appName, 'contacts');
     $response->setParams(array('uploadMaxFilesize' => $maxUploadFilesize, 'uploadMaxHumanFilesize' => \OCP\Util::humanFileSize($maxUploadFilesize), 'phoneTypes' => $phoneTypes, 'emailTypes' => $emailTypes, 'adrTypes' => $adrTypes, 'imppTypes' => $imppTypes, 'imProtocols' => $imProtocols, 'importManager' => $importManager));
     return $response;
 }
예제 #8
0
파일: main.php 프로젝트: arnovr/dashboard
<?php

// JS Scripts
\OCP\Util::addScript('dashboard', 'script');
// CSS Styles
\OCP\Util::addStyle('dashboard', 'widgets');
\OCP\Util::addStyle('dashboard', 'control');
/*
$widgets = $_['enabledWidgets'];
$widgetsJson = OC_JSON::encode($widgets);
*/
?>

<div id="app">
	<div id="app-content">
		<?php 
print_unescaped($this->inc('part.content'));
?>
		<?php 
print_unescaped($this->inc('part.control'));
?>
	</div>
</div>
예제 #9
0
파일: api.php 프로젝트: loulancn/core
 /**
  * @deprecated include javascript and css in template files
  * shorthand for addStyle for files in the 3rdparty directory
  * @param string $name the name of the file without the suffix
  */
 public function add3rdPartyStyle($name)
 {
     \OCP\Util::addStyle($this->appName . '/3rdparty', $name);
 }
예제 #10
0
파일: main.php 프로젝트: hjimmy/owncloud
<?php

\OCP\Util::addScript('music', 'vendor/underscore/underscore-min');
\OCP\Util::addScript('music', 'vendor/angular/angular.min');
\OCP\Util::addScript('music', 'vendor/angular/angular-route.min');
\OCP\Util::addScript('music', 'vendor/soundmanager/soundmanager2');
\OCP\Util::addScript('music', 'vendor/restangular/restangular.min');
\OCP\Util::addScript('music', 'vendor/angular-gettext/angular-gettext.min');
\OCP\Util::addScript('music', 'public/app');
\OCP\Util::addStyle('music', 'style-playerbar');
\OCP\Util::addStyle('music', 'style-sidebar');
\OCP\Util::addStyle('music', 'style');
\OCP\Util::addStyle('music', 'mobile');
\OCP\Util::addStyle('music', 'tablet');
?>

<div id="app" ng-app="Music" ng-cloak ng-init="started = false; lang = '<?php 
p($_['lang']);
?>
'">

	<div ng-controller="MainController">
		<!-- this will be used to display the flash element to give the user a chance to unblock flash -->
		<div id="sm2-container" ng-class="{started: started}"></div>

		<div id="playerbar" ng-controller="PlayerController" ng-class="{started: started}">
			<div id="play-controls">
				<img ng-click="prev()" class="control small svg" alt="{{'Previous' | translate }}"
					src="<?php 
p(OCP\image_path('music', 'play-previous.svg'));
?>
예제 #11
0
파일: main.php 프로젝트: nerzhul/ownBoard
<?php

\OCP\Util::addScript('ownboard', 'angular/angular.min');
\OCP\Util::addScript('ownboard', 'public/app');
\OCP\Util::addStyle('ownboard', 'style');
?>

<div class="ng-scope" id="app" ng-app="OwnBoard" ng-controller="OwnBoardController">
	<div id="board-list-left">
		<ul class="board-list">
			<li class=board-list-item" ng-repeat="board in boards" class="{{ board.id == selectedBoardId ? 'selected' : ''}}">
				<a href="#" ng-click="loadBoard(board.id);">{{ board.name }}</a>
				<div class="icon-delete svn delete action" ng-click="deleteBoard(board);"></div>
			</li>
			<li>
				<a href="#" ng-click="showCreateBoard = true;">Add a board...</a>
				<div ng-show="showCreateBoard == true" id="create-board">
					<h1>Create board</h1>
					<hr>
					<h2>Title</h2>
					<span class="board-form-error" ng-show="createBoardError != ''">{{ createBoardError }}</span>
					<form novalidate>
						<input type="textbox" ng-model="board.name"/>
						<input type="submit" value="Add" ng-click="createBoard(board);"/>
						<input type="button" value="Cancel" ng-click="showCreateBoard = false;"/>
					</form>
				</div>
			</li>
		</ul>
	</div>
	<div id="board-right" ng-show="selectedBoardId != 0">
예제 #12
0
 * 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/>
 *
 */
$eventDispatcher = \OC::$server->getEventDispatcher();
$eventDispatcher->addListener('OCA\\Files::loadAdditionalScripts', function () {
    \OCP\Util::addScript('oc-backbone-webdav');
    \OCP\Util::addScript('comments', 'app');
    \OCP\Util::addScript('comments', 'commentmodel');
    \OCP\Util::addScript('comments', 'commentcollection');
    \OCP\Util::addScript('comments', 'commentsummarymodel');
    \OCP\Util::addScript('comments', 'commentstabview');
    \OCP\Util::addScript('comments', 'filesplugin');
    \OCP\Util::addStyle('comments', 'comments');
});
$activityManager = \OC::$server->getActivityManager();
$activityManager->registerExtension(function () {
    $application = new \OCP\AppFramework\App('comments');
    /** @var \OCA\Comments\Activity\Extension $extension */
    $extension = $application->getContainer()->query('OCA\\Comments\\Activity\\Extension');
    return $extension;
});
$managerListener = function (\OCP\Comments\CommentsEvent $event) use($activityManager) {
    $application = new \OCP\AppFramework\App('comments');
    /** @var \OCA\Comments\Activity\Listener $listener */
    $listener = $application->getContainer()->query('OCA\\Comments\\Activity\\Listener');
    $listener->commentEvent($event);
};
$eventDispatcher->addListener(\OCP\Comments\CommentsEvent::EVENT_ADD, $managerListener);
예제 #13
0
파일: admin.php 프로젝트: samj1912/repo
<?php

/**
 * ownCloud - Updater plugin
 *
 * @author Victor Dubiniuk
 * @copyright 2012-2013 Victor Dubiniuk victor.dubiniuk@gmail.com
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 */
namespace OCA\Updater;

\OCP\User::checkAdminUser();
\OCP\Util::addScript(App::APP_ID, '3rdparty/angular');
\OCP\Util::addScript(App::APP_ID, 'app');
\OCP\Util::addScript(App::APP_ID, 'controllers');
\OCP\Util::addStyle(App::APP_ID, 'updater');
if (!@file_exists(App::getBackupBase())) {
    Helper::mkdir(App::getBackupBase());
}
$data = App::getFeed();
$isNewVersionAvailable = isset($data['version']) && $data['version'] != '' && $data['version'] !== array();
$tmpl = new \OCP\Template(App::APP_ID, 'admin');
$lastCheck = \OC_Appconfig::getValue('core', 'lastupdatedat');
$tmpl->assign('checkedAt', \OCP\Util::formatDate($lastCheck));
$tmpl->assign('isNewVersionAvailable', $isNewVersionAvailable ? 'true' : 'false');
$tmpl->assign('channels', Channel::getChannels());
$tmpl->assign('currentChannel', Channel::getCurrentChannel());
$tmpl->assign('version', isset($data['versionstring']) ? $data['versionstring'] : '');
return $tmpl->fetchPage();
예제 #14
0
파일: app.php 프로젝트: ZverAleksey/core
    // FIXME: no public API for these ?
    \OC_Util::addVendorScript('select2/select2');
    \OC_Util::addVendorStyle('select2/select2');
    \OCP\Util::addScript('select2-toggleselect');
    \OCP\Util::addScript('oc-backbone-webdav');
    \OCP\Util::addScript('systemtags/systemtags');
    \OCP\Util::addScript('systemtags/systemtagmodel');
    \OCP\Util::addScript('systemtags/systemtagsmappingcollection');
    \OCP\Util::addScript('systemtags/systemtagscollection');
    \OCP\Util::addScript('systemtags/systemtagsinputfield');
    \OCP\Util::addScript('systemtags', 'app');
    \OCP\Util::addScript('systemtags', 'systemtagsfilelist');
    \OCP\Util::addScript('systemtags', 'filesplugin');
    \OCP\Util::addScript('systemtags', 'systemtagsinfoview');
    \OCP\Util::addStyle('systemtags');
    \OCP\Util::addStyle('systemtags', 'systemtagsfilelist');
});
$activityManager = \OC::$server->getActivityManager();
$activityManager->registerExtension(function () {
    $application = new \OCP\AppFramework\App('systemtags');
    /** @var \OCA\SystemTags\Activity\Extension $extension */
    $extension = $application->getContainer()->query('OCA\\SystemTags\\Activity\\Extension');
    return $extension;
});
$managerListener = function (ManagerEvent $event) use($activityManager) {
    $application = new \OCP\AppFramework\App('systemtags');
    /** @var \OCA\SystemTags\Activity\Listener $listener */
    $listener = $application->getContainer()->query('OCA\\SystemTags\\Activity\\Listener');
    $listener->event($event);
};
$eventDispatcher->addListener(ManagerEvent::EVENT_CREATE, $managerListener);
예제 #15
0
파일: index.php 프로젝트: rosarion/core
OCP\Util::addscript('files', 'jquery.iframe-transport');
OCP\Util::addscript('files', 'jquery.fileupload');
OCP\Util::addscript('files', 'jquery-visibility');
OCP\Util::addscript('files', 'fileinfomodel');
OCP\Util::addscript('files', 'filesummary');
OCP\Util::addscript('files', 'breadcrumb');
OCP\Util::addscript('files', 'filelist');
OCP\Util::addscript('files', 'search');
\OCP\Util::addScript('files', 'favoritesfilelist');
\OCP\Util::addScript('files', 'tagsplugin');
\OCP\Util::addScript('files', 'favoritesplugin');
\OCP\Util::addScript('files', 'detailfileinfoview');
\OCP\Util::addScript('files', 'detailtabview');
\OCP\Util::addScript('files', 'mainfileinfodetailview');
\OCP\Util::addScript('files', 'detailsview');
\OCP\Util::addStyle('files', 'detailsView');
\OC_Util::addVendorScript('core', 'handlebars/handlebars');
OCP\App::setActiveNavigationEntry('files_index');
$l = \OC::$server->getL10N('files');
$isIE8 = false;
preg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $matches);
if (count($matches) > 0 && $matches[1] <= 9) {
    $isIE8 = true;
}
// if IE8 and "?dir=path&view=someview" was specified, reformat the URL to use a hash like "#?dir=path&view=someview"
if ($isIE8 && (isset($_GET['dir']) || isset($_GET['view']))) {
    $hash = '#?';
    $dir = isset($_GET['dir']) ? $_GET['dir'] : '/';
    $view = isset($_GET['view']) ? $_GET['view'] : 'files';
    $hash = '#?dir=' . \OCP\Util::encodePath($dir);
    if ($view !== 'files') {
예제 #16
0
 /**
  * Prints the upgrade page
  */
 private static function printUpgradePage()
 {
     $systemConfig = \OC::$server->getSystemConfig();
     $disableWebUpdater = $systemConfig->getValue('upgrade.disable-web', false);
     $tooBig = false;
     if (!$disableWebUpdater) {
         $apps = \OC::$server->getAppManager();
         $tooBig = $apps->isInstalled('user_ldap') || $apps->isInstalled('user_shibboleth');
         if (!$tooBig) {
             // count users
             $stats = \OC::$server->getUserManager()->countUsers();
             $totalUsers = array_sum($stats);
             $tooBig = $totalUsers > 50;
         }
     }
     if ($disableWebUpdater || $tooBig) {
         // send http status 503
         header('HTTP/1.1 503 Service Temporarily Unavailable');
         header('Status: 503 Service Temporarily Unavailable');
         header('Retry-After: 120');
         // render error page
         $template = new OC_Template('', 'update.use-cli', 'guest');
         $template->assign('productName', 'ownCloud');
         // for now
         $template->assign('version', OC_Util::getVersionString());
         $template->assign('tooBig', $tooBig);
         $template->printPage();
         die;
     }
     // check whether this is a core update or apps update
     $installedVersion = $systemConfig->getValue('version', '0.0.0');
     $currentVersion = implode('.', \OCP\Util::getVersion());
     // if not a core upgrade, then it's apps upgrade
     $isAppsOnlyUpgrade = version_compare($currentVersion, $installedVersion, '=');
     $oldTheme = $systemConfig->getValue('theme');
     $systemConfig->setValue('theme', '');
     \OCP\Util::addScript('config');
     // needed for web root
     \OCP\Util::addScript('update');
     \OCP\Util::addStyle('update');
     $appManager = \OC::$server->getAppManager();
     $tmpl = new OC_Template('', 'update.admin', 'guest');
     $tmpl->assign('version', OC_Util::getVersionString());
     $tmpl->assign('isAppsOnlyUpgrade', $isAppsOnlyUpgrade);
     // get third party apps
     $ocVersion = \OCP\Util::getVersion();
     $tmpl->assign('appsToUpgrade', $appManager->getAppsNeedingUpgrade($ocVersion));
     $tmpl->assign('incompatibleAppsList', $appManager->getIncompatibleApps($ocVersion));
     $tmpl->assign('productName', 'ownCloud');
     // for now
     $tmpl->assign('oldTheme', $oldTheme);
     $tmpl->printPage();
 }
예제 #17
0
파일: list.php 프로젝트: kenwi/core
/**
 * @author Jesús Macias <*****@*****.**>
 * @author Vincent Petry <*****@*****.**>
 *
 * @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/>
 *
 */
// Check if we are a user
OCP\User::checkLoggedIn();
$tmpl = new OCP\Template('files_external', 'list', '');
/* Load Status Manager */
\OCP\Util::addStyle('files_external', 'external');
\OCP\Util::addScript('files_external', 'statusmanager');
\OCP\Util::addScript('files_external', 'rollingqueue');
OCP\Util::addScript('files_external', 'app');
OCP\Util::addScript('files_external', 'mountsfilelist');
$tmpl->printPage();
예제 #18
0
\OC::$CLASSPATH['OC_Share_Backend_File'] = 'files_sharing/lib/share/file.php';
\OC::$CLASSPATH['OC_Share_Backend_Folder'] = 'files_sharing/lib/share/folder.php';
\OC::$CLASSPATH['OC\\Files\\Storage\\Shared'] = 'files_sharing/lib/sharedstorage.php';
$application = new \OCA\Files_Sharing\AppInfo\Application();
$application->registerMountProviders();
\OCA\Files_Sharing\Helper::registerHooks();
\OCP\Share::registerBackend('file', 'OC_Share_Backend_File');
\OCP\Share::registerBackend('folder', 'OC_Share_Backend_Folder', 'file');
$eventDispatcher = \OC::$server->getEventDispatcher();
$eventDispatcher->addListener('OCA\\Files::loadAdditionalScripts', function () {
    \OCP\Util::addScript('files_sharing', 'share');
    \OCP\Util::addScript('files_sharing', 'sharetabview');
    if (\OC::$server->getConfig()->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'yes') {
        \OCP\Util::addScript('files_sharing', 'external');
    }
    \OCP\Util::addStyle('files_sharing', 'sharetabview');
});
// \OCP\Util::addStyle('files_sharing', 'sharetabview');
\OC::$server->getActivityManager()->registerExtension(function () {
    return new \OCA\Files_Sharing\Activity(\OC::$server->query('L10NFactory'), \OC::$server->getURLGenerator(), \OC::$server->getActivityManager());
});
$config = \OC::$server->getConfig();
if ($config->getAppValue('core', 'shareapi_enabled', 'yes') === 'yes') {
    \OCA\Files\App::getNavigationManager()->add(array("id" => 'sharingin', "appname" => 'files_sharing', "script" => 'list.php', "order" => 10, "name" => $l->t('Shared with you')));
    if (\OCP\Util::isSharingDisabledForUser() === false) {
        \OCA\Files\App::getNavigationManager()->add(array("id" => 'sharingout', "appname" => 'files_sharing', "script" => 'list.php', "order" => 15, "name" => $l->t('Shared with others')));
        // Check if sharing by link is enabled
        if ($config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes') {
            \OCA\Files\App::getNavigationManager()->add(array("id" => 'sharinglinks', "appname" => 'files_sharing', "script" => 'list.php', "order" => 20, "name" => $l->t('Shared by link')));
        }
    }
예제 #19
0
 /**
  *@PublicPage
  * @NoCSRFRequired
  * @UseSession
  */
 public function index($token)
 {
     if ($token) {
         $linkItem = Share::getShareByToken($token, false);
         if (is_array($linkItem) && isset($linkItem['uid_owner'])) {
             if ($linkItem['item_type'] === CalendarApp::SHARECALENDAR) {
                 $sPrefix = CalendarApp::SHARECALENDARPREFIX;
             }
             if ($linkItem['item_type'] === CalendarApp::SHAREEVENT) {
                 $sPrefix = CalendarApp::SHAREEVENTPREFIX;
             }
             $itemSource = CalendarApp::validateItemSource($linkItem['item_source'], $sPrefix);
             $itemType = $linkItem['item_type'];
             $shareOwner = $linkItem['uid_owner'];
             $calendarName = $linkItem['item_target'];
             $rootLinkItem = \OCP\Share::resolveReShare($linkItem);
             // stupid copy and paste job
             if (isset($linkItem['share_with'])) {
                 // Authenticate share_with
                 $password = $this->params('password');
                 if (isset($password)) {
                     if ($linkItem['share_type'] == \OCP\Share::SHARE_TYPE_LINK) {
                         // Check Password
                         $newHash = '';
                         if (\OC::$server->getHasher()->verify($password, $linkItem['share_with'], $newHash)) {
                             $this->session->set('public_link_authenticated', $linkItem['id']);
                             if (!empty($newHash)) {
                             }
                         } else {
                             \OCP\Util::addStyle('files_sharing', 'authenticate');
                             $params = array('wrongpw' => true);
                             return new TemplateResponse('files_sharing', 'authenticate', $params, 'guest');
                         }
                     } else {
                         \OCP\Util::writeLog('share', 'Unknown share type ' . $linkItem['share_type'] . ' for share id ' . $linkItem['id'], \OCP\Util::ERROR);
                         return false;
                     }
                 } else {
                     // Check if item id is set in session
                     if (!$this->session->exists('public_link_authenticated') || $this->session->get('public_link_authenticated') !== $linkItem['id']) {
                         // Prompt for password
                         \OCP\Util::addStyle('files_sharing', 'authenticate');
                         $params = array();
                         return new TemplateResponse('files_sharing', 'authenticate', $params, 'guest');
                     }
                 }
             }
             if ($itemType === CalendarApp::SHARECALENDAR) {
                 \OCP\Util::addStyle($this->appName, '3rdparty/fullcalendar');
                 \OCP\Util::addStyle($this->appName, "3rdparty/chosen");
                 \OCP\Util::addStyle($this->appName, '3rdparty/fontello/css/animation');
                 \OCP\Util::addStyle($this->appName, '3rdparty/fontello/css/fontello');
                 \OCP\Util::addStyle($this->appName, '3rdparty/jquery.webui-popover');
                 \OCP\Util::addStyle($this->appName, 'style');
                 \OCP\Util::addStyle($this->appName, 'share');
                 \OCP\Util::addScript($this->appName, '3rdparty/jstz-1.0.4.min');
                 \OCP\Util::addScript($this->appName, '3rdparty/fullcalendar');
                 \OCP\Util::addScript($this->appName, 'jquery.scrollTo.min');
                 \OCP\Util::addScript($this->appName, 'timepicker');
                 \OCP\Util::addScript($this->appName, "3rdparty/jquery.webui-popover");
                 \OCP\Util::addScript($this->appName, "3rdparty/chosen.jquery.min");
                 \OCP\Util::addScript($this->appName, 'jquery.nicescroll.min');
                 \OCP\Util::addScript($this->appName, 'share');
                 \OCP\Util::addScript($this->appName, 'share.config');
                 $timezone = \OC::$server->getSession()->get('public_link_timezone');
                 $webcalUrl = \OC::$server->getRequest()->getRequestUri();
                 //\OCP\Util::writeLog($this->appName,'PUBLIC FOUND'.$timezone, \OCP\Util::DEBUG);
                 $params = ['timezone' => $timezone, 'webcallink' => 'webcal:/' . $webcalUrl . '&webcal', 'uidOwner' => $shareOwner, 'timezones' => \DateTimeZone::listIdentifiers(), 'calendarName' => $calendarName, 'displayName' => \OCP\User::getDisplayName($shareOwner), 'sharingToken' => $token];
                 $response = new TemplateResponse($this->appName, 'public', $params, 'base');
                 return $response;
             }
             if ($itemType === CalendarApp::SHAREEVENT) {
                 \OCP\Util::addStyle($this->appName, '3rdparty/fontello/css/fontello');
                 \OCP\Util::addStyle($this->appName, 'style');
                 \OCP\Util::addStyle($this->appName, 'share');
                 \OCP\Util::addScript($this->appName, 'share');
                 return $this->getPublicEvent($itemSource, $shareOwner, $token);
             }
         }
         //end isset
     }
     //end token
     $params = [];
     $response = new TemplateResponse('core', '404', $params, 'guest');
     return $response;
 }
예제 #20
0
파일: main.php 프로젝트: Graf-Zahl/music
\OCP\Util::addScript('music', 'vendor/restangular/dist/restangular.min');
\OCP\Util::addScript('music', 'vendor/angular-gettext/dist/angular-gettext.min');
\OCP\Util::addScript('music', 'vendor/aurora/aurora');
\OCP\Util::addScript('music', 'vendor/aurora/flac');
\OCP\Util::addScript('music', 'vendor/aurora/mp3');
\OCP\Util::addScript('music', 'public/app');
\OCP\Util::addStyle('music', 'style-controls');
\OCP\Util::addStyle('music', 'style-sidebar');
\OCP\Util::addStyle('music', 'style');
\OCP\Util::addStyle('music', 'mobile');
\OCP\Util::addStyle('music', 'tablet');
// stylesheets for different OC versions
$version = \OCP\Util::getVersion();
// owncloud 6
if ($version[0] === 6 || $version[0] === 5 && $version[1] >= 80) {
    \OCP\Util::addStyle('music', 'stable6-fixes');
}
?>


<div id="app" ng-app="Music" ng-cloak ng-init="started = false; lang = '<?php 
p($_['lang']);
?>
'">

	<script type="text/ng-template" id="overview.html">
		<?php 
print_unescaped($this->inc('partials/overview'));
?>
	</script>
예제 #21
0
<?php

/**
 * ownCloud - user_permission
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the COPYING file.
 *
 * @author Dino Peng <*****@*****.**>
 * @copyright Dino Peng 2015
 */
namespace OCA\User_Permission\AppInfo;

$app = new Application();
$app->getContainer()->query('UserHooks')->register();
\OCP\Util::addScript('user_permission', 'permission');
\OCP\Util::addStyle('user_permission', "style");
예제 #22
0
파일: public.php 프로젝트: hjimmy/owncloud
    $tmpl->printPage();
    exit;
}
if (isset($_GET['t'])) {
    $token = $_GET['t'];
    $tmpl = new \OCP\Template('documents', 'public', 'guest');
    try {
        $file = File::getByShareToken($token);
        if ($file->isPasswordProtected() && !$file->checkPassword(@$_POST['password'])) {
            if (isset($_POST['password'])) {
                $tmpl->assign('wrongpw', true);
            }
            $tmpl->assign('hasPassword', true);
        } else {
            \OCP\Util::addStyle('documents', '3rdparty/webodf/dojo-app');
            \OCP\Util::addStyle('documents', '3rdparty/webodf/editor');
            \OCP\Util::addScript('documents', 'documents');
            if ($file->getFileId()) {
                $session = new Db_Session();
                $session->loadBy('file_id', $file->getFileId());
                if ($session->getEsId()) {
                    $member = new Db_Member();
                    $members = $member->getCollectionBy('es_id', $session->getEsId());
                } else {
                    $members = 0;
                }
                $tmpl->assign('total', count($members) + 1);
            } else {
                $tmpl->assign('total', 1);
            }
            $tmpl->assign('document', $token);
예제 #23
0
파일: app.php 프로젝트: loulancn/core
<?php

/**
 * @author Björn Schießle <*****@*****.**>
 * @author Frank Karlitschek <*****@*****.**>
 * @author Victor Dubiniuk <*****@*****.**>
 *
 * @copyright Copyright (c) 2015, 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/>
 *
 */
\OCP\Util::addStyle('files_versions', 'versions');
\OCA\Files_Versions\Hooks::connectHooks();
예제 #24
0
 * 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/>.
 */

// This script we have to wrap in a class to pretend it to override t()
// and possibly other functions or variables. See below.
//\OCP\Util::addScript('secure_container', '3rdparty/sjcl/sjcl');

\OCP\Util::addScript('secure_container', 'container');
\OCP\Util::addScript('secure_container', 'navigation');
\OCP\Util::addScript('secure_container', 'app');

\OCP\Util::addStyle('secure_container', 'style');
$l = \OC_L10N::get('secure_container');
?>

<script type="text/javascript" src="<?php p(\OCP\Util::linkToAbsolute('secure_container', 'js/3rdparty/jswrapper.php', array('app'=> 'sjcl'))); ?>"></script>
<div id="app-navigation">
	<ul class="level-0 path-childs" id="path-childs-0">
		<?php foreach ($_['navigation'] as $k => $path): ?>
		<?php print_unescaped($this->inc('pathentry', array('path' => $path, 'level'=> 1))); ?>
		<?php endforeach; ?>
	</ul>
</div>

<main id="app-content">
	<div id="controls">
		<nav class="breadcrumb">
예제 #25
0
파일: index.php 프로젝트: eottone/documents
 * 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/>.
 * 
 */
namespace OCA\Documents;

\OCP\User::checkLoggedIn();
\OCP\JSON::checkAppEnabled('documents');
\OCP\App::setActiveNavigationEntry('documents_index');
\OCP\Util::addStyle('documents', 'style');
\OCP\Util::addStyle('documents', '3rdparty/webodf/dojo-app');
\OCP\Util::addScript('documents', 'documents');
\OCP\Util::addScript('files', 'file-upload');
\OCP\Util::addScript('files', 'jquery.iframe-transport');
\OCP\Util::addScript('files', 'jquery.fileupload');
$tmpl = new \OCP\Template('documents', 'documents', 'user');
$previewsEnabled = \OC::$server->getConfig()->getSystemValue('enable_previews', true);
$unstable = \OCP\Config::getAppValue('documents', 'unstable', 'false');
$maxUploadFilesize = \OCP\Util::maxUploadFilesize("/");
$savePath = \OCP\Config::getUserValue(\OCP\User::getUser(), 'documents', 'save_path', '/');
$tmpl->assign('enable_previews', $previewsEnabled);
$tmpl->assign('useUnstable', $unstable);
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign('uploadMaxHumanFilesize', \OCP\Util::humanFileSize($maxUploadFilesize));
$tmpl->assign('savePath', $savePath);
$tmpl->assign("allowShareWithLink", \OC_Appconfig::getValue('core', 'shareapi_allow_links', 'yes'));
예제 #26
0
<?php

\OCP\Util::addStyle('polls', 'main');
\OCP\Util::addScript('polls', 'select_dates');
$arr = explode("\n", $desc);
?>
<table>
	<tr>
	<th class="cl_title" rowspan="<?php 
count($arr);
?>
"><em><div id="id_title"><?php 
echo $title;
?>
</div></em></th>

	<tr>
		<th class="wordwrap"><em><div id="id_descr"><?php 
echo $desc;
?>
</div></em></th>
	</tr>
</table>

<table id="id_table_1">
	<tr>
       <td><h2><?php 
p($l->t('Click on days to add or remove'));
?>
</h2></td>
       <td><h2><?php 
예제 #27
0
파일: content.php 프로젝트: AdamWill/apps
* 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/>.
*
*/
/**
 * @file content.php
 * Content of the imprint as configured
 * @access public
 */
// Session checks
// \OCP\User::checkLoggedIn();
\OCP\App::checkAppEnabled('imprint');
// prepare content
if (FALSE === ($content = \OCP\Config::getAppValue('imprint', 'content', FALSE))) {
    $tmpl = new \OCP\Template('imprint', 'tmpl_dummy');
    \OCP\Util::addStyle('imprint', 'reference');
} else {
    // detect type of stored content and process accordingly
    if (strlen($content) != strlen(strip_tags($content))) {
        $processed_content = $content;
    } else {
        $processed_content = sprintf("<pre>\n%s\n</pre>", $content);
    }
    // output processed content
    \OCP\Util::addStyle('imprint', 'content');
    $tmpl = new \OCP\Template('imprint', 'tmpl_content');
    $tmpl->assign('processed-content', $processed_content);
}
// render template
$tmpl->printPage();
예제 #28
0
파일: settings.php 프로젝트: AdamWill/apps
*
* 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/>.
*
*/
/**
 * @file settings.php
 * This apps system settings dialog
 * The dialog will be included in the general framework of the system settings page
 * @access public
 * @author Christian Reiner
 */
// Session checks
\OCP\User::checkLoggedIn();
\OCP\User::checkAdminUser();
\OCP\App::checkAppEnabled('imprint');
\OCP\Util::addStyle('3rdparty', 'chosen/chosen');
\OCP\Util::addStyle('imprint', 'settings');
\OCP\Util::addStyle('imprint', 'reference');
\OCP\Util::addScript('3rdparty', 'chosen/chosen.jquery.min');
\OCP\Util::addScript('imprint', 'settings');
// fetch template
$tmpl = new \OCP\Template('imprint', 'tmpl_settings');
// render template
return $tmpl->fetchPage();
예제 #29
0
<?php

/**
 * Copyright (c) 2014 - Arno van Rossum <*****@*****.**>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
OCP\App::checkAppEnabled('ocusagecharts');
OCP\App::setActiveNavigationEntry('ocusagecharts');
OCP\App::addNavigationEntry(array('id' => 'ocusagecharts', 'order' => 60, 'href' => \OCP\Util::linkToRoute('ocusagecharts.chart.frontpage'), 'icon' => OCP\Util::imagePath('ocusagecharts', 'iconchart.png'), 'name' => \OC_L10N::get('ocusagecharts')->t('ocUsageCharts')));
\OCP\Util::addStyle('ocusagecharts', 'style');
\OCP\Backgroundjob::registerJob('OCA\\ocUsageCharts\\Command\\UpdateChartsCommand');
 /**
  * Load additional scripts when the files app is visible
  */
 public static function onLoadFilesAppScripts()
 {
     Util::addStyle('activity', 'style');
     Util::addScript('activity', 'activitymodel');
     Util::addScript('activity', 'activitycollection');
     Util::addScript('activity', 'activitytabview');
     Util::addScript('activity', 'filesplugin');
 }