Пример #1
0
 public function display($post)
 {
     $defaults = array('adminlogin' => '', 'adminpass' => '', 'dbuser' => '', 'dbpass' => '', 'dbname' => '', 'dbtablespace' => '', 'dbhost' => 'localhost', 'dbtype' => '');
     $parameters = array_merge($defaults, $post);
     \OC_Util::addScript('3rdparty', 'strengthify/jquery.strengthify');
     \OC_Util::addStyle('3rdparty', 'strengthify/strengthify');
     \OC_Util::addScript('setup');
     \OC_Template::printGuestPage('', 'installation', $parameters);
 }
Пример #2
0
/**
 * Shortcut for adding styles to a page
 * @param string $app the appname
 * @param string|string[] $file the filename,
 * if an array is given it will add all styles
 */
function style($app, $file)
{
    if (is_array($file)) {
        foreach ($file as $f) {
            OC_Util::addStyle($app, $f);
        }
    } else {
        OC_Util::addStyle($app, $file);
    }
}
Пример #3
0
 /**
  * Register a sharing backend class that implements OCP\Share_Backend for an item type
  * @param string $itemType Item type
  * @param string $class Backend class
  * @param string $collectionOf (optional) Depends on item type
  * @param array $supportedFileExtensions (optional) List of supported file extensions if this item type depends on files
  * @return boolean true if backend is registered or false if error
  */
 public static function registerBackend($itemType, $class, $collectionOf = null, $supportedFileExtensions = null)
 {
     if (self::isEnabled()) {
         if (!isset(self::$backendTypes[$itemType])) {
             self::$backendTypes[$itemType] = array('class' => $class, 'collectionOf' => $collectionOf, 'supportedFileExtensions' => $supportedFileExtensions);
             if (count(self::$backendTypes) === 1) {
                 \OC_Util::addScript('core', 'share');
                 \OC_Util::addStyle('core', 'share');
             }
             return true;
         }
         \OC_Log::write('OCP\\Share', 'Sharing backend ' . $class . ' not registered, ' . self::$backendTypes[$itemType]['class'] . ' is already registered for ' . $itemType, \OC_Log::WARN);
     }
     return false;
 }
Пример #4
0
 public static function initTemplateEngine()
 {
     // Add the stuff we need always
     OC_Util::addScript("jquery-1.7.2.min");
     OC_Util::addScript("jquery-ui-1.8.16.custom.min");
     OC_Util::addScript("jquery-showpassword");
     OC_Util::addScript("jquery.infieldlabel");
     OC_Util::addScript("jquery-tipsy");
     OC_Util::addScript("oc-dialogs");
     OC_Util::addScript("js");
     OC_Util::addScript("eventsource");
     OC_Util::addScript("config");
     //OC_Util::addScript( "multiselect" );
     OC_Util::addScript('search', 'result');
     OC_Util::addScript('router');
     if (OC_Config::getValue('installed', false)) {
         if (OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax') == 'ajax') {
             OC_Util::addScript('backgroundjobs');
         }
     }
     OC_Util::addStyle("styles");
     OC_Util::addStyle("multiselect");
     OC_Util::addStyle("jquery-ui-1.8.16.custom");
     OC_Util::addStyle("jquery-tipsy");
 }
