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


PHP admin_externalpage_setup函数代码示例

本文整理汇总了PHP中admin_externalpage_setup函数的典型用法代码示例。如果您正苦于以下问题:PHP admin_externalpage_setup函数的具体用法?PHP admin_externalpage_setup怎么用?PHP admin_externalpage_setup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了admin_externalpage_setup函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setup

 /**
  * Special setup for docs page
  */
 public function setup()
 {
     global $CFG;
     if ($this->action == 'docs') {
         require_once $CFG->libdir . '/adminlib.php';
         admin_externalpage_setup('local_mr_docs');
     } else {
         parent::setup();
     }
 }
开发者ID:bgao-ca,项目名称:moodle-local_mr,代码行数:13,代码来源:default.php

示例2: run

 /**
  * Run controller action and render its view
  * 
  * @return void
  */
 public final function run()
 {
     // check if action exists
     $actionname = $this->action . '_action';
     if (!method_exists($this, $actionname)) {
         print_error('invalidpage');
     }
     // setup admin page and check page permission
     admin_externalpage_setup($this->pagename);
     $sitecontext = context_system::instance();
     // You do not have the required permission to access this page.
     if (!has_capability('moodle/site:config', $sitecontext)) {
         print_error('pagepermission');
     }
     // call the action
     $this->{$actionname}();
     // render request view
     $this->view->render($this->request);
 }
开发者ID:POETGroup,项目名称:moodle-local_globalmessage,代码行数:24,代码来源:controller.php

示例3: optional_param

<?php

