当前位置: 首页>>代码示例>>PHP>>正文


PHP OC_App::getForms方法代码示例

本文整理汇总了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);
开发者ID:nseps,项目名称:core,代码行数:31,代码来源:personal.php

示例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"')) {
开发者ID:WeatherellTechnology,项目名称:weatherstorm7,代码行数:31,代码来源:admin.php

示例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();
开发者ID:jaeindia,项目名称:ownCloud-Enhancements,代码行数:18,代码来源:settings.php


注:本文中的OC_App::getForms方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。