本文整理汇总了PHP中OC_App::getForms方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_App::getForms方法的具体用法?PHP OC_App::getForms怎么用?PHP OC_App::getForms使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_App
的用法示例。
在下文中一共展示了OC_App::getForms方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array_map
$tmpl->assign('certs', $certificateManager->listCertificates());
$tmpl->assign('showCertificates', $enableCertImport);
$tmpl->assign('urlGenerator', $urlGenerator);
// Get array of group ids for this user
$groups = \OC::$server->getGroupManager()->getUserIdGroups(OC_User::getUser());
$groups2 = array_map(function ($group) {
return $group->getGID();
}, $groups);
sort($groups2);
$tmpl->assign('groups', $groups2);
// add hardcoded forms from the template
$l = \OC::$server->getL10N('settings');
$formsAndMore = [];
$formsAndMore[] = ['anchor' => 'avatar', 'section-name' => $l->t('Personal info')];
$formsAndMore[] = ['anchor' => 'clientsbox', 'section-name' => $l->t('Sync clients')];
$forms = OC_App::getForms('personal');
// add bottom hardcoded forms from the template
if ($enableCertImport) {
$certificatesTemplate = new OC_Template('settings', 'certificates');
$certificatesTemplate->assign('type', 'personal');
$certificatesTemplate->assign('uploadRoute', 'settings.Certificate.addPersonalRootCertificate');
$certificatesTemplate->assign('certs', $certificateManager->listCertificates());
$certificatesTemplate->assign('urlGenerator', $urlGenerator);
$forms[] = $certificatesTemplate->fetchPage();
}
$formsMap = array_map(function ($form) {
if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) {
$sectionName = str_replace('<h2' . $regs['class'] . '>', '', $regs[0]);
$sectionName = str_replace('</h2>', '', $sectionName);
$anchor = strtolower($sectionName);
$anchor = str_replace(' ', '-', $anchor);
示例2: getenv
$path = getenv('PATH');
$template->assign('getenvServerNotWorking', empty($path));
// warn if Windows is used
$template->assign('WindowsWarning', OC_Util::runningOnWindows());
// warn if outdated version of a memcache module is used
$caches = ['apcu' => ['name' => $l->t('APCu'), 'version' => '4.0.6'], 'redis' => ['name' => $l->t('Redis'), 'version' => '2.2.5']];
$outdatedCaches = [];
foreach ($caches as $php_module => $data) {
$isOutdated = extension_loaded($php_module) && version_compare(phpversion($php_module), $data['version'], '<');
if ($isOutdated) {
$outdatedCaches[$php_module] = $data;
}
}
$template->assign('OutdatedCacheWarning', $outdatedCaches);
// add hardcoded forms from the template
$forms = OC_App::getForms('admin');
$formsAndMore = array();
if ($request->getServerProtocol() !== 'https' || !OC_Util::isAnnotationsWorking() || $suggestedOverwriteCliUrl || !OC_Util::isSetLocaleWorking() || !OC_Util::fileInfoLoaded() || $databaseOverload) {
$formsAndMore[] = array('anchor' => 'security-warning', 'section-name' => $l->t('Security & setup warnings'));
}
$formsAndMore[] = array('anchor' => 'shareAPI', 'section-name' => $l->t('Sharing'));
$formsAndMore[] = ['anchor' => 'encryptionAPI', 'section-name' => $l->t('Server-side encryption')];
// Prioritize fileSharingSettings and files_external and move updater to the version
$fileSharingSettings = $filesExternal = $updaterAppPanel = $ocDefaultEncryptionModulePanel = '';
foreach ($forms as $index => $form) {
if (strpos($form, 'id="fileSharingSettings"')) {
$fileSharingSettings = $form;
unset($forms[$index]);
continue;
}
if (strpos($form, 'id="files_external"')) {
示例3: OC_Template
<?php
/**
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file.
*/
require_once '../lib/base.php';
OC_Util::checkLoggedIn();
OC_Util::addStyle('settings', 'settings');
OC_App::setActiveNavigationEntry('settings');
$tmpl = new OC_Template('settings', 'settings', 'user');
$forms = OC_App::getForms('settings');
$tmpl->assign('forms', array());
foreach ($forms as $form) {
$tmpl->append('forms', $form);
}
$tmpl->printPage();