//$Id: user_bulk_message.php,v 1.7 2008/06/09 16:53:57 skodak Exp $
require_once '../../config.php';
require_once $CFG->libdir . '/adminlib.php';
require_once $CFG->dirroot . '/message/lib.php';
require_once 'user_message_form.php';
$msg = optional_param('msg', '', PARAM_CLEAN);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
admin_externalpage_setup('userbulk');
require_capability('moodle/site:readallmessages', get_context_instance(CONTEXT_SYSTEM));
$return = $CFG->wwwroot . '/' . $CFG->admin . '/user/user_bulk.php';
if (empty($SESSION->bulk_users)) {
    redirect($return);
}
if (empty($CFG->messaging)) {
    print_error('messagingdisable', 'error');
}
//TODO: add support for large number of users
if ($confirm and !empty($msg) and confirm_sesskey()) {
    $in = implode(',', $SESSION->bulk_users);
    if ($rs = $DB->get_recordset_select('user', "id IN ({$in})", null)) {
        foreach ($rs as $user) {
            message_post_message($USER, $user, $msg, FORMAT_HTML, 'direct');
        }
        $rs->close();
    }
    redirect($return);
}
// disable html editor if not enabled in preferences
if (!get_user_preferences('message_usehtmleditor', 0)) {
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:user_bulk_message.php

示例4: array

    } else {
        $navlinks[] = array('name' => $fullname, 'link' => "{$CFG->wwwroot}/user/view.php?id={$userid}&amp;course={$courseid}", 'type' => 'misc');
        $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
        $navigation = build_navigation($navlinks);
        print_header("{$course->fullname}: {$fullname}", $course->fullname, $navigation, "", "", true, "&nbsp;", navmenu($course));
    }
    $showroles = 1;
    $currenttab = 'assign';
    include_once $CFG->dirroot . '/user/tabs.php';
} else {
    if ($context->contextlevel == CONTEXT_SYSTEM) {
        admin_externalpage_setup('assignroles', '', array('contextid' => $contextid, 'roleid' => $roleid));
        admin_externalpage_print_header('');
    } else {
        if ($context->contextlevel == CONTEXT_COURSE and $context->instanceid == SITEID) {
            admin_externalpage_setup('frontpageroles', '', array('contextid' => $contextid, 'roleid' => $roleid));
            admin_externalpage_print_header('');
            $currenttab = 'assign';
            include_once 'tabs.php';
        } else {
            $currenttab = 'assign';
            include_once 'tabs.php';
        }
    }
}
/// Process incoming role assignment
if ($frm = data_submitted()) {
    if ($add and !empty($frm->addselect) and confirm_sesskey()) {
        foreach ($frm->addselect as $adduser) {
            if (!($adduser = clean_param($adduser, PARAM_INT))) {
                continue;
开发者ID:kai707,项目名称:ITSA-backup,代码行数:31,代码来源:assign.php

示例5: optional_param

// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
/**
 * This script triggers a full purging of system caches,
 * this is useful mostly for developers who did not disable the caching.
 *
 * @package    core
 * @copyright  2010 Petr Skoda {@link http://skodak.org}
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
require_once '../config.php';
require_once $CFG->libdir . '/adminlib.php';
$confirm = optional_param('confirm', 0, PARAM_BOOL);
admin_externalpage_setup('purgecaches');
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
if ($confirm) {
    require_sesskey();
    // Valid request. Purge, and redisplay the form so it is easy to purge again
    // in the near future.
    purge_all_caches();
    redirect(new moodle_url('/admin/purgecaches.php'), get_string('purgecachesfinished', 'admin'));
} else {
    // Show a confirm form.
    echo $OUTPUT->header();
    echo $OUTPUT->heading(get_string('purgecaches', 'admin'));
    $url = new moodle_url('/admin/purgecaches.php', array('sesskey' => sesskey(), 'confirm' => 1));
    $button = new single_button($url, get_string('purgecaches', 'admin'), 'post');
    // Cancel button takes them back to the page the were on, if possible,
开发者ID:vuchannguyen,项目名称:web,代码行数:31,代码来源:purgecaches.php

示例6: optional_param

<?php

// $Id: maintenance.php,v 1.12 2007/04/30 17:08:44 skodak Exp $
// Enables/disables maintenance mode
require '../config.php';
require_once $CFG->libdir . '/adminlib.php';
$action = optional_param('action', '', PARAM_ALPHA);
admin_externalpage_setup('maintenancemode');
//Check folder exists
if (!make_upload_directory(SITEID)) {
    // Site folder
    error("Could not create site folder.  The site administrator needs to fix the file permissions");
}
$filename = $CFG->dataroot . '/' . SITEID . '/maintenance.html';
if ($form = data_submitted()) {
    if (confirm_sesskey()) {
        if ($form->action == "disable") {
            unlink($filename);
            redirect('maintenance.php', get_string('sitemaintenanceoff', 'admin'));
        } else {
            $file = fopen($filename, 'w');
            fwrite($file, stripslashes($form->text));
            fclose($file);
            redirect('maintenance.php', get_string('sitemaintenanceon', 'admin'));
        }
    }
}
/// Print the header stuff
admin_externalpage_print_header();
/// Print the appropriate form
if (file_exists($filename)) {
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:31,代码来源:maintenance.php

示例7: optional_param

 */
require '../config.php';
require_once $CFG->libdir . '/adminlib.php';
require_once $CFG->libdir . '/csvlib.class.php';
require_once $CFG->dirroot . '/user/profile/lib.php';
require_once $CFG->dirroot . '/group/lib.php';
require_once $CFG->dirroot . '/cohort/lib.php';
require_once 'uploaduserlib.php';
require_once 'uploaduser_form.php';
$iid = optional_param('iid', '', PARAM_INT);
$previewrows = optional_param('previewrows', 10, PARAM_INT);
@set_time_limit(60 * 60);
// 1 hour should be enough
raise_memory_limit(MEMORY_HUGE);
require_login();
admin_externalpage_setup('uploadusers');
require_capability('moodle/site:uploadusers', get_context_instance(CONTEXT_SYSTEM));
$struserrenamed = get_string('userrenamed', 'admin');
$strusernotrenamedexists = get_string('usernotrenamedexists', 'error');
$strusernotrenamedmissing = get_string('usernotrenamedmissing', 'error');
$strusernotrenamedoff = get_string('usernotrenamedoff', 'error');
$strusernotrenamedadmin = get_string('usernotrenamedadmin', 'error');
$struserupdated = get_string('useraccountupdated', 'admin');
$strusernotupdated = get_string('usernotupdatederror', 'error');
$strusernotupdatednotexists = get_string('usernotupdatednotexists', 'error');
$strusernotupdatedadmin = get_string('usernotupdatedadmin', 'error');
$struseruptodate = get_string('useraccountuptodate', 'admin');
$struseradded = get_string('newuser');
$strusernotadded = get_string('usernotaddedregistered', 'error');
$strusernotaddederror = get_string('usernotaddederror', 'error');
$struserdeleted = get_string('userdeleted', 'admin');
开发者ID:richheath,项目名称:moodle,代码行数:31,代码来源:uploaduser.php

示例8: admin_externalpage_setup

// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
/**
 * Event documentation.
 *
 * @package   report_eventlist
 * @copyright 2014 Adrian Greeve <adrian@moodle.com>
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
require_once __DIR__ . '/../../config.php';
require_once $CFG->libdir . '/adminlib.php';
admin_externalpage_setup('reporteventlists');
// Retrieve all events in a list.
$completelist = report_eventlist_list_generator::get_all_events_list();
$tabledata = array();
$components = array('0' => get_string('all', 'report_eventlist'));
$edulevel = array('0' => get_string('all', 'report_eventlist'));
$crud = array('0' => get_string('all', 'report_eventlist'));
foreach ($completelist as $value) {
    $components[] = $value['component'];
    $edulevel[] = $value['edulevel'];
    $crud[] = $value['crud'];
    $tabledata[] = (object) $value;
}
$components = array_unique($components);
$edulevel = array_unique($edulevel);
$crud = array_unique($crud);
开发者ID:evltuma,项目名称:moodle,代码行数:31,代码来源:index.php

示例9: build_navigation

        $navigation = build_navigation($navlinks);
        print_header($title, "{$fullname}", $navigation, "", "", true, "&nbsp;", navmenu($course));
        /// site header
    } else {
        $navlinks[] = array('name' => $fullname, 'link' => "{$CFG->wwwroot}/user/view.php?id={$userid}&amp;course={$courseid}", 'type' => 'misc');
        $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
        $navigation = build_navigation($navlinks);
        print_header($title, $course->fullname, $navigation, "", "", true, "&nbsp;", navmenu($course));
    }
    $showroles = 1;
    $currenttab = 'override';
    include_once $CFG->dirroot . '/user/tabs.php';
} else {
    if ($context->contextlevel == CONTEXT_COURSE and $context->instanceid == SITEID) {
        require_once $CFG->libdir . '/adminlib.php';
        admin_externalpage_setup('frontpageroles', '', array('contextid' => $contextid, 'roleid' => $roleid), $CFG->wwwroot . '/' . $CFG->admin . '/roles/override.php');
        admin_externalpage_print_header();
        $currenttab = 'override';
        include_once 'tabs.php';
    } else {
        $currenttab = 'override';
        include_once 'tabs.php';
    }
}
print_heading_with_help($title, 'overrides');
if ($roleid) {
    /// Show UI for overriding roles.
    if (!empty($capabilities)) {
        print_box(get_string('nocapabilitiesincontext', 'role'), 'generalbox boxaligncenter');
    } else {
        // Print the capabilities overrideable in this context
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:override.php

示例10: admin_externalpage_setup

// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
/**
 * Manage user profile fields.
 * @package core_user
 * @copyright  2007 onwards Shane Elliot {@link http://pukunui.com}
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
require '../../config.php';
require_once $CFG->libdir . '/adminlib.php';
require_once $CFG->dirroot . '/user/profile/lib.php';
require_once $CFG->dirroot . '/user/profile/definelib.php';
admin_externalpage_setup('profilefields');
$action = optional_param('action', '', PARAM_ALPHA);
$redirect = $CFG->wwwroot . '/user/profile/index.php';
$strchangessaved = get_string('changessaved');
$strcancelled = get_string('cancelled');
$strdefaultcategory = get_string('profiledefaultcategory', 'admin');
$strnofields = get_string('profilenofieldsdefined', 'admin');
$strcreatefield = get_string('profilecreatefield', 'admin');
// Do we have any actions to perform before printing the header.
switch ($action) {
    case 'movecategory':
        $id = required_param('id', PARAM_INT);
        $dir = required_param('dir', PARAM_ALPHA);
        if (confirm_sesskey()) {
            profile_move_category($id, $dir);
        }
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:31,代码来源:index.php

示例11: define

// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
/**
 * InnoDB conversion tool.
 *
 * @package    tool
 * @subpackage innodb
 * @copyright  1999 onwards Martin Dougiamas (http://dougiamas.com)
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
define('NO_OUTPUT_BUFFERING', true);
require_once '../../../config.php';
require_once $CFG->libdir . '/adminlib.php';
admin_externalpage_setup('toolinnodb');
$confirm = optional_param('confirm', 0, PARAM_BOOL);
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
echo $OUTPUT->header();
echo $OUTPUT->heading('Convert all MySQL tables from MYISAM to InnoDB');
if ($DB->get_dbfamily() != 'mysql') {
    notice('This function is for MySQL databases only!', new moodle_url('/admin/'));
}
if (data_submitted() and $confirm and confirm_sesskey()) {
    echo $OUTPUT->notification('Please be patient and wait for this to complete...', 'notifysuccess');
    if ($tables = $DB->get_tables()) {
        $DB->set_debug(true);
        foreach ($tables as $table) {
            $fulltable = $DB->get_prefix() . $table;
            $DB->change_database_structure("ALTER TABLE {$fulltable} ENGINE=INNODB");
开发者ID:nutanrajmalanai,项目名称:moodle,代码行数:31,代码来源:index.php

示例12: admin_externalpage_setup

<?php

//$Id$
///This file only manages the installation of 1.6 lang packs.
///in downloads.moodle.org, they are store in separate directory /lang16
///in local server, they are stored in $CFG->dataroot/lang
///This helps to avoid confusion.
require_once '../config.php';
require_once $CFG->libdir . '/adminlib.php';
require_once $CFG->libdir . '/filelib.php';
require_once $CFG->libdir . '/componentlib.class.php';
admin_externalpage_setup('langimport');
if (!empty($CFG->skiplangupgrade)) {
    admin_externalpage_print_header();
    print_box(get_string('langimportdisabled', 'admin'));
    print_footer();
    die;
}
$mode = optional_param('mode', 0, PARAM_INT);
//phase
$pack = optional_param('pack', array(), PARAM_FILE);
//pack to install
$displaylang = $pack;
$uninstalllang = optional_param('uninstalllang', '', PARAM_FILE);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$sitelang = optional_param('sitelangconfig', '', PARAM_FILE);
define('INSTALLATION_OF_SELECTED_LANG', 2);
define('DELETION_OF_SELECTED_LANG', 4);
define('UPDATE_ALL_LANG', 5);
$strlang = get_string('langimport', 'admin');
$strlanguage = get_string('language');
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:31,代码来源:langimport.php

示例13: admin_externalpage_setup

<?php

// Allows the admin to configure blocks (hide/show, delete and configure)
require_once '../config.php';
require_once $CFG->libdir . '/adminlib.php';
require_once $CFG->libdir . '/tablelib.php';
admin_externalpage_setup('manageblocks');
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$hide = optional_param('hide', 0, PARAM_INT);
$show = optional_param('show', 0, PARAM_INT);
$delete = optional_param('delete', 0, PARAM_INT);
$unprotect = optional_param('unprotect', 0, PARAM_INT);
$protect = optional_param('protect', 0, PARAM_INT);
/// Print headings
$strmanageblocks = get_string('manageblocks');
$strdelete = get_string('delete');
$strversion = get_string('version');
$strhide = get_string('hide');
$strshow = get_string('show');
$strsettings = get_string('settings');
$strcourses = get_string('blockinstances', 'admin');
$strname = get_string('name');
$strshowblockcourse = get_string('showblockcourse');
$strprotecthdr = get_string('blockprotect', 'admin') . $OUTPUT->help_icon('blockprotect', 'admin');
$strprotect = get_string('blockprotect', 'admin');
$strunprotect = get_string('blockunprotect', 'admin');
/// If data submitted, then process and store.
if (!empty($hide) && confirm_sesskey()) {
    if (!($block = $DB->get_record('block', array('id' => $hide)))) {
        print_error('blockdoesnotexist', 'error');
    }
开发者ID:JP-Git,项目名称:moodle,代码行数:31,代码来源:blocks.php

示例14: admin_externalpage_setup

<?php

if (!isset($CFG)) {
    require '../config.php';
    require_once $CFG->libdir . '/adminlib.php';
    admin_externalpage_setup('oacleanup');
    echo $OUTPUT->header();
    online_assignment_cleanup(true);
    echo $OUTPUT->footer();
}
function online_assignment_cleanup($output = false)
{
    global $CFG, $DB, $OUTPUT;
    if ($output) {
        echo $OUTPUT->heading('Online Assignment Cleanup');
        echo '<center>';
    }
    /// We don't want to run this code if we are doing an upgrade from an assignment
    /// version earlier than 2005041400
    /// because the assignment type field will not exist
    $amv = $DB->get_field('modules', 'version', array('name' => 'assignment'));
    if ((int) $amv < 2005041400) {
        if ($output) {
            echo '</center>';
        }
        return;
    }
    /// get the module id for assignments from db
    $arecord = $DB->get_record('modules', array('name', 'assignment'));
    $aid = $arecord->id;
    /// get a list of all courses on this site
开发者ID:saurabh947,项目名称:MoodleLearning,代码行数:31,代码来源:oacleanup.php

示例15: optional_param

$type = optional_param('type', '', PARAM_PLUGIN);
$downloadcontents = optional_param('downloadcontents', false, PARAM_BOOL);
$context = context_system::instance();
$pagename = 'repositorycontroller';
if ($edit) {
    $pagename = 'repositoryinstanceedit';
} else {
    if ($delete) {
        $pagename = 'repositorydelete';
    } else {
        if ($new) {
            $pagename = 'repositoryinstancenew';
        }
    }
}
admin_externalpage_setup($pagename, '', null, new moodle_url('/admin/repositoryinstances.php'));
require_capability('moodle/site:config', $context);
$baseurl = new moodle_url("/{$CFG->admin}/repositoryinstance.php", array('sesskey' => sesskey()));
$parenturl = new moodle_url("/{$CFG->admin}/repository.php", array('sesskey' => sesskey(), 'action' => 'edit'));
if ($new) {
    $parenturl->param('repos', $new);
} else {
    $parenturl->param('repos', $type);
}
$return = true;
if (!empty($edit) || !empty($new)) {
    if (!empty($edit)) {
        $instance = repository::get_instance($edit);
        $instancetype = repository::get_type_by_id($instance->options['typeid']);
        $classname = 'repository_' . $instancetype->get_typename();
        $configs = $instance->get_instance_option_names();
开发者ID:nmicha,项目名称:moodle,代码行数:31,代码来源:repositoryinstance.php


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