本文整理汇总了PHP中any_new_admin_settings函数的典型用法代码示例。如果您正苦于以下问题:PHP any_new_admin_settings函数的具体用法?PHP any_new_admin_settings怎么用?PHP any_new_admin_settings使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了any_new_admin_settings函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: any_new_admin_settings
/**
* Based on find_new_settings{@link ()} in upgradesettings.php
* Looks to find any admin settings that have not been initialized. Returns 1 if it finds any.
*
* @param object $node Instance of admin_category, or admin_settingpage
* @return boolean true if any settings haven't been initialised, false if they all have
*/
function any_new_admin_settings($node)
{
if ($node instanceof admin_category) {
$entries = array_keys($node->children);
foreach ($entries as $entry) {
if (any_new_admin_settings($node->children[$entry])) {
return true;
}
}
} else {
if ($node instanceof admin_settingpage) {
foreach ($node->settings as $setting) {
if ($setting->get_setting() === NULL) {
return true;
}
}
}
}
return false;
}
示例2: unset_config
if (empty($site->shortname)) {
// probably new installation - lets return to frontpage after this step
// remove settings that we want uninitialised
unset_config('registerauth');
redirect('upgradesettings.php?return=site');
}
// Check if we are returning from moodle.org registration and if so, we mark that fact to remove reminders
if (!empty($id) and $id == $CFG->siteidentifier) {
set_config('registered', time());
}
// setup critical warnings before printing admin tree block
$insecuredataroot = is_dataroot_insecure(true);
$SESSION->admin_critical_warning = $insecuredataroot == INSECURE_DATAROOT_ERROR;
$adminroot = admin_get_root();
// Check if there are any new admin settings which have still yet to be set
if (any_new_admin_settings($adminroot)) {
redirect('upgradesettings.php');
}
// Everything should now be set up, and the user is an admin
// Print default admin page with notifications.
$errorsdisplayed = defined('WARN_DISPLAY_ERRORS_ENABLED');
$lastcron = $DB->get_field_sql('SELECT MAX(lastcron) FROM {modules}');
$cronoverdue = $lastcron < time() - 3600 * 24;
$dbproblems = $DB->diagnose();
$maintenancemode = !empty($CFG->maintenance_enabled);
$updateschecker = available_update_checker::instance();
$availableupdates = $updateschecker->get_update_info('core', array('minmaturity' => $CFG->updateminmaturity, 'notifybuilds' => $CFG->updatenotifybuilds));
$availableupdatesfetch = $updateschecker->get_last_timefetched();
admin_externalpage_setup('adminnotifications');
if ($fetchupdates) {
require_sesskey();
示例3: any_new_admin_settings
/**
* Based on find_new_settings{@link ()} in upgradesettings.php
* Looks to find any admin settings that have not been initialized. Returns 1 if it finds any.
*
* @param string &$node The node at which to start searching.
* @return int Returns 1 if any settings haven't been initialised, 0 if they all have
*/
function any_new_admin_settings(&$node)
{
if (is_a($node, 'admin_category')) {
$entries = array_keys($node->children);
foreach ($entries as $entry) {
if (any_new_admin_settings($node->children[$entry])) {
return 1;
}
}
}
if (is_a($node, 'admin_settingpage')) {
foreach ($node->settings as $setting) {
if ($setting->get_setting() === NULL) {
return 1;
}
}
}
return 0;
}