Пример #5
0
 public static function initTemplateEngine()
 {
     // Add the stuff we need always
     // following logic will import all vendor libraries that are
     // specified in core/js/core.json
     $fileContent = file_get_contents(OC::$SERVERROOT . '/core/js/core.json');
     if ($fileContent !== false) {
         $coreDependencies = json_decode($fileContent, true);
         foreach ($coreDependencies['vendor'] as $vendorLibrary) {
             // remove trailing ".js" as addVendorScript will append it
             OC_Util::addVendorScript(substr($vendorLibrary, 0, strlen($vendorLibrary) - 3));
         }
     } else {
         throw new \Exception('Cannot read core/js/core.json');
     }
     OC_Util::addScript("placeholders");
     OC_Util::addScript("compatibility");
     OC_Util::addScript("jquery.ocdialog");
     OC_Util::addScript("oc-dialogs");
     OC_Util::addScript("js");
     OC_Util::addScript("l10n");
     OC_Util::addTranslations("core");
     OC_Util::addScript("octemplate");
     OC_Util::addScript("eventsource");
     OC_Util::addScript("config");
     OC_Util::addScript('search', 'search');
     OC_Util::addScript("oc-requesttoken");
     OC_Util::addScript("apps");
     OC_Util::addScript('mimetype');
     OC_Util::addScript('mimetypelist');
     OC_Util::addVendorScript('snapjs/dist/latest/snap');
     OC_Util::addVendorScript('core', 'backbone/backbone');
     OC_Util::addScript('oc-backbone');
     // avatars
     if (\OC::$server->getSystemConfig()->getValue('enable_avatars', true) === true) {
         \OC_Util::addScript('placeholder');
         \OC_Util::addVendorScript('blueimp-md5/js/md5');
         \OC_Util::addScript('jquery.avatar');
         \OC_Util::addScript('avatar');
     }
     OC_Util::addStyle("styles");
     OC_Util::addStyle("header");
     OC_Util::addStyle("mobile");
     OC_Util::addStyle("icons");
     OC_Util::addStyle("fonts");
     OC_Util::addStyle("apps");
     OC_Util::addStyle("fixes");
     OC_Util::addStyle("multiselect");
     OC_Util::addVendorStyle('jquery-ui/themes/base/jquery-ui');
     OC_Util::addStyle('jquery-ui-fixes');
     OC_Util::addStyle("tooltip");
     OC_Util::addStyle("jquery.ocdialog");
 }
* @author Arthur Schiwon
* @copyright 2011 Arthur Schiwon blizzz@arthur-schiwon.de
* 
* This library is free software; you can redistribute it and/or
* 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 Lesser General Public 
* License along with this library.  If not, see <http://www.gnu.org/licenses/>.
* 
*/
require_once '../../lib/base.php';
// Check if we are a user
OC_Util::checkLoggedIn();
OC_Util::checkAppEnabled('bookmarks');
require_once 'bookmarksHelper.php';
OC_App::setActiveNavigationEntry('bookmarks_index');
OC_Util::addScript('bookmarks', 'addBm');
OC_Util::addStyle('bookmarks', 'bookmarks');
$tmpl = new OC_Template('bookmarks', 'addBm', 'user');
$url = isset($_GET['url']) ? urldecode($_GET['url']) : '';
$metadata = getURLMetadata($url);
$tmpl->assign('URL', htmlentities($metadata['url']));
$tmpl->assign('TITLE', htmlentities($metadata['title']));
$tmpl->printPage();
Пример #7
0
 public static function initSession()
 {
     // prevents javascript from accessing php session cookies
     ini_set('session.cookie_httponly', '1;');
     // set the session name to the instance id - which is unique
     session_name(OC_Util::getInstanceId());
     // if session cant be started break with http 500 error
     if (session_start() === false) {
         OC_Log::write('core', 'Session could not be initialized', OC_Log::ERROR);
         header('HTTP/1.1 500 Internal Server Error');
         OC_Util::addStyle("styles");
         $error = 'Session could not be initialized. Please contact your ';
         $error .= 'system administrator';
         $tmpl = new OC_Template('', 'error', 'guest');
         $tmpl->assign('errors', array(1 => array('error' => $error)));
         $tmpl->printPage();
         exit;
     }
     $sessionLifeTime = self::getSessionLifeTime();
     // regenerate session id periodically to avoid session fixation
     if (!isset($_SESSION['SID_CREATED'])) {
         $_SESSION['SID_CREATED'] = time();
     } else {
         if (time() - $_SESSION['SID_CREATED'] > $sessionLifeTime / 2) {
             session_regenerate_id(true);
             $_SESSION['SID_CREATED'] = time();
         }
     }
     // session timeout
     if (isset($_SESSION['LAST_ACTIVITY']) && time() - $_SESSION['LAST_ACTIVITY'] > $sessionLifeTime) {
         if (isset($_COOKIE[session_name()])) {
             setcookie(session_name(), '', time() - 42000, '/');
         }
         session_unset();
         session_destroy();
         session_start();
     }
     $_SESSION['LAST_ACTIVITY'] = time();
 }
 *
 * 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/>.
 *
 */
