// apps from external repo via OCS $categoryNames = OC_OCSClient::getCategories(); if (is_array($categoryNames)) { $categories = array_keys($categoryNames); $page = 0; $filter = 'approved'; $externalApps = OC_OCSClient::getApplications($categories, $page, $filter); foreach ($externalApps as $app) { // show only external apps that aren't enabled yet $local = false; foreach ($enabledApps as $a) { if ($a == $app['name']) { $local = true; } } if (!$local) { if ($app['preview'] == '') { $pre = OC_Helper::imagePath('settings', 'trans.png'); } else { $pre = $app['preview']; } if ($app['label'] == 'recommended') { $label = '3rd Party'; } else { $label = 'Recommended'; } $apps[] = array('name' => $app['name'], 'id' => $app['id'], 'active' => false, 'description' => $app['description'], 'author' => $app['personid'], 'license' => $app['license'], 'preview' => $pre, 'internal' => false, 'internallabel' => $label, 'update' => false); } } } OCP\JSON::success(array('type' => 'external', 'data' => $apps));
/** * ownCloud - Internal Bookmarks 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/>. * */ OC::$CLASSPATH['OC_IntBks'] = 'apps/internal_bookmarks/lib/intbks.class.php'; OC_App::register(array('order' => 70, 'id' => 'internal_bookmarks', 'name' => 'Internal Bookmarks')); OC_Util::addScript("internal_bookmarks", "actlink.min"); $i = 0; foreach (OC_IntBks::getAllItemsByUser() as $item) { OC_App::addNavigationEntry(array('id' => 'internal_bookmarks_index_' . $item['bkid'], 'order' => 70 + $item['bkorder'] / 100, 'href' => OC_Helper::linkTo('files', 'index.php?dir=' . $item['bktarget']), 'icon' => OC_Helper::imagePath('internal_bookmarks', 'star_on.png'), 'name' => $item['bktitle'])); $i++; } if ($i > 0) { OC_App::registerPersonal('internal_bookmarks', 'settings'); }
/** * make OC_Helper::imagePath available as a simple function * @param string $app app * @param string $image image * @return string link to the image * * For further information have a look at OC_Helper::imagePath */ function image_path($app, $image) { return OC_Helper::imagePath($app, $image); }
<?php /** * Copyright (c) 2011 Marvin Thomas Rabe <*****@*****.**> * Copyright (c) 2011 Arthur Schiwon <*****@*****.**> * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. */ OC_App::register(array('order' => 70, 'id' => 'bookmark', 'name' => 'Bookmarks')); OC_App::addNavigationEntry(array('id' => 'bookmarks_index', 'order' => 70, 'href' => OC_Helper::linkTo('bookmarks', 'index.php'), 'icon' => OC_Helper::imagePath('bookmarks', 'bookmarks.png'), 'name' => 'Bookmarks')); OC_App::registerPersonal('bookmarks', 'settings');
continue; } if (OC_Appconfig::getValue($app, 'enabled', 'no') == 'yes') { $active = true; } else { $active = false; } $info['active'] = $active; if (isset($info['shipped']) and $info['shipped'] == 'true') { $info['internal'] = true; $info['internallabel'] = 'Internal App'; } else { $info['internal'] = false; $info['internallabel'] = '3rd Party App'; } $info['preview'] = OC_Helper::imagePath('settings', 'trans.png'); $info['version'] = OC_App::getAppVersion($app); $appList[] = $info; } } $remoteApps = OC_App::getAppstoreApps(); if ($remoteApps) { // Remove duplicates foreach ($appList as $app) { foreach ($remoteApps as $key => $remote) { if ($app['name'] == $remote['name']) { unset($remoteApps[$key]); } } } $combinedApps = array_merge($appList, $remoteApps);
<?php /** * ownCloud - News app * * @author Alessandro Cosentino * Copyright (c) 2012 - Alessandro Cosentino <*****@*****.**> * * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file * */ OC::$CLASSPATH['OCA\\News\\StatusFlag'] = 'apps/news/lib/item.php'; OC::$CLASSPATH['OCA\\News\\Item'] = 'apps/news/lib/item.php'; OC::$CLASSPATH['OCA\\News\\Collection'] = 'apps/news/lib/collection.php'; OC::$CLASSPATH['OCA\\News\\Feed'] = 'apps/news/lib/feed.php'; OC::$CLASSPATH['OCA\\News\\Folder'] = 'apps/news/lib/folder.php'; OC::$CLASSPATH['OCA\\News\\FeedType'] = 'apps/news/lib/feedtypes.php'; OC::$CLASSPATH['OCA\\News\\FeedMapper'] = 'apps/news/lib/feedmapper.php'; OC::$CLASSPATH['OCA\\News\\ItemMapper'] = 'apps/news/lib/itemmapper.php'; OC::$CLASSPATH['OCA\\News\\FolderMapper'] = 'apps/news/lib/foldermapper.php'; OC::$CLASSPATH['OCA\\News\\Utils'] = 'apps/news/lib/utils.php'; OC::$CLASSPATH['OC_Search_Provider_News'] = 'apps/news/lib/search.php'; OC::$CLASSPATH['OCA\\News\\Backgroundjob'] = 'apps/news/lib/backgroundjob.php'; OCP\Backgroundjob::addRegularTask('OCA\\News\\Backgroundjob', 'run'); OC::$CLASSPATH['OCA\\News\\Share_Backend_News_Item'] = 'apps/news/lib/share/item.php'; OCP\App::addNavigationEntry(array('id' => 'news', 'order' => 74, 'href' => OC_Helper::linkTo('news', 'index.php'), 'icon' => OC_Helper::imagePath('news', 'icon.svg'), 'name' => OC_L10N::get('news')->t('News'))); OC_Search::registerProvider('OC_Search_Provider_News'); OCP\Share::registerBackend('news_item', 'OCA\\News\\Share_Backend_News_Item');
<img class="app-icon svg" alt="" src="<?php print_unescaped($entry['icon']); ?>"> <div class="icon-loading-dark" style="display:none;"></div> <span> <?php p($entry['name']); ?> </span> </a> </li> <?php endforeach; ?> <?php /* show "More apps" link to app administration directly in app navigation, as last entry */ if(OC_User::isAdminUser(OC_User::getUser())): ?> <li id="apps-management"> <a href="<?php print_unescaped(\OC::$server->getURLGenerator()->linkToRoute('settings.AppSettings.viewApps')); ?>" tabindex="4" <?php if( $_['appsmanagement_active'] ): ?> class="active"<?php endif; ?>> <img class="app-icon svg" alt="" src="<?php print_unescaped(OC_Helper::imagePath('settings', 'apps.svg')); ?>"> <div class="icon-loading-dark" style="display:none;"></div> <span> <?php p($l->t('Apps')); ?> </span> </a> </li> <?php endif; ?> </ul> </div> </div></nav> <div id="content-wrapper"> <div id="content" class="app-<?php p($_['appid']) ?>" role="main"> <?php print_unescaped($_['content']); ?>
/** * @brief: get a list of all apps on apps.owncloud.com * @return array, multi-dimensional array of apps. * Keys: id, name, type, typename, personid, license, detailpage, preview, changed, description */ public static function getAppstoreApps($filter = 'approved') { $categoryNames = OC_OCSClient::getCategories(\OC_Util::getVersion()); if (is_array($categoryNames)) { // Check that categories of apps were retrieved correctly if (!($categories = array_keys($categoryNames))) { return false; } $page = 0; $remoteApps = OC_OCSClient::getApplications($categories, $page, $filter, \OC_Util::getVersion()); $app1 = array(); $i = 0; foreach ($remoteApps as $app) { $app1[$i] = $app; $app1[$i]['author'] = $app['personid']; $app1[$i]['ocs_id'] = $app['id']; $app1[$i]['internal'] = $app1[$i]['active'] = 0; $app1[$i]['update'] = false; if ($app['label'] == 'recommended') { $app1[$i]['internallabel'] = 'Recommended'; $app1[$i]['internalclass'] = 'recommendedapp'; } else { $app1[$i]['internallabel'] = '3rd Party'; $app1[$i]['internalclass'] = 'externalapp'; } // rating img if ($app['score'] >= 0 and $app['score'] < 5) { $img = OC_Helper::imagePath("core", "rating/s1.png"); } elseif ($app['score'] >= 5 and $app['score'] < 15) { $img = OC_Helper::imagePath("core", "rating/s2.png"); } elseif ($app['score'] >= 15 and $app['score'] < 25) { $img = OC_Helper::imagePath("core", "rating/s3.png"); } elseif ($app['score'] >= 25 and $app['score'] < 35) { $img = OC_Helper::imagePath("core", "rating/s4.png"); } elseif ($app['score'] >= 35 and $app['score'] < 45) { $img = OC_Helper::imagePath("core", "rating/s5.png"); } elseif ($app['score'] >= 45 and $app['score'] < 55) { $img = OC_Helper::imagePath("core", "rating/s6.png"); } elseif ($app['score'] >= 55 and $app['score'] < 65) { $img = OC_Helper::imagePath("core", "rating/s7.png"); } elseif ($app['score'] >= 65 and $app['score'] < 75) { $img = OC_Helper::imagePath("core", "rating/s8.png"); } elseif ($app['score'] >= 75 and $app['score'] < 85) { $img = OC_Helper::imagePath("core", "rating/s9.png"); } elseif ($app['score'] >= 85 and $app['score'] < 95) { $img = OC_Helper::imagePath("core", "rating/s10.png"); } elseif ($app['score'] >= 95 and $app['score'] < 100) { $img = OC_Helper::imagePath("core", "rating/s11.png"); } $app1[$i]['score'] = '<img src="' . $img . '"> Score: ' . $app['score'] . '%'; $i++; } } if (empty($app1)) { return false; } else { return $app1; } }
/** * ownCloud - ocDownloader 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 = 'ocdownloader'; OC_Util::checkAppEnabled($app_id); OC::$CLASSPATH['OC_ocDownloader'] = 'apps/' . $app_id . '/lib/ocDownloader.class.php'; OC::$CLASSPATH['OC_ocDownloaderFile'] = 'apps/' . $app_id . '/lib/ocDownloaderFile.class.php'; if (OC_ocDownloader::isUpToDate(OC_Appconfig::getValue($app_id, 'installed_version'))) { OC_ocDownloader::initProviders(dirname(__FILE__) . '/providers.xml'); } OC_App::register(array('order' => 30, 'id' => $app_id, 'name' => 'ocDownloader')); OC_App::addNavigationEntry(array('id' => $app_id . '_index', 'order' => 30, 'href' => OC_Helper::linkTo($app_id, 'downloader.php'), 'icon' => OC_Helper::imagePath($app_id, 'dl.png'), 'name' => 'ocDownloader')); OC_App::registerPersonal($app_id, 'personalsettings');
foreach ($_['sc_sort'] as $sc_sort) { if (strcmp($sc_sort, 'cpie_rfsus') == 0) { $sc_sort_title = 'Current ratio free space / used space'; } elseif (strcmp($sc_sort, 'clines_usse') == 0) { $sc_sort_title = 'Daily Used Space Evolution'; } else { $sc_sort_title = 'Monthly Used Space Evolution'; } if ($_['c_disp'][$sc_sort]) { ?> <div id="<?php print $sc_sort; ?> " class="personalblock"> <h3><img src="<?php print OC_Helper::imagePath('storage_charts', 'move.png'); ?> " /><?php print $l->t($sc_sort_title) . ' ' . $l->t('for'); ?> "<?php print OC_Group::inGroup(OC_User::getUser(), 'admin') ? $l->t('all users') : OC_User::getUser(); ?> "</h3> <div id="<?php print substr($sc_sort, 1); ?> " style="max-width:100%;height:400px;margin:0 auto"></div> <script type="text/javascript">$(document).ready(function() {<?php print OC_DLStChartsLoader::loadChart($sc_sort, $l); ?>
print $p['pr_id']; ?> " value="<?php print !is_null($p['us_id']) ? $p['us_username'] : ''; ?> " placeholder="Username" /><input type="password" name="ocdownloader_pr_pw_<?php print $p['pr_id']; ?> " id="ocdownloader_pr_pw_<?php print $p['pr_id']; ?> " value="<?php print !is_null($p['us_id']) ? $p['us_password'] : ''; ?> " placeholder="Password" /><?php print !is_null($p['us_id']) ? '<img class="ocdownloader-delete" src="' . OC_Helper::imagePath('ocdownloader', 'delete.png') . '" rel="' . $p['pr_id'] . '" style="margin-left:10px" />' : ''; ?> </div> <?php } ?> <input type="submit" value="Save" /> </fieldset> </form> <script type="text/javascript"> $(document).ready(function() { $('.ocdownloader-delete').bind('click', function() { $('#ocdownloader_pr_un_' + $(this).attr('rel')).val(''); $('#ocdownloader_pr_pw_' + $(this).attr('rel')).val(''); }); });
* * @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/>. * */ OC_Util::checkAppEnabled('storage_charts'); OC::$CLASSPATH['OC_DLStCharts'] = "apps/storage_charts/lib/db.class.php"; OC::$CLASSPATH['OC_DLStChartsLoader'] = "apps/storage_charts/lib/loader.class.php"; $l = new OC_L10N('storage_charts', OC_L10N::findLanguage(array('en', 'fr'))); OC_App::register(array('order' => 60, 'id' => 'storage_charts', 'name' => 'Storage Charts')); OC_App::addNavigationEntry(array('id' => 'storage_charts', 'order' => 60, 'href' => OC_Helper::linkTo('storage_charts', 'charts.php'), 'icon' => OC_Helper::imagePath('storage_charts', 'chart.png'), 'name' => 'DL Charts')); OC_App::registerPersonal('storage_charts', 'settings'); $data_dir = OC_Config::getValue('datadirectory', ''); if (OC_User::getUser() && strlen($data_dir) != 0) { $used = OC_DLStCharts::getTotalDataSize(OC::$CONFIG_DATADIRECTORY); $total = OC_DLStCharts::getTotalDataSize($data_dir) + OC_Filesystem::free_space(); OC_DLStCharts::update($used, $total); }
<?php /** * ownCloud - media plugin * * @author Robin Appelman * @copyright 2010 Robin Appelman icewind1991@gmail.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 Lesser General Public * License along with this library. If not, see <http://www.gnu.org/ * */ $l = new OC_L10N('media'); require_once 'apps/media/lib_media.php'; OC_Util::addScript('media', 'loader'); OC_APP::registerPersonal('media', 'settings'); OC_App::register(array('order' => 3, 'id' => 'media', 'name' => 'Media')); OC_App::addNavigationEntry(array('id' => 'media_index', 'order' => 2, 'href' => OC_Helper::linkTo('media', 'index.php'), 'icon' => OC_Helper::imagePath('core', 'places/music.svg'), 'name' => $l->t('Music')));
<?php /** * register the page of admin settings form */ OC_App::registerAdmin('neurocloud', 'settings'); /** * register the navigation entry */ OC_App::addNavigationEntry(array('id' => 'neurocloud_index', 'order' => 74, 'href' => OC_Helper::linkTo('neurocloud', 'index.php'), 'icon' => OC_Helper::imagePath('neurocloud', 'neurocloud.png'), 'name' => 'Neurocloud')); /** * register the classpath */ OC::$CLASSPATH["OC_Neurocloud"] = "apps/neurocloud/lib/hooks.php"; /** * register the hooks for file writing * * NOTE: to make sure that the hooks are called everytime that a file is written, the application * must be registered with type "filesystem". Otherwise, those hooks will be called only when uploading from the web interface * * to register the application as a filesystem type, put in info.xml * * <types><filesystem/></types> * */ #OC_Hook::connect(OC\Files\Filesystem::CLASSNAME, OC\Files\Filesystem::signal_write, "OC_Neurocloud", "beforeFileWrite"); #OC_Hook::connect(OC\Files\Filesystem::CLASSNAME, OC\Files\Filesystem::signal_post_write, "OC_Neurocloud", "afterFileWrite"); OC_Hook::connect(OC\Files\Filesystem::CLASSNAME, 'post_delete', "OC_Neurocloud", "fileDeleted"); OC_Hook::connect(OC\Files\Filesystem::CLASSNAME, OC\Files\Filesystem::signal_post_rename, "OC_Neurocloud", "fileRenamed"); // hooks for delete/rename, do not allow deleting of directory if there is a running job OC_Hook::connect(OC\Files\Filesystem::CLASSNAME, OC\Files\Filesystem::signal_delete, "OC_Neurocloud", "beforeFileRenameDelete"); OC_Hook::connect(OC\Files\Filesystem::CLASSNAME, OC\Files\Filesystem::signal_rename, "OC_Neurocloud", "beforeFileRenameDelete");
echo $l->t('Add bookmark'); ?> "/> </div> <div class="bookmarks_add"> <input type="hidden" id="bookmark_add_id" value="0" /> <p><label class="bookmarks_label"><?php echo $l->t('Address'); ?> </label><input type="text" id="bookmark_add_url" class="bookmarks_input" /></p> <p><label class="bookmarks_label"><?php echo $l->t('Title'); ?> </label><input type="text" id="bookmark_add_title" class="bookmarks_input" /> <img class="loading_meta" src="<?php echo OC_Helper::imagePath('core', 'loading.gif'); ?> " /></p> <p><label class="bookmarks_label"><?php echo $l->t('Tags'); ?> </label><input type="text" id="bookmark_add_tags" class="bookmarks_input" /></p> <p><label class="bookmarks_label"> </label><label class="bookmarks_hint"><?php echo $l->t('Hint: Use space to separate tags.'); ?> </label></p> <p><label class="bookmarks_label"></label><input type="submit" value="<?php echo $l->t('Add bookmark'); ?> " id="bookmark_add_submit" /></p> </div>
<?php $l = new OC_L10N('calendar'); OC::$CLASSPATH['OC_Calendar_Calendar'] = 'apps/calendar/lib/calendar.php'; OC::$CLASSPATH['OC_Calendar_Object'] = 'apps/calendar/lib/object.php'; OC::$CLASSPATH['OC_Calendar_Hooks'] = 'apps/calendar/lib/hooks.php'; OC::$CLASSPATH['OC_Connector_Sabre_CalDAV'] = 'apps/calendar/lib/connector_sabre.php'; OC_HOOK::connect('OC_User', 'post_createUser', 'OC_Calendar_Hooks', 'deleteUser'); OC_Util::addScript('calendar', 'loader'); OC_App::register(array('order' => 10, 'id' => 'calendar', 'name' => 'Calendar')); OC_App::addNavigationEntry(array('id' => 'calendar_index', 'order' => 10, 'href' => OC_Helper::linkTo('calendar', 'index.php'), 'icon' => OC_Helper::imagePath('calendar', 'icon.png'), 'name' => $l->t('Calendar'))); OC_App::registerPersonal('calendar', 'settings');
* 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/>. * */ ?> <form id="ocdownloader" method="POST" action="#"> <fieldset class="personalblock"> <strong>ocDownloader</strong> <input type="hidden" id="ocdownloader" name="ocdownloader" value="1" /> <?php foreach($_['pr_list'] as $p){ ?> <div> <div style="float:left;width:100px;margin-top:8px;"> <label><?php print($p['pr_name']); ?></label> </div> <input type="text" name="ocdownloader_pr_un_<?php print($p['pr_id']); ?>" id="ocdownloader_pr_un_<?php print($p['pr_id']); ?>" value="<?php print(!is_null($p['us_id'])?$p['us_username']:''); ?>" placeholder="Username" /><input type="password" name="ocdownloader_pr_pw_<?php print($p['pr_id']); ?>" id="ocdownloader_pr_pw_<?php print($p['pr_id']); ?>" value="<?php print(!is_null($p['us_id'])?$p['us_password']:''); ?>" placeholder="Password" /><?php print(!is_null($p['us_id'])?'<img class="ocdownloader-delete" src="' . OC_Helper::imagePath('ocdownloader', 'delete.png') . '" rel="' . $p['pr_id'] . '" style="margin-left:10px" />':''); ?> </div> <?php } ?> <input type="submit" value="Save" /> </fieldset> </form> <script type="text/javascript"> $(document).ready(function(){ $('.ocdownloader-delete').bind('click', function(){ $('#ocdownloader_pr_un_' + $(this).attr('rel')).val(''); $('#ocdownloader_pr_pw_' + $(this).attr('rel')).val(''); }); }); </script>
/** * List all apps, this is used in apps.php * * @param bool $onlyLocal * @param bool $includeUpdateInfo Should we check whether there is an update * in the app store? * @return array */ public static function listAllApps($onlyLocal = false, $includeUpdateInfo = true) { $installedApps = OC_App::getAllApps(); //TODO which apps do we want to blacklist and how do we integrate // blacklisting with the multi apps folder feature? //we don't want to show configuration for these $blacklist = \OC::$server->getAppManager()->getAlwaysEnabledApps(); $appList = array(); $l = \OC::$server->getL10N('core'); foreach ($installedApps as $app) { if (array_search($app, $blacklist) === false) { $info = OC_App::getAppInfo($app); if (!isset($info['name'])) { \OCP\Util::writeLog('core', 'App id "' . $app . '" has no name in appinfo', \OCP\Util::ERROR); continue; } $enabled = \OC::$server->getAppConfig()->getValue($app, 'enabled', 'no'); $info['groups'] = null; if ($enabled === 'yes') { $active = true; } else { if ($enabled === 'no') { $active = false; } else { $active = true; $info['groups'] = $enabled; } } $info['active'] = $active; if (self::isShipped($app)) { $info['internal'] = true; $info['level'] = self::officialApp; $info['removable'] = false; } else { $info['internal'] = false; $info['removable'] = true; } $info['update'] = $includeUpdateInfo ? OC_Installer::isUpdateAvailable($app) : null; $appIcon = self::getAppPath($app) . '/img/' . $app . '.svg'; if (file_exists($appIcon)) { $info['preview'] = OC_Helper::imagePath($app, $app . '.svg'); $info['previewAsIcon'] = true; } else { $appIcon = self::getAppPath($app) . '/img/app.svg'; if (file_exists($appIcon)) { $info['preview'] = OC_Helper::imagePath($app, 'app.svg'); $info['previewAsIcon'] = true; } } $info['version'] = OC_App::getAppVersion($app); $appList[] = $info; } } if ($onlyLocal) { $remoteApps = []; } else { $remoteApps = OC_App::getAppstoreApps(); } if ($remoteApps) { // Remove duplicates foreach ($appList as $app) { foreach ($remoteApps as $key => $remote) { if ($app['name'] === $remote['name'] || isset($app['ocsid']) && $app['ocsid'] === $remote['id']) { unset($remoteApps[$key]); } } } $combinedApps = array_merge($appList, $remoteApps); } else { $combinedApps = $appList; } return $combinedApps; }
<?php $l = new OC_L10N('files'); OC_App::register(array("order" => 2, "id" => "files", "name" => "Files")); OC_App::addNavigationEntry(array("id" => "files_index", "order" => 1, "href" => OC_Helper::linkTo("files", "index.php"), "icon" => OC_Helper::imagePath("core", "places/home.svg"), "name" => $l->t("Files")));
/** * @brief Creates path to an image * @param string $app app * @param string $image image name * @returns string the url * * Returns the path to the image. */ public static function imagePath($app, $image) { return \OC_Helper::imagePath($app, $image); }
/** * @brief Returns the Settings Navigation * @returns associative array * * This function returns an array containing all settings pages added. The * entries are sorted by the key 'order' ascending. */ public static function getSettingsNavigation() { $l = new OC_L10N('core'); // by default, settings only contain the help menu $settings = array(array("id" => "help", "order" => 1000, "href" => OC_Helper::linkTo("settings", "help.php"), "name" => $l->t("Help"), "icon" => OC_Helper::imagePath("settings", "help.svg"))); // if the user is logged-in if (OC_User::isLoggedIn()) { // personal menu $settings[] = array("id" => "personal", "order" => 1, "href" => OC_Helper::linkTo("settings", "personal.php"), "name" => $l->t("Personal"), "icon" => OC_Helper::imagePath("settings", "personal.svg")); // if there're some settings forms if (!empty(self::$settingsForms)) { // settings menu $settings[] = array("id" => "settings", "order" => 1000, "href" => OC_Helper::linkTo("settings", "settings.php"), "name" => $l->t("Settings"), "icon" => OC_Helper::imagePath("settings", "settings.svg")); } // if the user is an admin if (OC_Group::inGroup($_SESSION["user_id"], "admin")) { // admin users menu $settings[] = array("id" => "core_users", "order" => 2, "href" => OC_Helper::linkTo("settings", "users.php"), "name" => $l->t("Users"), "icon" => OC_Helper::imagePath("settings", "users.svg")); // admin apps menu $settings[] = array("id" => "core_apps", "order" => 3, "href" => OC_Helper::linkTo("settings", "apps.php?installed"), "name" => $l->t("Apps"), "icon" => OC_Helper::imagePath("settings", "apps.svg")); // if there're some admin forms if (!empty(self::$adminForms)) { // admins menu $settings[] = array("id" => "admin", "order" => 1000, "href" => OC_Helper::linkTo("settings", "admin.php"), "name" => $l->t("Admin"), "icon" => OC_Helper::imagePath("settings", "admin.svg")); } } } $navigation = self::proceedNavigation($settings); return $navigation; }
if (OC_User::isAdminUser(OC_User::getUser())) { ?> <li id="apps-management"> <a href="<?php print_unescaped(\OC::$server->getURLGenerator()->linkToRoute('settings.AppSettings.viewApps')); ?> " tabindex="4" <?php if ($_['appsmanagement_active']) { ?> class="active"<?php } ?> > <img class="app-icon svg" alt="" src="<?php print_unescaped(OC_Helper::imagePath('settings', 'apps.svg')); ?> "> <div class="icon-loading-dark" style="display:none;"></div> <span> <?php p($l->t('Apps')); ?> </span> </a> </li> <?php } ?> </ul>
<?php OC::$CLASSPATH['OC_Contacts_Addressbook'] = 'apps/contacts/lib/addressbook.php'; OC::$CLASSPATH['OC_Contacts_VCard'] = 'apps/contacts/lib/vcard.php'; OC::$CLASSPATH['OC_Contacts_Hooks'] = 'apps/contacts/lib/hooks.php'; OC::$CLASSPATH['OC_Connector_Sabre_CardDAV'] = 'apps/contacts/lib/connector_sabre.php'; OC_HOOK::connect('OC_User', 'post_createUser', 'OC_Contacts_Hooks', 'deleteUser'); OC_App::register(array('order' => 10, 'id' => 'contacts', 'name' => 'Contacts')); OC_App::addNavigationEntry(array('id' => 'contacts_index', 'order' => 10, 'href' => OC_Helper::linkTo('contacts', 'index.php'), 'icon' => OC_Helper::imagePath('settings', 'users.svg'), 'name' => 'Contacts')); OC_APP::registerPersonal('contacts', 'settings');
/** * Lists all apps, this is used in apps.php * @return array */ public static function listAllApps($onlyLocal = false) { $installedApps = OC_App::getAllApps(); //TODO which apps do we want to blacklist and how do we integrate // blacklisting with the multi apps folder feature? $blacklist = array('files'); //we don't want to show configuration for these $appList = array(); $l = \OC::$server->getL10N('core'); foreach ($installedApps as $app) { if (array_search($app, $blacklist) === false) { $info = OC_App::getAppInfo($app); if (!isset($info['name'])) { OC_Log::write('core', 'App id "' . $app . '" has no name in appinfo', OC_Log::ERROR); continue; } $enabled = OC_Appconfig::getValue($app, 'enabled', 'no'); $info['groups'] = null; if ($enabled === 'yes') { $active = true; } else { if ($enabled === 'no') { $active = false; } else { $active = true; $info['groups'] = $enabled; } } $info['active'] = $active; if (isset($info['shipped']) and $info['shipped'] == 'true') { $info['internal'] = true; $info['internallabel'] = (string) $l->t('Recommended'); $info['internalclass'] = 'recommendedapp'; $info['removable'] = false; } else { $info['internal'] = false; $info['removable'] = true; } $info['update'] = OC_Installer::isUpdateAvailable($app); $appIcon = self::getAppPath($app) . '/img/' . $app . '.svg'; if (file_exists($appIcon)) { $info['preview'] = OC_Helper::imagePath($app, $app . '.svg'); $info['previewAsIcon'] = true; } else { $appIcon = self::getAppPath($app) . '/img/app.svg'; if (file_exists($appIcon)) { $info['preview'] = OC_Helper::imagePath($app, 'app.svg'); $info['previewAsIcon'] = true; } } $info['version'] = OC_App::getAppVersion($app); $appList[] = $info; } } if ($onlyLocal) { $remoteApps = array(); } else { $remoteApps = OC_App::getAppstoreApps(); } if ($remoteApps) { // Remove duplicates foreach ($appList as $app) { foreach ($remoteApps as $key => $remote) { if ($app['name'] === $remote['name'] || isset($app['ocsid']) && $app['ocsid'] === $remote['id']) { unset($remoteApps[$key]); } } } $combinedApps = array_merge($appList, $remoteApps); } else { $combinedApps = $appList; } // bring the apps into the right order with a custom sort function usort($combinedApps, function ($a, $b) { // priority 1: active if ($a['active'] != $b['active']) { return $b['active'] - $a['active']; } // priority 2: shipped $aShipped = array_key_exists('shipped', $a) && $a['shipped'] === 'true' ? 1 : 0; $bShipped = array_key_exists('shipped', $b) && $b['shipped'] === 'true' ? 1 : 0; if ($aShipped !== $bShipped) { return $bShipped - $aShipped; } // priority 3: recommended $internalClassA = isset($a['internalclass']) ? $a['internalclass'] : ''; $internalClassB = isset($b['internalclass']) ? $b['internalclass'] : ''; if ($internalClassA != $internalClassB) { $aTemp = $internalClassA == 'recommendedapp' ? 1 : 0; $bTemp = $internalClassB == 'recommendedapp' ? 1 : 0; return $bTemp - $aTemp; } // priority 4: alphabetical return strcasecmp($a['name'], $b['name']); }); return $combinedApps; }
<span title="<?php print($l->t('Overwrite')); ?>" class="overwrite"><input type="checkbox" value="0" /></span> </div> <span class="urlc" title="<?php print($l->t('Choose a provider first ...')); ?>"><input type="text" class="url" value="" placeholder="<?php print($l->t('URL of the file to download')); ?>" /></span><span class="dling"></span> </div> </div> <div id="hiddentpl"> <div class="eltleft"> <select class="chzen-select"> <option value="0"></option> <?php foreach($_['user_prov_set'] as $prov){ ?> <option value="pr_<?php print($prov['pr_id']); ?>"><?php print($prov['pr_name']); ?></option> <?php } ?> </select> <span title="<?php print($l->t('Overwrite')); ?>" class="overwrite"><input type="checkbox" value="0" /></span> </div> <span class="urlc" title="<?php print($l->t('Choose a provider first ...')); ?>"><input type="text" class="url" value="" placeholder="<?php print($l->t('URL of the file to download')); ?>" /></span><span class="dling"><img src="<?php print(OC_Helper::imagePath('ocdownloader', 'delete.png')); ?>" class="eltdelete" /></span> </div> <?php } ?> <div id="divhisto" class="personalblock"> <?php $status = Array($l->t('Unknown error'),$l->t('OK')); print($l->t('Downloads history')); ?> <table border="0" cellpadding="0" cellspacing="0"> <thead> <tr> <th class="col1"><?php print($l->t('File')); ?></th> <th class="col2"><?php print($l->t('Date / Time')); ?></th> <th class="col3"><?php print($l->t('Status')); ?></th> </tr> </thead> <tbody id="tbhisto"> <?php if(!$_['user_history']){ ?>