@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | |
| 24 | 24 | style('settings', 'settings'); |
| 25 | -script('settings', [ 'settings', 'admin', 'log', 'certificates'] ); |
|
| 25 | +script('settings', ['settings', 'admin', 'log', 'certificates']); |
|
| 26 | 26 | script('core', ['multiselect', 'setupchecks']); |
| 27 | 27 | script('files', 'jquery.fileupload'); |
| 28 | 28 | |
@@ -32,10 +32,10 @@ discard block |
||
| 32 | 32 | <ul> |
| 33 | 33 | <li class="settings-caption">Personal</li> |
| 34 | 34 | <?php |
| 35 | - foreach($_['forms']['personal'] as $form) { |
|
| 35 | + foreach ($_['forms']['personal'] as $form) { |
|
| 36 | 36 | if (isset($form['anchor'])) { |
| 37 | 37 | $anchor = \OC::$server->getURLGenerator()->linkToRoute('settings.PersonalSettings.index', ['section' => $form['anchor']]); |
| 38 | - $class = 'nav-icon-' . $form['anchor']; |
|
| 38 | + $class = 'nav-icon-'.$form['anchor']; |
|
| 39 | 39 | $sectionName = $form['section-name']; |
| 40 | 40 | $active = $form['active'] ? ' class="active"' : ''; |
| 41 | 41 | ?> |
@@ -55,16 +55,16 @@ discard block |
||
| 55 | 55 | ?> |
| 56 | 56 | |
| 57 | 57 | <?php |
| 58 | - if(!empty($_['forms']['admin'])) { |
|
| 58 | + if (!empty($_['forms']['admin'])) { |
|
| 59 | 59 | ?> |
| 60 | 60 | <li class="settings-caption">Administration</li> |
| 61 | 61 | <?php |
| 62 | 62 | } |
| 63 | - foreach($_['forms']['admin'] as $form) { |
|
| 63 | + foreach ($_['forms']['admin'] as $form) { |
|
| 64 | 64 | if (isset($form['anchor'])) { |
| 65 | 65 | |
| 66 | 66 | $anchor = \OC::$server->getURLGenerator()->linkToRoute('settings.AdminSettings.index', ['section' => $form['anchor']]); |
| 67 | - $class = 'nav-icon-' . $form['anchor']; |
|
| 67 | + $class = 'nav-icon-'.$form['anchor']; |
|
| 68 | 68 | $sectionName = $form['section-name']; |
| 69 | 69 | $active = $form['active'] ? ' class="active"' : ''; |
| 70 | 70 | ?> |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | * @since 9.1 |
| 46 | 46 | */ |
| 47 | 47 | public function getForm() { |
| 48 | - $parameters = [ 'clients' => $this->getClientLinks() ]; |
|
| 48 | + $parameters = ['clients' => $this->getClientLinks()]; |
|
| 49 | 49 | return new TemplateResponse('settings', 'settings/personal/sync-clients', $parameters); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | /** |
| 36 | 36 | * @since 9.1.0 |
| 37 | 37 | */ |
| 38 | - const KEY_ADMIN_SECTION = 'admin-section'; |
|
| 38 | + const KEY_ADMIN_SECTION = 'admin-section'; |
|
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * @since 12.0.0 |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | /** |
| 46 | 46 | * @since 12.0.0 |
| 47 | 47 | */ |
| 48 | - const KEY_PERSONAL_SECTION = 'personal-section'; |
|
| 48 | + const KEY_PERSONAL_SECTION = 'personal-section'; |
|
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * sets up settings according to data specified by an apps info.xml, within |
@@ -26,18 +26,18 @@ discard block |
||
| 26 | 26 | ?> |
| 27 | 27 | |
| 28 | 28 | <div id="clientsbox" class="section clientsbox"> |
| 29 | - <h2><?php p($l->t('Get the apps to sync your files'));?></h2> |
|
| 29 | + <h2><?php p($l->t('Get the apps to sync your files')); ?></h2> |
|
| 30 | 30 | <a href="<?php p($_['clients']['desktop']); ?>" rel="noreferrer" target="_blank"> |
| 31 | 31 | <img src="<?php print_unescaped(image_path('core', 'desktopapp.svg')); ?>" |
| 32 | - alt="<?php p($l->t('Desktop client'));?>" /> |
|
| 32 | + alt="<?php p($l->t('Desktop client')); ?>" /> |
|
| 33 | 33 | </a> |
| 34 | 34 | <a href="<?php p($_['clients']['android']); ?>" rel="noreferrer" target="_blank"> |
| 35 | 35 | <img src="<?php print_unescaped(image_path('core', 'googleplay.png')); ?>" |
| 36 | - alt="<?php p($l->t('Android app'));?>" /> |
|
| 36 | + alt="<?php p($l->t('Android app')); ?>" /> |
|
| 37 | 37 | </a> |
| 38 | 38 | <a href="<?php p($_['clients']['ios']); ?>" rel="noreferrer" target="_blank"> |
| 39 | 39 | <img src="<?php print_unescaped(image_path('core', 'appstore.svg')); ?>" |
| 40 | - alt="<?php p($l->t('iOS app'));?>" /> |
|
| 40 | + alt="<?php p($l->t('iOS app')); ?>" /> |
|
| 41 | 41 | </a> |
| 42 | 42 | |
| 43 | 43 | <p> |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $l->t('If you want to support the project {contributeopen}join development{linkclose} or {contributeopen}spread the word{linkclose}!'))); ?> |
| 54 | 54 | </p> |
| 55 | 55 | |
| 56 | - <?php if(OC_APP::isEnabled('firstrunwizard')) {?> |
|
| 57 | - <p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again'));?></a></p> |
|
| 56 | + <?php if (OC_APP::isEnabled('firstrunwizard')) {?> |
|
| 57 | + <p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again')); ?></a></p> |
|
| 58 | 58 | <?php }?> |
| 59 | 59 | </div> |
@@ -265,6 +265,9 @@ discard block |
||
| 265 | 265 | return $this->mapper->has($table, $className); |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | + /** |
|
| 269 | + * @param string $type |
|
| 270 | + */ |
|
| 268 | 271 | private function setupSettingsEntry($settingsClassName, $type) { |
| 269 | 272 | if (!class_exists($settingsClassName)) { |
| 270 | 273 | $this->log->debug('Could not find ' . $type . ' section class ' . $settingsClassName); |
@@ -294,6 +297,9 @@ discard block |
||
| 294 | 297 | } |
| 295 | 298 | } |
| 296 | 299 | |
| 300 | + /** |
|
| 301 | + * @param string $type |
|
| 302 | + */ |
|
| 297 | 303 | private function getSectionTableForType($type) { |
| 298 | 304 | if($type === 'admin') { |
| 299 | 305 | return Mapper::TABLE_ADMIN_SECTIONS; |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | */ |
| 189 | 189 | private function setupSectionEntry($sectionClassName, $type) { |
| 190 | 190 | if (!class_exists($sectionClassName)) { |
| 191 | - $this->log->debug('Could not find ' . ucfirst($type) . ' section class ' . $sectionClassName); |
|
| 191 | + $this->log->debug('Could not find '.ucfirst($type).' section class '.$sectionClassName); |
|
| 192 | 192 | return; |
| 193 | 193 | } |
| 194 | 194 | try { |
@@ -200,13 +200,13 @@ discard block |
||
| 200 | 200 | |
| 201 | 201 | if (!$section instanceof ISection) { |
| 202 | 202 | $this->log->error( |
| 203 | - ucfirst($type) .' section instance must implement \OCP\ISection. Invalid class: {class}', |
|
| 203 | + ucfirst($type).' section instance must implement \OCP\ISection. Invalid class: {class}', |
|
| 204 | 204 | ['class' => $sectionClassName] |
| 205 | 205 | ); |
| 206 | 206 | return; |
| 207 | 207 | } |
| 208 | 208 | $table = $this->getSectionTableForType($type); |
| 209 | - if(!$this->hasSection(get_class($section), $table)) { |
|
| 209 | + if (!$this->hasSection(get_class($section), $table)) { |
|
| 210 | 210 | $this->addSection($section, $table); |
| 211 | 211 | } else { |
| 212 | 212 | $this->updateSection($section, $table); |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | |
| 273 | 273 | private function setupSettingsEntry($settingsClassName, $type) { |
| 274 | 274 | if (!class_exists($settingsClassName)) { |
| 275 | - $this->log->debug('Could not find ' . $type . ' section class ' . $settingsClassName); |
|
| 275 | + $this->log->debug('Could not find '.$type.' section class '.$settingsClassName); |
|
| 276 | 276 | return; |
| 277 | 277 | } |
| 278 | 278 | |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | |
| 287 | 287 | if (!$settings instanceof ISettings) { |
| 288 | 288 | $this->log->error( |
| 289 | - ucfirst($type) . ' section instance must implement \OCP\Settings\ISettings. Invalid class: {class}', |
|
| 289 | + ucfirst($type).' section instance must implement \OCP\Settings\ISettings. Invalid class: {class}', |
|
| 290 | 290 | ['class' => $settingsClassName] |
| 291 | 291 | ); |
| 292 | 292 | return; |
@@ -300,18 +300,18 @@ discard block |
||
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | private function getSectionTableForType($type) { |
| 303 | - if($type === 'admin') { |
|
| 303 | + if ($type === 'admin') { |
|
| 304 | 304 | return Mapper::TABLE_ADMIN_SECTIONS; |
| 305 | - } else if($type === 'personal') { |
|
| 305 | + } else if ($type === 'personal') { |
|
| 306 | 306 | return Mapper::TABLE_PERSONAL_SECTIONS; |
| 307 | 307 | } |
| 308 | 308 | throw new \InvalidArgumentException('"admin" or "personal" expected'); |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | private function getSettingsTableForType($type) { |
| 312 | - if($type === 'admin') { |
|
| 312 | + if ($type === 'admin') { |
|
| 313 | 313 | return Mapper::TABLE_ADMIN_SETTINGS; |
| 314 | - } else if($type === 'personal') { |
|
| 314 | + } else if ($type === 'personal') { |
|
| 315 | 315 | return Mapper::TABLE_PERSONAL_SETTINGS; |
| 316 | 316 | } |
| 317 | 317 | throw new \InvalidArgumentException('"admin" or "personal" expected'); |
@@ -418,12 +418,12 @@ discard block |
||
| 418 | 418 | ); |
| 419 | 419 | $forms[$form->getPriority()] = [$form]; |
| 420 | 420 | } |
| 421 | - if($section === 'security') { |
|
| 421 | + if ($section === 'security') { |
|
| 422 | 422 | /** @var ISettings $form */ |
| 423 | 423 | $form = new Personal\Security(); |
| 424 | 424 | $forms[$form->getPriority()] = [$form]; |
| 425 | 425 | } |
| 426 | - if($section === 'sync-clients') { |
|
| 426 | + if ($section === 'sync-clients') { |
|
| 427 | 427 | /** @var ISettings $form */ |
| 428 | 428 | $form = new Personal\SyncClients($this->config, $this->defaults); |
| 429 | 429 | $forms[$form->getPriority()] = [$form]; |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | ]; |
| 473 | 473 | |
| 474 | 474 | $legacyForms = \OC_App::getForms('personal'); |
| 475 | - if(count($legacyForms) > 0 && $this->hasLegacyPersonalSettingsToRender($legacyForms)) { |
|
| 475 | + if (count($legacyForms) > 0 && $this->hasLegacyPersonalSettingsToRender($legacyForms)) { |
|
| 476 | 476 | $sections[98] = [new Section('additional', $this->l->t('Additional settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))]; |
| 477 | 477 | } |
| 478 | 478 | |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | */ |
| 501 | 501 | private function hasLegacyPersonalSettingsToRender($forms) { |
| 502 | 502 | foreach ($forms as $form) { |
| 503 | - if(trim($form) !== '') { |
|
| 503 | + if (trim($form) !== '') { |
|
| 504 | 504 | return true; |
| 505 | 505 | } |
| 506 | 506 | } |
@@ -104,10 +104,10 @@ discard block |
||
| 104 | 104 | * @return array[] [['class' => string, 'priority' => int], ...] |
| 105 | 105 | */ |
| 106 | 106 | public function getSectionsFromDB($type) { |
| 107 | - if($type === 'admin') { |
|
| 107 | + if ($type === 'admin') { |
|
| 108 | 108 | $sectionsTable = self::TABLE_ADMIN_SECTIONS; |
| 109 | 109 | $settingsTable = self::TABLE_ADMIN_SETTINGS; |
| 110 | - } else if($type === 'personal') { |
|
| 110 | + } else if ($type === 'personal') { |
|
| 111 | 111 | $sectionsTable = self::TABLE_PERSONAL_SECTIONS; |
| 112 | 112 | $settingsTable = self::TABLE_PERSONAL_SETTINGS; |
| 113 | 113 | } else { |
@@ -120,8 +120,8 @@ discard block |
||
| 120 | 120 | ->from($settingsTable, 'f') |
| 121 | 121 | ->where($query->expr()->eq('s.id', 'f.section')); |
| 122 | 122 | $result = $query->execute(); |
| 123 | - return array_map(function ($row) { |
|
| 124 | - $row['priority'] = (int)$row['priority']; |
|
| 123 | + return array_map(function($row) { |
|
| 124 | + $row['priority'] = (int) $row['priority']; |
|
| 125 | 125 | return $row; |
| 126 | 126 | }, $result->fetchAll()); |
| 127 | 127 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | public function add($table, array $values) { |
| 134 | 134 | $query = $this->dbc->getQueryBuilder(); |
| 135 | - $values = array_map(function ($value) use ($query) { |
|
| 135 | + $values = array_map(function($value) use ($query) { |
|
| 136 | 136 | return $query->createNamedParameter($value); |
| 137 | 137 | }, $values); |
| 138 | 138 | $query->insert($table)->values($values); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | $data = $resultStatement->fetchAll(); |
| 154 | 154 | $resultStatement->closeCursor(); |
| 155 | 155 | |
| 156 | - return array_map(function ($row) { |
|
| 156 | + return array_map(function($row) { |
|
| 157 | 157 | return $row['class']; |
| 158 | 158 | }, $data); |
| 159 | 159 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $row = $result->fetch(); |
| 177 | 177 | $result->closeCursor(); |
| 178 | 178 | |
| 179 | - return (bool)$row; |
|
| 179 | + return (bool) $row; |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | /** |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | protected function getSettings($section) { |
| 68 | 68 | $settings = $this->settingsManager->getPersonalSettings($section); |
| 69 | 69 | $formatted = $this->formatSettings($settings); |
| 70 | - if($section === 'additional') { |
|
| 70 | + if ($section === 'additional') { |
|
| 71 | 71 | $formatted['content'] .= $this->getLegacyForms(); |
| 72 | 72 | } |
| 73 | 73 | return $formatted; |
@@ -79,9 +79,9 @@ discard block |
||
| 79 | 79 | private function getLegacyForms() { |
| 80 | 80 | $forms = \OC_App::getForms('personal'); |
| 81 | 81 | |
| 82 | - $forms = array_map(function ($form) { |
|
| 82 | + $forms = array_map(function($form) { |
|
| 83 | 83 | if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) { |
| 84 | - $sectionName = str_replace('<h2' . $regs['class'] . '>', '', $regs[0]); |
|
| 84 | + $sectionName = str_replace('<h2'.$regs['class'].'>', '', $regs[0]); |
|
| 85 | 85 | $sectionName = str_replace('</h2>', '', $sectionName); |
| 86 | 86 | $anchor = strtolower($sectionName); |
| 87 | 87 | $anchor = str_replace(' ', '-', $anchor); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | protected function getSettings($section) { |
| 78 | 78 | $settings = $this->settingsManager->getAdminSettings($section); |
| 79 | 79 | $formatted = $this->formatSettings($settings); |
| 80 | - if($section === 'additional') { |
|
| 80 | + if ($section === 'additional') { |
|
| 81 | 81 | $formatted['content'] .= $this->getLegacyForms(); |
| 82 | 82 | } |
| 83 | 83 | return $formatted; |
@@ -89,9 +89,9 @@ discard block |
||
| 89 | 89 | private function getLegacyForms() { |
| 90 | 90 | $forms = \OC_App::getForms('admin'); |
| 91 | 91 | |
| 92 | - $forms = array_map(function ($form) { |
|
| 92 | + $forms = array_map(function($form) { |
|
| 93 | 93 | if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) { |
| 94 | - $sectionName = str_replace('<h2' . $regs['class'] . '>', '', $regs[0]); |
|
| 94 | + $sectionName = str_replace('<h2'.$regs['class'].'>', '', $regs[0]); |
|
| 95 | 95 | $sectionName = str_replace('</h2>', '', $sectionName); |
| 96 | 96 | $anchor = strtolower($sectionName); |
| 97 | 97 | $anchor = str_replace(' ', '-', $anchor); |
@@ -29,13 +29,13 @@ |
||
| 29 | 29 | |
| 30 | 30 | OC::$CLASSPATH['OC_Mount_Config'] = 'files_external/lib/config.php'; |
| 31 | 31 | |
| 32 | -require_once __DIR__ . '/../3rdparty/autoload.php'; |
|
| 32 | +require_once __DIR__.'/../3rdparty/autoload.php'; |
|
| 33 | 33 | |
| 34 | 34 | // register Application object singleton |
| 35 | 35 | \OC_Mount_Config::$app = new \OCA\Files_External\AppInfo\Application(); |
| 36 | 36 | $appContainer = \OC_Mount_Config::$app->getContainer(); |
| 37 | 37 | |
| 38 | -\OCA\Files\App::getNavigationManager()->add(function () { |
|
| 38 | +\OCA\Files\App::getNavigationManager()->add(function() { |
|
| 39 | 39 | $l = \OC::$server->getL10N('files_external'); |
| 40 | 40 | return [ |
| 41 | 41 | 'id' => 'extstoragemounts', |