// Init owncloud
require_once '../lib/base.php';
// Check if we are a user
OC_Util::checkLoggedIn();
// Load the files we need
OC_Util::addStyle("files", "files");
OC_Util::addScript("files", "files");
OC_Util::addScript('files', 'filelist');
OC_Util::addScript('files', 'fileactions');
if (!isset($_SESSION['timezone'])) {
    OC_Util::addScript('files', 'timezone');
}
OC_App::setActiveNavigationEntry("files_index");
// Load the files
$dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : '';
// Redirect if directory does not exist
if (!OC_Filesystem::is_dir($dir . '/')) {
    header("Location: " . $_SERVER['PHP_SELF'] . "");
}
$files = array();
foreach (OC_Files::getdirectorycontent($dir) as $i) {
Пример #9
0
<?php

//load the required files
OC_Util::addStyle('files_sgfviewer', 'player');
OC_Util::addScript('files_sgfviewer', 'all.compressed');
OC_Util::addScript('files_sgfviewer', 'viewer');
Пример #10
0
<?php

// Init owncloud
require_once '../../lib/base.php';
OC_Util::checkLoggedIn();
OC_Util::checkAppEnabled('files_svgedit');
// load required style sheets:
OC_Util::addStyle('files_svgedit', 'ocsvg');
// load required javascripts:
OC_Util::addScript('files_svgedit', 'svg-edit/embedapi');
OC_Util::addScript('files_svgedit', 'ocsvgEditor');
OC_Util::addScript('files_svgedit', 'canvg/canvg');
OC_Util::addScript('files_svgedit', 'canvg/rgbcolor');
OC_Util::addScript('files_svgedit', 'base64');
//OC_Util::addScript('files_svgedit', 'jsPDF/libs/sprintf');
//OC_Util::addScript('files_svgedit', 'jsPDF/jspdf');
OC_Util::addScript('files_svgedit', 'jsPDF/jspdf.min');
OC_Util::addScript('files_svgedit', 'svgToPdf');
OC_App::setActiveNavigationEntry('files_index');
$path = $_GET['file'];
if (method_exists('OC_Filesystem', 'is_writable')) {
    $writable = OC_Filesystem::is_writable($path);
} else {
    $writable = OC_Filesystem::is_writeable($path);
}
if (isset($_GET['file']) and $writable) {
    $filecontents = OC_Filesystem::file_get_contents($path);
    $filemtime = OC_Filesystem::filemtime($path);
} else {
    $filecontents = "";
    $filemtime = 0;
Пример #11
0
<?php

OC_Util::addStyle('tattoo', 'settings');
// die($_POST['tattooWallpaper']);
if (isset($_POST['tattooSetWallpaper']) && isset($_POST['tattooWallpaper'])) {
    OC_Preferences::setValue(OC_User::getUser(), 'tattoo', 'wallpaper', $_POST['tattooWallpaper']);
    OC_Preferences::setValue(OC_User::getUser(), 'tattoo', 'lastModified', gmdate('D, d M Y H:i:s') . ' GMT');
}
$wallpaper = OC_Preferences::getValue(OC_User::getUser(), 'tattoo', 'wallpaper', 'none');
$tmpl = new OC_Template('tattoo', 'settings');
$tmpl->assign('tattooSelectedWallpaper', $wallpaper);
return $tmpl->fetchPage();
Пример #12
0
*
* 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/>.
*
*/
// Init owncloud
require_once '../lib/base.php';
// Check if we are a user
OC_Util::checkLoggedIn();
// Load the files we need
OC_Util::addStyle('search', 'search');
$query = isset($_POST['query']) ? $_POST['query'] : '';
if ($query) {
    $results = OC_Search::search($query);
} else {
    OC_Util::redirectToDefaultPage();
}
$resultTypes = array();
foreach ($results as $result) {
    if (!isset($resultTypes[$result->type])) {
        $resultTypes[$result->type] = array();
    }
    $resultTypes[$result->type][] = $result;
}
$tmpl = new OC_Template('search', 'index', 'user');
$tmpl->assign('resultTypes', $resultTypes);
Пример #13
0
 public static function initTemplateEngine()
 {
     // if the formfactor is not yet autodetected do the autodetection now. For possible forfactors check the detectFormfactor documentation
     if (!isset($_SESSION['formfactor'])) {
         $_SESSION['formfactor'] = OC::detectFormfactor();
     }
     // allow manual override via GET parameter
     if (isset($_GET['formfactor'])) {
         $_SESSION['formfactor'] = $_GET['formfactor'];
     }
     // Add the stuff we need always
     OC_Util::addScript("jquery-1.7.2.min");
     OC_Util::addScript("jquery-ui-1.8.16.custom.min");
     OC_Util::addScript("jquery-showpassword");
     OC_Util::addScript("jquery.infieldlabel.min");
     OC_Util::addScript("jquery-tipsy");
     OC_Util::addScript("oc-dialogs");
     OC_Util::addScript("js");
     OC_Util::addScript("eventsource");
     OC_Util::addScript("config");
     //OC_Util::addScript( "multiselect" );
     OC_Util::addScript('search', 'result');
     OC_Util::addStyle("styles");
     OC_Util::addStyle("multiselect");
     OC_Util::addStyle("jquery-ui-1.8.16.custom");
     OC_Util::addStyle("jquery-tipsy");
 }
* 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 Lesser General Public 
* License along with this library.  If not, see <http://www.gnu.org/licenses/>.
* 
*/
require_once '../../lib/base.php';
// Check if we are a user
OC_Util::checkLoggedIn();
OC_Util::checkAppEnabled('media');
require_once 'lib_collection.php';
require_once 'lib_scanner.php';
OC_Util::addScript('media', 'player');
OC_Util::addScript('media', 'music');
OC_Util::addScript('media', 'playlist');
OC_Util::addScript('media', 'collection');
OC_Util::addScript('media', 'scanner');
OC_Util::addScript('media', 'jquery.jplayer.min');
OC_Util::addStyle('media', 'music');
OC_App::setActiveNavigationEntry('media_index');
$tmpl = new OC_Template('media', 'music', 'user');
$tmpl->printPage();
?>
 
Пример #15
0
<?php

/**
* ownCloud - Tattoo
*
* @author Arthur Schiwon
* @copyright 2012 Arthur Schiwon blizzz@owncloud.com
*
* This library is free software; you can redistribute it and/or
* 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/>.
*
*/
OC_APP::registerPersonal('tattoo', 'settings');
$wallpaper = OC_Preferences::getValue(OC_User::getUser(), 'tattoo', 'wallpaper', 'none');
if ($wallpaper != 'none') {
    OC_Util::addStyle('tattoo', 'tattoo');
    OC_Util::addScript('tattoo', 'tattoo');
}
Пример #16
0
<?php

OC_Util::checkAdminUser();
OC_Util::addStyle('neurocloud', "nc");
OC_Util::addScript("neurocloud", "admin");
$tmpl = new OC_Template('neurocloud', 'settings');
return $tmpl->fetchPage();
Пример #17
0
 public static function initTemplateEngine()
 {
     // Add the stuff we need always
     // TODO: read from core/js/core.json
     OC_Util::addScript("jquery-1.10.0.min");
     OC_Util::addScript("jquery-migrate-1.2.1.min");
     OC_Util::addScript("jquery-ui-1.10.0.custom");
     OC_Util::addScript("jquery-showpassword");
     OC_Util::addScript("placeholders");
     OC_Util::addScript("jquery-tipsy");
     OC_Util::addScript("compatibility");
     OC_Util::addScript("underscore");
     OC_Util::addScript("jquery.ocdialog");
     OC_Util::addScript("oc-dialogs");
     OC_Util::addScript("js");
     OC_Util::addScript("octemplate");
     OC_Util::addScript("eventsource");
     OC_Util::addScript("config");
     //OC_Util::addScript( "multiselect" );
     OC_Util::addScript('search', 'result');
     OC_Util::addScript("oc-requesttoken");
     OC_Util::addScript("apps");
     OC_Util::addScript("snap");
     OC_Util::addScript("moment");
     // avatars
     if (\OC_Config::getValue('enable_avatars', true) === true) {
         \OC_Util::addScript('placeholder');
         \OC_Util::addScript('3rdparty', 'md5/md5.min');
         \OC_Util::addScript('jquery.avatar');
         \OC_Util::addScript('avatar');
     }
     OC_Util::addStyle("styles");
     OC_Util::addStyle("header");
     OC_Util::addStyle("mobile");
     OC_Util::addStyle("icons");
     OC_Util::addStyle("fonts");
     OC_Util::addStyle("apps");
     OC_Util::addStyle("fixes");
     OC_Util::addStyle("multiselect");
     OC_Util::addStyle("jquery-ui-1.10.0.custom");
     OC_Util::addStyle("jquery-tipsy");
     OC_Util::addStyle("jquery.ocdialog");
 }
Пример #18
0
 /**
  * Register a sharing backend class that implements OCP\Share_Backend for an item type
  * @param string $itemType Item type
  * @param string $class Backend class
  * @param string $collectionOf (optional) Depends on item type
  * @param array $supportedFileExtensions (optional) List of supported file extensions if this item type depends on files
  * @return boolean true if backend is registered or false if error
  */
 public static function registerBackend($itemType, $class, $collectionOf = null, $supportedFileExtensions = null)
 {
     if (self::isEnabled()) {
         if (!isset(self::$backendTypes[$itemType])) {
             self::$backendTypes[$itemType] = array('class' => $class, 'collectionOf' => $collectionOf, 'supportedFileExtensions' => $supportedFileExtensions);
             if (count(self::$backendTypes) === 1) {
                 \OC_Util::addScript('core', 'shareconfigmodel');
                 \OC_Util::addScript('core', 'shareitemmodel');
                 \OC_Util::addScript('core', 'sharedialogresharerinfoview');
                 \OC_Util::addScript('core', 'sharedialoglinkshareview');
                 \OC_Util::addScript('core', 'sharedialogmailview');
                 \OC_Util::addScript('core', 'sharedialogexpirationview');
                 \OC_Util::addScript('core', 'sharedialogshareelistview');
                 \OC_Util::addScript('core', 'sharedialogview');
                 \OC_Util::addScript('core', 'share');
                 \OC_Util::addStyle('core', 'share');
             }
             return true;
         }
         \OCP\Util::writeLog('OCP\\Share', 'Sharing backend ' . $class . ' not registered, ' . self::$backendTypes[$itemType]['class'] . ' is already registered for ' . $itemType, \OCP\Util::WARN);
     }
     return false;
 }
Пример #19
0
<?php

/**
* ownCloud - Compress plugin
*
* @author Xavier Beurois
* @copyright 2012 Xavier Beurois www.djazz-lab.net
* 
* This library is free software; you can redistribute it and/or
* 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 Lesser General Public 
* License along with this library.  If not, see <http://www.gnu.org/licenses/>.
* 
*/
$app_id = 'compress';
OC_Util::checkAppEnabled($app_id);
OC_App::register(array('order' => 70, 'id' => $app_id, 'name' => ucfirst($app_id)));
OC_Util::addScript($app_id, 'actlink.min');
OC_Util::addScript('3rdparty', 'chosen/chosen.jquery.min');
OC_Util::addStyle('3rdparty', 'chosen/chosen');
if (!OC_App::isEnabled('files_sharing')) {
    OC_Util::addStyle($app_id, 'styles');
}
Пример #20
0
 * This file is licensed under the Affero General Public License version 3 or later.
 * See the COPYING-README file.
 */
OC_Util::checkLoggedIn();
OC_App::loadApps();
$defaults = new OC_Defaults();
// initialize themable default strings and urls
// Highlight navigation entry
OC_Util::addScript('settings', 'personal');
OC_Util::addStyle('settings', 'settings');
OC_Util::addScript('3rdparty', 'chosen/chosen.jquery.min');
OC_Util::addStyle('3rdparty', 'chosen');
\OC_Util::addScript('files', 'jquery.fileupload');
if (\OC_Config::getValue('enable_avatars', true) === true) {
    \OC_Util::addScript('3rdparty/Jcrop', 'jquery.Jcrop.min');
    \OC_Util::addStyle('3rdparty/Jcrop', 'jquery.Jcrop.min');
}
OC_App::setActiveNavigationEntry('personal');
$storageInfo = OC_Helper::getStorageInfo('/');
$email = OC_Preferences::getValue(OC_User::getUser(), 'settings', 'email', '');
$userLang = OC_Preferences::getValue(OC_User::getUser(), 'core', 'lang', OC_L10N::findLanguage());
$languageCodes = OC_L10N::findAvailableLanguages();
//check if encryption was enabled in the past
$enableDecryptAll = OC_Util::encryptedFiles();
// array of common languages
$commonlangcodes = array('en', 'es', 'fr', 'de', 'de_DE', 'ja_JP', 'ar', 'ru', 'nl', 'it', 'pt_BR', 'pt_PT', 'da', 'fi_FI', 'nb_NO', 'sv', 'zh_CN', 'ko');
$languageNames = (include 'languageCodes.php');
$languages = array();
$commonlanguages = array();
foreach ($languageCodes as $lang) {
    $l = OC_L10N::get('settings', $lang);
Пример #21
0
* 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 Lesser General Public
* License along with this library.  If not, see <http://www.gnu.org/licenses/>.
*
*/
OC_Util::addStyle('ocdownloader', 'styles');
OC_Util::addScript('3rdparty', 'chosen/chosen.jquery.min');
OC_Util::addStyle('3rdparty', 'chosen');
OC_Util::addScript('ocdownloader', 'functions');
?>

<div id="ocdownloader">
	<div class="personalblock topblock titleblock">
		ocDownloader
	</div>
	<?php 
if (isset($_['curl_error'])) {
    ?>
	<div class="personalblock red">
		<?php 
    print $_['curl_error'];
    ?>
	</div>
<?php

require_once 'apps/files_sharing/sharedstorage.php';
OC::$CLASSPATH['OC_Share'] = "apps/files_sharing/lib_share.php";
OC_Hook::connect("OC_Filesystem", "post_delete", "OC_Share", "deleteItem");
OC_Hook::connect("OC_Filesystem", "post_rename", "OC_Share", "renameItem");
OC_Filesystem::registerStorageType("shared", "OC_Filestorage_Shared", array("datadir" => "string"));
OC_Util::addScript("files_sharing", "share");
OC_Util::addScript("3rdparty", "chosen/chosen.jquery.min");
OC_Util::addStyle('files_sharing', 'sharing');
OC_Util::addStyle("3rdparty", "chosen/chosen");
Пример #23
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/>
 *
 */
OC_Util::checkLoggedIn();
// Load the files we need
OC_Util::addStyle("settings", "settings");
\OC::$server->getNavigationManager()->setActiveEntry('help');
if (isset($_GET['mode']) and $_GET['mode'] === 'admin') {
    $url = \OCP\Util::linkToAbsolute('core', 'doc/admin/index.html');
    $style1 = '';
    $style2 = ' active';
} else {
    $url = \OCP\Util::linkToAbsolute('core', 'doc/user/index.html');
    $style1 = ' active';
    $style2 = '';
}
$url1 = \OC::$server->getURLGenerator()->linkToRoute('settings_help') . '?mode=user';
$url2 = \OC::$server->getURLGenerator()->linkToRoute('settings_help') . '?mode=admin';
$tmpl = new OC_Template("settings", "help", "user");
$tmpl->assign("admin", OC_User::isAdminUser(OC_User::getUser()));
$tmpl->assign("url", $url);
Пример #24
0
 public static function initTemplateEngine()
 {
     // Add the stuff we need always
     OC_Util::addScript("jquery-1.7.2.min");
     OC_Util::addScript("jquery-ui-1.8.16.custom.min");
     OC_Util::addScript("jquery-showpassword");
     OC_Util::addScript("jquery.infieldlabel.min");
     OC_Util::addScript("jquery-tipsy");
     OC_Util::addScript("oc-dialogs");
     OC_Util::addScript("js");
     // request protection token MUST be defined after the jquery library but before any $('document').ready()
     OC_Util::addScript("requesttoken");
     OC_Util::addScript("eventsource");
     OC_Util::addScript("config");
     //OC_Util::addScript( "multiselect" );
     OC_Util::addScript('search', 'result');
     if (OC_Config::getValue('installed', false)) {
         if (OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax') == 'ajax') {
             OC_Util::addScript('backgroundjobs');
         }
     }
     OC_Util::addStyle("styles");
     OC_Util::addStyle("multiselect");
     OC_Util::addStyle("jquery-ui-1.8.16.custom");
     OC_Util::addStyle("jquery-tipsy");
 }
Пример #25
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/>
 *
 */
OC_Util::checkLoggedIn();
$defaults = new OC_Defaults();
// initialize themable default strings and urls
$certificateManager = \OC::$server->getCertificateManager();
$config = \OC::$server->getConfig();
$urlGenerator = \OC::$server->getURLGenerator();
// Highlight navigation entry
OC_Util::addScript('settings', 'personal');
OC_Util::addScript('settings', 'certificates');
OC_Util::addStyle('settings', 'settings');
\OC_Util::addVendorScript('strengthify/jquery.strengthify');
\OC_Util::addVendorStyle('strengthify/strengthify');
\OC_Util::addScript('files', 'jquery.iframe-transport');
\OC_Util::addScript('files', 'jquery.fileupload');
if ($config->getSystemValue('enable_avatars', true) === true) {
    \OC_Util::addVendorScript('jcrop/js/jquery.Jcrop');
    \OC_Util::addVendorStyle('jcrop/css/jquery.Jcrop');
}
// Highlight navigation entry
OC::$server->getNavigationManager()->setActiveEntry('personal');
$storageInfo = OC_Helper::getStorageInfo('/');
$user = OC::$server->getUserManager()->get(OC_User::getUser());
$email = $user->getEMailAddress();
$userLang = $config->getUserValue(OC_User::getUser(), 'core', 'lang', OC_L10N::findLanguage());
$languageCodes = OC_L10N::findAvailableLanguages();
Пример #26
0
<?php

/**
 * Copyright (c) 2013 Sam Tuke <*****@*****.**>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */
// Add CSS stylesheet
\OC_Util::addStyle('files_encryption', 'settings-personal');
$tmpl = new OCP\Template('files_encryption', 'settings-personal');
$user = \OCP\USER::getUser();
$view = new \OC\Files\View('/');
$util = new \OCA\Files_Encryption\Util($view, $user);
$session = new \OCA\Files_Encryption\Session($view);
$privateKeySet = $session->getPrivateKey() !== false;
// did we tried to initialize the keys for this session?
$initialized = $session->getInitialized();
$recoveryAdminEnabled = \OC::$server->getAppConfig()->getValue('files_encryption', 'recoveryAdminEnabled');
$recoveryEnabledForUser = $util->recoveryEnabledForUser();
$result = false;
if ($recoveryAdminEnabled || !$privateKeySet) {
    \OCP\Util::addscript('files_encryption', 'settings-personal');
    $tmpl->assign('recoveryEnabled', $recoveryAdminEnabled);
    $tmpl->assign('recoveryEnabledForUser', $recoveryEnabledForUser);
    $tmpl->assign('privateKeySet', $privateKeySet);
    $tmpl->assign('initialized', $initialized);
    $result = $tmpl->fetchPage();
}
return $result;
Пример #27
0
 public static function initTemplateEngine($renderAs)
 {
     if (self::$initTemplateEngineFirstRun) {
         //apps that started before the template initialization can load their own scripts/styles
         //so to make sure this scripts/styles here are loaded first we use OC_Util::addScript() with $prepend=true
         //meaning the last script/style in this list will be loaded first
         if (\OC::$server->getSystemConfig()->getValue('installed', false) && $renderAs !== 'error' && !\OCP\Util::needUpgrade()) {
             if (\OC::$server->getConfig()->getAppValue('core', 'backgroundjobs_mode', 'ajax') == 'ajax') {
                 OC_Util::addScript('backgroundjobs', null, true);
             }
         }
         OC_Util::addStyle("tooltip", null, true);
         OC_Util::addStyle('jquery-ui-fixes', null, true);
         OC_Util::addVendorStyle('jquery-ui/themes/base/jquery-ui', null, true);
         OC_Util::addStyle("multiselect", null, true);
         OC_Util::addStyle("fixes", null, true);
         OC_Util::addStyle("global", null, true);
         OC_Util::addStyle("apps", null, true);
         OC_Util::addStyle("fonts", null, true);
         OC_Util::addStyle("icons", null, true);
         OC_Util::addStyle("mobile", null, true);
         OC_Util::addStyle("header", null, true);
         OC_Util::addStyle("inputs", null, true);
         OC_Util::addStyle("styles", null, true);
         // avatars
         if (\OC::$server->getSystemConfig()->getValue('enable_avatars', true) === true) {
             \OC_Util::addScript('avatar', null, true);
             \OC_Util::addScript('jquery.avatar', null, true);
             \OC_Util::addScript('placeholder', null, true);
         }
         OC_Util::addScript('oc-backbone', null, true);
         OC_Util::addVendorScript('core', 'backbone/backbone', true);
         OC_Util::addVendorScript('snapjs/dist/latest/snap', null, true);
         OC_Util::addScript('mimetypelist', null, true);
         OC_Util::addScript('mimetype', null, true);
         OC_Util::addScript("apps", null, true);
         OC_Util::addScript("oc-requesttoken", null, true);
         OC_Util::addScript('search', 'search', true);
         OC_Util::addScript("config", null, true);
         OC_Util::addScript("eventsource", null, true);
         OC_Util::addScript("octemplate", null, true);
         OC_Util::addTranslations("core", null, true);
         OC_Util::addScript("l10n", null, true);
         OC_Util::addScript("js", null, true);
         OC_Util::addScript("oc-dialogs", null, true);
         OC_Util::addScript("jquery.ocdialog", null, true);
         OC_Util::addStyle("jquery.ocdialog");
         OC_Util::addScript("compatibility", null, true);
         OC_Util::addScript("placeholders", null, true);
         OC_Util::addScript('files/fileinfo');
         OC_Util::addScript('files/client');
         // Add the stuff we need always
         // following logic will import all vendor libraries that are
         // specified in core/js/core.json
         $fileContent = file_get_contents(OC::$SERVERROOT . '/core/js/core.json');
         if ($fileContent !== false) {
             $coreDependencies = json_decode($fileContent, true);
             foreach (array_reverse($coreDependencies['vendor']) as $vendorLibrary) {
                 // remove trailing ".js" as addVendorScript will append it
                 OC_Util::addVendorScript(substr($vendorLibrary, 0, strlen($vendorLibrary) - 3), null, true);
             }
         } else {
             throw new \Exception('Cannot read core/js/core.json');
         }
         if (\OC::$server->getRequest()->isUserAgent([\OC\AppFramework\Http\Request::USER_AGENT_IE])) {
             // shim for the davclient.js library
             \OCP\Util::addScript('files/iedavclient');
         }
         self::$initTemplateEngineFirstRun = false;
     }
 }
Пример #28
0
 public function testAddStyle()
 {
     \OC_Util::addStyle('core', 'myFancyCSSFile1');
     \OC_Util::addStyle('myApp', 'myFancyCSSFile2');
     \OC_Util::addStyle('core', 'myFancyCSSFile0', true);
     \OC_Util::addStyle('core', 'myFancyCSSFile10', true);
     // add duplicate
     \OC_Util::addStyle('core', 'myFancyCSSFile1');
     $this->assertEquals([], \OC_Util::$scripts);
     $this->assertEquals(['core/css/myFancyCSSFile10', 'core/css/myFancyCSSFile0', 'core/css/myFancyCSSFile1', 'myApp/css/myFancyCSSFile2'], \OC_Util::$styles);
 }
Пример #29
0
 /**
  * add a css file
  * @param string $application
  * @param string $file
  * @since 4.0.0
  */
 public static function addStyle($application, $file = null)
 {
     \OC_Util::addStyle($application, $file);
 }
Пример #30
0
 public static function initTemplateEngine()
 {
     // Add the stuff we need always
     OC_Util::addScript("jquery-1.10.0.min");
     OC_Util::addScript("jquery-migrate-1.2.1.min");
     OC_Util::addScript("jquery-ui-1.10.0.custom");
     OC_Util::addScript("jquery-showpassword");
     OC_Util::addScript("jquery.infieldlabel");
     OC_Util::addScript("jquery.placeholder");
     OC_Util::addScript("jquery-tipsy");
     OC_Util::addScript("compatibility");
     OC_Util::addScript("jquery.ocdialog");
     OC_Util::addScript("oc-dialogs");
     OC_Util::addScript("js");
     OC_Util::addScript("octemplate");
     OC_Util::addScript("eventsource");
     OC_Util::addScript("config");
     //OC_Util::addScript( "multiselect" );
     OC_Util::addScript('search', 'result');
     OC_Util::addScript('router');
     OC_Util::addScript("oc-requesttoken");
     // avatars
     if (\OC_Config::getValue('enable_avatars', true) === true) {
         \OC_Util::addScript('placeholder');
         \OC_Util::addScript('3rdparty', 'md5/md5.min');
         \OC_Util::addScript('jquery.avatar');
         \OC_Util::addScript('avatar');
     }
     OC_Util::addStyle("styles");
     OC_Util::addStyle("apps");
     OC_Util::addStyle("fixes");
     OC_Util::addStyle("multiselect");
     OC_Util::addStyle("jquery-ui-1.10.0.custom");
     OC_Util::addStyle("jquery-tipsy");
     OC_Util::addStyle("jquery.ocdialog");
 }