• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP notice_yesno函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: print_header

 /**
  * Prints the page header.
  */
 function print_header()
 {
     global $CFG, $USER, $PAGE;
     require_once $CFG->libdir . '/blocklib.php';
     require_once $CFG->dirroot . '/course/lib.php';
     require_once $CFG->dirroot . '/my/pagelib.php';
     /// My Moodle arguments:
     $edit = optional_param('edit', -1, PARAM_BOOL);
     $blockaction = optional_param('blockaction', '', PARAM_ALPHA);
     $mymoodlestr = get_string('mymoodle', 'my');
     if (isguest()) {
         $wwwroot = $CFG->wwwroot . '/login/index.php';
         if (!empty($CFG->loginhttps)) {
             $wwwroot = str_replace('http:', 'https:', $wwwroot);
         }
         print_header($mymoodlestr);
         notice_yesno(get_string('noguest', 'my') . '<br /><br />' . get_string('liketologin'), $wwwroot, $CFG->wwwroot);
         print_footer();
         die;
     }
     /// Add curriculum stylesheets...
     if (file_exists($CFG->dirroot . '/curriculum/styles.css')) {
         $CFG->stylesheets[] = $CFG->wwwroot . '/curriculum/styles.css';
     }
     /// Fool the page library into thinking we're in My Moodle.
     $CFG->pagepath = $CFG->wwwroot . '/my/index.php';
     $PAGE = page_create_instance($USER->id);
     if ($section = optional_param('section', '', PARAM_ALPHAEXT)) {
         $PAGE->section = $section;
     }
     $this->pageblocks = blocks_setup($PAGE, BLOCKS_PINNED_BOTH);
     /// Make sure that the curriculum block is actually on this
     /// user's My Moodle page instance.
     if ($cablockid = get_field('block', 'id', 'name', 'curr_admin')) {
         if (!record_exists('block_pinned', 'blockid', $cablockid, 'pagetype', 'my-index')) {
             blocks_execute_action($PAGE, $this->pageblocks, 'add', (int) $cablockid, true, false);
         }
     }
     if ($edit != -1 and $PAGE->user_allowed_editing()) {
         $USER->editing = $edit;
     }
     //$PAGE->print_header($mymoodlestr);
     $title = $this->get_title();
     print_header($title, $title, build_navigation($this->get_navigation()));
     echo '<table border="0" cellpadding="3" cellspacing="0" width="100%" id="layout-table">';
     echo '<tr valign="top">';
     $blocks_preferred_width = bounded_number(180, blocks_preferred_width($this->pageblocks[BLOCK_POS_LEFT]), 210);
     if (blocks_have_content($this->pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing()) {
         echo '<td style="vertical-align: top; width: ' . $blocks_preferred_width . 'px;" id="left-column">';
         blocks_print_group($PAGE, $this->pageblocks, BLOCK_POS_LEFT);
         echo '</td>';
     }
     echo '<td valign="top" id="middle-column">';
     if (blocks_have_content($this->pageblocks, BLOCK_POS_CENTRE) || $PAGE->user_is_editing()) {
         blocks_print_group($PAGE, $this->pageblocks, BLOCK_POS_CENTRE);
     }
 }
开发者ID:remotelearner,项目名称:elis.cm,代码行数:60,代码来源:newpage.class.php


示例2: print_entry

 /**
 * Prints the entry form/page for this enrolment
 *
 * This is only called from course/enrol.php
 * Most plugins will probably override this to print payment 
 * forms etc, or even just a notice to say that manual enrolment 
 * is disabled
 *
 * @param    course  current course object
 */
 function print_entry($course)
 {
     global $CFG, $USER, $SESSION, $THEME;
     $strloginto = get_string('loginto', '', $course->shortname);
     $strcourses = get_string('courses');
     /// Automatically enrol into courses without password
     $context = get_context_instance(CONTEXT_SYSTEM, SITEID);
     if ($course->password == '') {
         // no password, so enrol
         if (has_capability('moodle/legacy:guest', $context, $USER->id, false)) {
             add_to_log($course->id, 'course', 'guest', 'view.php?id=' . $course->id, getremoteaddr());
         } else {
             if (empty($_GET['confirm']) && empty($_GET['cancel'])) {
                 print_header($strloginto, $course->fullname, "<a href=\".\">{$strcourses}</a> -> {$strloginto}");
                 echo '<br />';
                 notice_yesno(get_string('enrolmentconfirmation'), "enrol.php?id={$course->id}&amp;confirm=1", "enrol.php?id={$course->id}&amp;cancel=1");
                 print_footer();
                 exit;
             } else {
                 if (!empty($_GET['confirm'])) {
                     if (!enrol_into_course($course, $USER, 'manual')) {
                         print_error('couldnotassignrole');
                     }
                     if (!empty($SESSION->wantsurl)) {
                         $destination = $SESSION->wantsurl;
                         unset($SESSION->wantsurl);
                     } else {
                         $destination = "{$CFG->wwwroot}/course/view.php?id={$course->id}";
                     }
                     redirect($destination);
                 } else {
                     if (!empty($_GET['cancel'])) {
                         unset($SESSION->wantsurl);
                         if (!empty($SESSION->enrolcancel)) {
                             $destination = $SESSION->enrolcancel;
                             unset($SESSION->enrolcancel);
                         } else {
                             $destination = $CFG->wwwroot;
                         }
                         redirect($destination);
                     }
                 }
             }
         }
     }
     // if we get here we are going to display the form asking for the enrolment key
     // and (hopefully) provide information about who to ask for it.
     if (!isset($password)) {
         $password = '';
     }
     print_header($strloginto, $course->fullname, "<a href=\".\">{$strcourses}</a> -> {$strloginto}", "form.password");
     print_course($course, "80%");
     include "{$CFG->dirroot}/enrol/manual/enrol.html";
     print_footer();
 }
开发者ID:veritech,项目名称:pare-project,代码行数:65,代码来源:enrol.php


示例3: user_message_form

if (!get_user_preferences('message_usehtmleditor', 0)) {
    $CFG->htmleditor = '';
}
$msgform = new user_message_form('user_bulk_message.php');
if ($msgform->is_cancelled()) {
    redirect($return);
} else {
    if ($formdata = $msgform->get_data()) {
        $options = new object();
        $options->para = false;
        $options->newlines = true;
        $options->smiley = false;
        $msg = format_text($formdata->messagebody, $formdata->format, $options);
        $in = implode(',', $SESSION->bulk_users);
        $userlist = $DB->get_records_select_menu('user', "id IN ({$in})", null, 'fullname', 'id,' . $DB->sql_fullname() . ' AS fullname');
        $usernames = implode(', ', $userlist);
        $optionsyes = array();
        $optionsyes['confirm'] = 1;
        $optionsyes['sesskey'] = sesskey();
        $optionsyes['msg'] = $msg;
        admin_externalpage_print_header();
        print_heading(get_string('confirmation', 'admin'));
        print_box($msg, 'boxwidthnarrow boxaligncenter generalbox', 'preview');
        notice_yesno(get_string('confirmmessage', 'bulkusers', $usernames), 'user_bulk_message.php', 'user_bulk.php', $optionsyes, NULL, 'post', 'get');
        admin_externalpage_print_footer();
        die;
    }
}
admin_externalpage_print_header();
$msgform->display();
admin_externalpage_print_footer();
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:user_bulk_message.php


示例4: confirm_sesskey

<?php

// $Id: confirmdelete.php,v 1.6 2007/10/09 21:43:30 iarenaza Exp $
/**
 * Action for confirming the deletion of a page
 *
 * @version $Id: confirmdelete.php,v 1.6 2007/10/09 21:43:30 iarenaza Exp $
 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
 * @package lesson
 **/
confirm_sesskey();
$pageid = required_param('pageid', PARAM_INT);
if (!($thispage = get_record("lesson_pages", "id", $pageid))) {
    error("Confirm delete: the page record not found");
}
print_heading(get_string("deletingpage", "lesson", format_string($thispage->title)));
// print the jumps to this page
if ($answers = get_records_select("lesson_answers", "lessonid = {$lesson->id} AND jumpto = {$pageid} + 1")) {
    print_heading(get_string("thefollowingpagesjumptothispage", "lesson"));
    echo "<p align=\"center\">\n";
    foreach ($answers as $answer) {
        if (!($title = get_field("lesson_pages", "title", "id", $answer->pageid))) {
            error("Confirm delete: page title not found");
        }
        echo $title . "<br />\n";
    }
}
notice_yesno(get_string("confirmdeletionofthispage", "lesson"), "lesson.php?action=delete&amp;id={$cm->id}&amp;pageid={$pageid}&amp;sesskey=" . $USER->sesskey, "view.php?id={$cm->id}");
开发者ID:kai707,项目名称:ITSA-backup,代码行数:28,代码来源:confirmdelete.php


示例5: clearfilelist

             }
         }
         clearfilelist();
         displaydir($wdir);
         html_footer();
     } else {
         html_header($course, $wdir);
         if (setfilelist($_POST)) {
             echo "<p align=center>" . get_string("deletecheckwarning") . ":</p>";
             print_simple_box_start("center");
             printfilelist($USER->filelist);
             print_simple_box_end();
             echo "<br />";
             $frameold = $CFG->framename;
             $CFG->framename = "ibrowser";
             notice_yesno(get_string("deletecheckfiles"), "coursefiles.php?id={$id}&amp;wdir={$wdir}&amp;action=delete&amp;confirm=1&amp;sesskey={$USER->sesskey}", "coursefiles.php?id={$id}&amp;wdir={$wdir}&amp;action=cancel");
             $CFG->framename = $frameold;
         } else {
             displaydir($wdir);
         }
         html_footer();
     }
     break;
 case "move":
     html_header($course, $wdir);
     if ($count = setfilelist($_POST) and confirm_sesskey()) {
         $USER->fileop = $action;
         $USER->filesource = $wdir;
         echo "<p align=\"center\">";
         print_string("selectednowmove", "moodle", $count);
         echo "</p>";
开发者ID:r007,项目名称:PMoodle,代码行数:31,代码来源:coursefiles.php


示例6: repository_exception

    if (!empty($delete)) {
        // admin_externalpage_print_header();
        $instance = repository::get_instance($delete);
        //if you try to delete an instance set as readonly, display an error message
        if ($instance->readonly) {
            throw new repository_exception('readonlyinstance', 'repository');
        }
        if ($sure) {
            if (!confirm_sesskey()) {
                print_error('confirmsesskeybad', '', $baseurl);
            }
            if ($instance->delete()) {
                $deletedstr = get_string('instancedeleted', 'repository');
                print_heading($deletedstr);
                redirect($baseurl, $deletedstr, 3);
            } else {
                print_error('instancenotdeleted', 'repository', $baseurl);
            }
            exit;
        }
        notice_yesno(get_string('confirmdelete', 'repository', $instance->name), $baseurl . '&amp;delete=' . $delete . '&amp;sure=yes', $baseurl);
        $return = false;
    } else {
        repository::display_instances_list($context);
        $return = false;
    }
}
if (!empty($return)) {
    redirect($baseurl);
}
print_footer($course);
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:manage_instances.php


示例7: error

                 error(get_string("couldnotdeletereplies", "forum"), forum_go_back_to("discuss.php?d={$post->discussion}"));
             }
             print_header();
             notice_yesno(get_string("deletesureplural", "forum", $replycount + 1), "post.php?delete={$delete}&amp;confirm={$delete}&amp;sesskey=" . sesskey(), $CFG->wwwroot . '/mod/forum/discuss.php?d=' . $post->discussion . '#p' . $post->id);
             forum_print_post($post, $course->id, $ownpost = false, $reply = false, $link = false);
             if (empty($post->edit)) {
                 if (forum_tp_can_track_forums($forum) && forum_tp_is_tracked($forum)) {
                     $user_read_array = forum_tp_get_discussion_read_records($USER->id, $discussion->id);
                 } else {
                     $user_read_array = array();
                 }
                 forum_print_posts_nested($post->id, $course->id, false, false, $user_read_array, $forum->id);
             }
         } else {
             print_header();
             notice_yesno(get_string("deletesure", "forum", $replycount), "post.php?delete={$delete}&amp;confirm={$delete}&amp;sesskey=" . sesskey(), $CFG->wwwroot . '/mod/forum/discuss.php?d=' . $post->discussion . '#p' . $post->id);
             forum_print_post($post, $forum->course, $ownpost = false, $reply = false, $link = false);
         }
     }
     print_footer($course);
     die;
 } else {
     if (!empty($prune)) {
         // Pruning
         if (!($post = forum_get_post_full($prune))) {
             error("Post ID was incorrect");
         }
         if (!($discussion = get_record("forum_discussions", "id", $post->discussion))) {
             error("This post is not part of a discussion!");
         }
         if (!($forum = get_record("forum", "id", $discussion->forum))) {
开发者ID:veritech,项目名称:pare-project,代码行数:31,代码来源:post.php


示例8: print_error

}
if (empty($CFG->enablenotes)) {
    print_error('notesdisabled', 'notes');
}
if (data_submitted() && confirm_sesskey()) {
    //if data was submitted and is valid, then delete note
    $returnurl = $CFG->wwwroot . '/notes/index.php?course=' . $course->id . '&amp;user=' . $note->userid;
    if (note_delete($noteid)) {
        add_to_log($note->courseid, 'notes', 'delete', 'index.php?course=' . $note->courseid . '&amp;user=' . $note->userid . '#note-' . $note->id, 'delete note');
    } else {
        print_error('cannotdeletepost', 'notes', $returnurl);
    }
    redirect($returnurl);
} else {
    // if data was not submitted yet, then show note data with a delete confirmation form
    $strnotes = get_string('notes', 'notes');
    $optionsyes = array('id' => $noteid, 'sesskey' => sesskey());
    $optionsno = array('course' => $course->id, 'user' => $note->userid);
    // output HTML
    if (has_capability('moodle/course:viewparticipants', $context) || has_capability('moodle/site:viewparticipants', get_context_instance(CONTEXT_SYSTEM))) {
        $nav[] = array('name' => get_string('participants'), 'link' => $CFG->wwwroot . '/user/index.php?id=' . $course->id, 'type' => 'misc');
    }
    $nav[] = array('name' => fullname($user), 'link' => $CFG->wwwroot . '/user/view.php?id=' . $user->id . '&amp;course=' . $course->id, 'type' => 'misc');
    $nav[] = array('name' => get_string('notes', 'notes'), 'link' => $CFG->wwwroot . '/notes/index.php?course=' . $course->id . '&amp;user=' . $user->id, 'type' => 'misc');
    $nav[] = array('name' => get_string('delete'), 'link' => '', 'type' => 'activity');
    print_header($course->shortname . ': ' . $strnotes, $course->fullname, build_navigation($nav));
    notice_yesno(get_string('deleteconfirm', 'notes'), 'delete.php', 'index.php', $optionsyes, $optionsno, 'post', 'get');
    echo '<br />';
    note_print($note, NOTES_SHOW_BODY | NOTES_SHOW_HEAD);
    print_footer();
}
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:31,代码来源:delete.php


示例9: object

            // something is wrong here, try again
        }
        $updatedcomment = new object();
        $updatedcomment->id = $formadata->commentid;
        $updatedcomment->content = $formadata->content;
        $updatedcomment->format = $formadata->format;
        $updatedcomment->modified = time();
        if ($DB->update_record('data_comments', $updatedcomment)) {
            redirect('view.php?rid=' . $record->id . '&amp;page=' . $page);
        } else {
            print_error('cannotsavecomment');
        }
        break;
    case 'delete':
        //deletes single comment from db
        if ($confirm and confirm_sesskey() and $comment) {
            $DB->delete_records('data_comments', array('id' => $comment->id));
            redirect('view.php?rid=' . $record->id . '&amp;page=' . $page, get_string('commentdeleted', 'data'));
        } else {
            //print confirm delete form
            print_header();
            data_print_comment($data, $comment, $page);
            notice_yesno(get_string('deletecomment', 'data'), 'comment.php?rid=' . $record->id . '&amp;commentid=' . $comment->id . '&amp;page=' . $page . '&amp;sesskey=' . sesskey() . '&amp;mode=delete&amp;confirm=1', 'view.php?rid=' . $record->id . '&amp;page=' . $page);
            print_footer();
        }
        die;
        break;
}
print_header();
data_print_comments($data, $record, $page, $mform);
print_footer();
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:comment.php


示例10: redirect

}
if (!($site = get_site())) {
    redirect("index.php");
}
/// Turn off time limits, sometimes upgrades can be slow.
@set_time_limit(0);
@ob_implicit_flush(true);
while (@ob_end_flush()) {
}
/// Print header
$strupgradinglogs = get_string("upgradinglogs", "admin");
admin_externalpage_print_header($adminroot);
print_heading($strupgradinglogs);
if (!data_submitted() or empty($confirm) or !confirm_sesskey()) {
    $optionsyes = array('confirm' => '1', 'sesskey' => sesskey());
    notice_yesno(get_string('upgradeforumreadinfo', 'admin'), 'upgradelogs.php', 'index.php', $optionsyes, NULL, 'post', 'get');
    admin_externalpage_print_footer($adminroot);
    exit;
}
/// Try and extract as many cmids as possible from the existing logs
if ($coursemodules = get_records_sql("SELECT cm.*, m.name\n                                            FROM {$CFG->prefix}course_modules cm,\n                                                 {$CFG->prefix}modules m\n                                            WHERE cm.module = m.id")) {
    $cmcount = count($coursemodules);
    $count = 0;
    $starttime = time();
    $sleeptime = 0;
    $LIKE = sql_ilike();
    if ($cmcount > 10) {
        print_simple_box('This process may take a very long time ... please be patient and let it finish.', 'center', '', '#ffcccc');
        $sleeptime = 1;
    }
    foreach ($coursemodules as $cm) {
开发者ID:veritech,项目名称:pare-project,代码行数:31,代码来源:upgradelogs.php


示例11: delete_file

 function delete_file()
 {
     global $CFG;
     $file = required_param('file', PARAM_FILE);
     $userid = required_param('userid', PARAM_INT);
     $confirm = optional_param('confirm', 0, PARAM_BOOL);
     $mode = optional_param('mode', '', PARAM_ALPHA);
     $offset = optional_param('offset', 0, PARAM_INT);
     require_login($this->course->id, false, $this->cm);
     if (empty($mode)) {
         $urlreturn = 'view.php';
         $optionsreturn = array('id' => $this->cm->id);
         $returnurl = 'view.php?id=' . $this->cm->id;
     } else {
         $urlreturn = 'submissions.php';
         $optionsreturn = array('id' => $this->cm->id, 'offset' => $offset, 'mode' => $mode, 'userid' => $userid);
         $returnurl = "submissions.php?id={$this->cm->id}&amp;offset={$offset}&amp;mode={$mode}&amp;userid={$userid}";
     }
     if (!($submission = $this->get_submission($userid)) or !$this->can_delete_files($submission)) {
         // can not delete
         $this->view_header(get_string('delete'));
         notify(get_string('cannotdeletefiles', 'assignment'));
         print_continue($returnurl);
         $this->view_footer();
         die;
     }
     $dir = $this->file_area_name($userid);
     if (!data_submitted('nomatch') or !$confirm or !confirm_sesskey()) {
         $optionsyes = array('id' => $this->cm->id, 'file' => $file, 'userid' => $userid, 'confirm' => 1, 'sesskey' => sesskey(), 'mode' => $mode, 'offset' => $offset, 'sesskey' => sesskey());
         if (empty($mode)) {
             $this->view_header(get_string('delete'));
         } else {
             print_header(get_string('delete'));
         }
         print_heading(get_string('delete'));
         notice_yesno(get_string('confirmdeletefile', 'assignment', $file), 'delete.php', $urlreturn, $optionsyes, $optionsreturn, 'post', 'get');
         if (empty($mode)) {
             $this->view_footer();
         } else {
             print_footer('none');
         }
         die;
     }
     $filepath = $CFG->dataroot . '/' . $dir . '/' . $file;
     if (file_exists($filepath)) {
         if (@unlink($filepath)) {
             $updated = new object();
             $updated->id = $submission->id;
             $updated->timemodified = time();
             if (update_record('assignment_submissions', $updated)) {
                 add_to_log($this->course->id, 'assignment', 'upload', 'view.php?a=' . $this->assignment->id, $this->assignment->id, $this->cm->id);
                 $submission = $this->get_submission($userid);
                 $this->update_grade($submission);
             }
             redirect($returnurl);
         }
     }
     // print delete error
     if (empty($mode)) {
         $this->view_header(get_string('delete'));
     } else {
         print_header(get_string('delete'));
     }
     notify(get_string('deletefilefailed', 'assignment'));
     print_continue($returnurl);
     if (empty($mode)) {
         $this->view_footer();
     } else {
         print_footer('none');
     }
     die;
 }
开发者ID:NextEinstein,项目名称:riverhills,代码行数:72,代码来源:assignment.class.php


示例12: displaydir

        } else {
            displaydir($wdir);
        }
        html_footer();
        break;
    case "restore":
        html_header($course, $wdir);
        if ($file != '' and confirm_sesskey()) {
            echo "<p align=\"center\">" . get_string("youaregoingtorestorefrom") . ":</p>";
            print_simple_box_start("center");
            echo $file;
            print_simple_box_end();
            echo "<br />";
            echo "<p align=\"center\">" . get_string("areyousuretorestorethisinfo") . "</p>";
            $restore_path = "{$CFG->wwwroot}/backup/restore.php";
            notice_yesno(get_string("areyousuretorestorethis"), $restore_path . "?id=" . $id . "&amp;file=" . cleardoubleslashes($id . $wdir . "/" . $file) . "&amp;method=manual", "index.php?id={$id}&amp;wdir={$wdir}&amp;action=cancel");
        } else {
            displaydir($wdir);
        }
        html_footer();
        break;
    case "cancel":
        clearfilelist();
    default:
        html_header($course, $wdir);
        displaydir($wdir);
        html_footer();
        break;
}
/// FILE FUNCTIONS ///////////////////////////////////////////////////////////
function setfilelist($VARS)
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:31,代码来源:index.php


示例13: unset

    $USER->policyagreed = 1;
    if (!empty($SESSION->wantsurl)) {
        $wantsurl = $SESSION->wantsurl;
        unset($SESSION->wantsurl);
        redirect($wantsurl);
    } else {
        redirect($CFG->wwwroot . '/');
    }
    exit;
}
$strpolicyagree = get_string('policyagree');
$strpolicyagreement = get_string('policyagreement');
$strpolicyagreementclick = get_string('policyagreementclick');
print_header($strpolicyagreement, $SITE->fullname, build_navigation(array(array('name' => $strpolicyagreement, 'link' => null, 'type' => 'misc'))));
print_heading($strpolicyagreement);
$mimetype = mimeinfo('type', $CFG->sitepolicy);
if ($mimetype == 'document/unknown') {
    //fallback for missing index.php, index.html
    $mimetype = 'text/html';
}
echo '<div class="noticebox">';
echo '<object id="policyframe" data="' . $CFG->sitepolicy . '" type="' . $mimetype . '">';
// we can not use our popups here, because the url may be arbitrary, see MDL-9823
echo '<a href="' . $CFG->sitepolicy . '" onclick="this.target=\'_blank\'">' . $strpolicyagreementclick . '</a>';
echo '</object></div>';
$linkyes = 'policy.php';
$optionsyes = array('agree' => 1, 'sesskey' => sesskey());
$linkno = $CFG->wwwroot . '/login/logout.php';
$optionsno = array('sesskey' => sesskey());
notice_yesno($strpolicyagree, $linkyes, $linkno, $optionsyes, $optionsno);
print_footer();
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:policy.php


示例14: redirect

    $forum = $discussion->get_forum();
    $cm = $forum->get_course_module();
    $course = $forum->get_course();
    // Check permission for change
    $discussion->require_edit();
    // Is this the actual delete?
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        if ($delete) {
            $discussion->delete();
            redirect($forum->get_url(forum::PARAM_PLAIN));
        } else {
            $discussion->undelete();
            redirect('../../discuss.php?' . $discussion->get_link_params(forum::PARAM_PLAIN));
        }
    }
    // Confirm page. Work out navigation for header
    $pagename = get_string($delete ? 'deletediscussion' : 'undeletediscussion', 'forumng', $discussion->get_subject(false));
    $navigation = array();
    $navigation[] = array('name' => shorten_text(htmlspecialchars($discussion->get_subject())), 'link' => $discussion->get_url(), 'type' => 'forumng');
    $navigation[] = array('name' => $pagename, 'type' => 'forumng');
    $PAGEWILLCALLSKIPMAINDESTINATION = true;
    print_header_simple(format_string($forum->get_name()) . ': ' . $pagename, "", build_navigation($navigation, $cm), "", "", true, '', navmenu($course, $cm));
    print skip_main_destination();
    // Show confirm option
    $confirmstring = get_string($delete ? 'confirmdeletediscussion' : 'confirmundeletediscussion', 'forumng');
    notice_yesno($confirmstring, 'delete.php', '../../discuss.php', array('d' => $discussion->get_id(), 'delete' => $delete, 'clone' => $cloneid), array('d' => $discussion->get_id(), 'clone' => $cloneid), 'post', 'get');
    // Display footer
    print_footer($course);
} catch (forum_exception $e) {
    forum_utils::handle_exception($e);
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:31,代码来源:delete.php


示例15: get_string

}
$strblogs = get_string('blogs', 'blog');
if ($action == 'delete') {
    if (!$existing) {
        error('Incorrect blog post id');
    }
    if (data_submitted() and $confirm and confirm_sesskey()) {
        do_delete($existing);
        redirect($returnurl);
    } else {
        $optionsyes = array('id' => $id, 'action' => 'delete', 'confirm' => 1, 'sesskey' => sesskey(), 'courseid' => $courseid);
        $optionsno = array('userid' => $existing->userid, 'courseid' => $courseid);
        print_header("{$SITE->shortname}: {$strblogs}", $SITE->fullname);
        blog_print_entry($existing);
        echo '<br />';
        notice_yesno(get_string('blogdeleteconfirm', 'blog'), 'edit.php', 'index.php', $optionsyes, $optionsno, 'post', 'get');
        print_footer();
        die;
    }
}
require_once 'edit_form.php';
$blogeditform = new blog_edit_form(null, compact('existing', 'sitecontext'));
if ($blogeditform->is_cancelled()) {
    redirect($returnurl);
} else {
    if ($blogeditform->no_submit_button_pressed()) {
        no_submit_button_actions($blogeditform, $sitecontext);
    } else {
        if ($fromform = $blogeditform->get_data()) {
            //save stuff in db
            switch ($action) {
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:31,代码来源:edit.php


示例16: question_showbank

/**
 * Shows the question bank editing interface.
 *
 * The function also processes a number of actions:
 *
 * Actions affecting the question pool:
 * move           Moves a question to a different category
 * deleteselected Deletes the selected questions from the category
 * Other actions:
 * category      Chooses the category
 * displayoptions Sets display options
 *
 * @author Martin Dougiamas and many others. This has recently been extensively
 *         rewritten by Gustav Delius and other members of the Serving Mathematics project
 *         {@link http://maths.york.ac.uk/serving_maths}
 * @param moodle_url $pageurl object representing this pages url.
 */
function question_showbank($tabname, $contexts, $pageurl, $cm, $page, $perpage, $sortorder, $sortorderdecoded, $cat, $recurse, $showhidden, $showquestiontext)
{
    global $COURSE;
    if (optional_param('deleteselected', false, PARAM_BOOL)) {
        // teacher still has to confirm
        // make a list of all the questions that are selected
        $rawquestions = $_REQUEST;
        // This code is called by both POST forms and GET links, so cannot use data_submitted.
        $questionlist = '';
        // comma separated list of ids of questions to be deleted
        $questionnames = '';
        // string with names of questions separated by <br /> with
        // an asterix in front of those that are in use
        $inuse = false;
        // set to true if at least one of the questions is in use
        foreach ($rawquestions as $key => $value) {
            // Parse input for question ids
            if (preg_match('!^q([0-9]+)$!', $key, $matches)) {
                $key = $matches[1];
                $questionlist .= $key . ',';
                question_require_capability_on($key, 'edit');
                if (record_exists('quiz_question_instances', 'question', $key)) {
                    $questionnames .= '* ';
                    $inuse = true;
                }
                $questionnames .= get_field('question', 'name', 'id', $key) . '<br />';
            }
        }
        if (!$questionlist) {
            // no questions were selected
            redirect($pageurl->out());
        }
        $questionlist = rtrim($questionlist, ',');
        // Add an explanation about questions in use
        if ($inuse) {
            $questionnames .= '<br />' . get_string('questionsinuse', 'quiz');
        }
        notice_yesno(get_string("deletequestionscheck", "quiz", $questionnames), $pageurl->out_action(), $pageurl->out(true), array('deleteselected' => $questionlist, 'confirm' => md5($questionlist)), $pageurl->params(), 'post', 'get');
        echo '</td></tr>';
        echo '</table>';
        print_footer($COURSE);
        exit;
    }
    // starts with category selection form
    print_box_start('generalbox questionbank');
    print_heading(get_string('questionbank', 'question'), '', 2);
    question_category_form($contexts->having_one_edit_tab_cap($tabname), $pageurl, $cat, $recurse, $showhidden, $showquestiontext);
    // continues with list of questions
    question_list($contexts->having_one_edit_tab_cap($tabname), $pageurl, $cat, isset($cm) ? $cm : null, $recurse, $page, $perpage, $showhidden, $sortorder, $sortorderdecoded, $showquestiontext, $contexts->having_cap('moodle/question:add'));
    print_box_end();
}
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:68,代码来源:editlib.php


示例17: notify

                         break;
                 }
             } else {
                 notify('Had an unspecified error with the component installer, sorry.');
             }
         }
     }
     break;
 case DELETION_OF_SELECTED_LANG:
     //delete a directory(ies) containing a lang pack completely
     if ($uninstalllang == 'en_utf8') {
         $notice_error[] = 'en_utf8 can not be uninstalled!';
     } else {
         if (!$confirm && confirm_sesskey()) {
             admin_externalpage_print_header();
             notice_yesno(get_string('uninstallconfirm', 'admin', $uninstalllang), 'langimport.php?mode=' . DELETION_OF_SELECTED_LANG . '&amp;uninstalllang=' . $uninstalllang . '&amp;confirm=1&amp;sesskey=' . sesskey(), 'langimport.php');
             print_footer();
             die;
         } else {
             if (confirm_sesskey()) {
                 $dest1 = $CFG->dataroot . '/lang/' . $uninstalllang;
                 $dest2 = $CFG->dirroot . '/lang/' . $uninstalllang;
                 $rm1 = false;
                 $rm2 = false;
                 if (file_exists($dest1)) {
                     $rm1 = remove_dir($dest1);
                 }
                 if (file_exists($dest2)) {
                     $rm2 = remove_dir($dest2);
                 }
                 get_list_of_languages(true);
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:31,代码来源:langimport.php


示例18: error

    error('Course is misconfigured');
}
if (!($glossary = get_record('glossary', 'id', $cm->instance))) {
    error('Course module is incorrect');
}
$strglossaries = get_string('modulenameplural', 'glossary');
$entryalreadyexist = get_string('entryalreadyexist', 'glossary');
$entryexported = get_string('entryexported', 'glossary');
$navigation = build_navigation('', $cm);
print_header_simple(format_string($glossary->name), '', $navigation, '', '', true, '', navmenu($course, $cm));
if ($PermissionGranted) {
    $entry = get_record('glossary_entries', 'id', $entry);
    if (!$confirm) {
        echo '<div class="boxaligncenter">';
        $areyousure = get_string('areyousureexport', 'glossary');
        notice_yesno('<h2>' . format_string($entry->concept) . '</h2><p align="center">' . $areyousure . '<br /><b>' . format_string($mainglossary->name) . '</b>?', 'exportentry.php?id=' . $id . '&amp;mode=' . $mode . '&amp;hook=' . $hook . '&amp;entry=' . $entry->id . '&amp;confirm=1', 'view.php?id=' . $cm->id . '&amp;mode=' . $mode . '&amp;hook=' . $hook);
        echo '</div>';
    } else {
        if (!$mainglossary->allowduplicatedentries) {
            $dupentry = get_record('glossary_entries', 'glossaryid', $mainglossary->id, 'lower(concept)', moodle_strtolower(addslashes($entry->concept)));
            if ($dupentry) {
                $PermissionGranted = 0;
            }
        }
        if ($PermissionGranted) {
            $dbentry = new stdClass();
            $dbentry->id = $entry->id;
            $dbentry->glossaryid = $mainglossary->id;
            $dbentry->sourceglossaryid = $glossary->id;
            if (!update_record('glossary_entries', $dbentry)) {
                error('Could not export the entry to the main glossary');
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:31,代码来源:exportentry.php


示例19: dirname

<?php

// $Id: index.php,v 1.28 2009/05/06 09:29:06 tjhunt Exp $
// this is the 'my moodle' page
require_once dirname(__FILE__) . '/../config.php';
require_once $CFG->dirroot . '/course/lib.php';
require_login();
$strmymoodle = get_string('mymoodle', 'my');
if (isguest()) {
    print_header($strmymoodle);
    notice_yesno(get_string('noguest', 'my') . '<br /><br />' . get_string('liketologin'), get_login_url(), $CFG->wwwroot);
    print_footer();
    die;
}
$edit = optional_param('edit', -1, PARAM_BOOL);
$blockaction = optional_param('blockaction', '', PARAM_ALPHA);
$PAGE->set_context(get_context_instance(CONTEXT_USER, $USER->id));
$PAGE->set_url('my/index.php');
$PAGE->set_blocks_editing_capability('moodle/my:manageblocks');
// Note: MDL-19010 there will be further changes to printing header and blocks.
// The code will be much nicer than this eventually.
$pageblocks = blocks_setup($PAGE, BLOCKS_PINNED_BOTH);
if ($edit != -1 and $PAGE->user_allowed_editing()) {
    $USER->editing = $edit;
}
$button = update_mymoodle_icon($USER->id);
$header = $SITE->shortname . ': ' . $strmymoodle;
$navigation = build_navigation($strmymoodle);
$loggedinas = user_login_string();
if (empty($CFG->langmenu)) {
    $langmenu = '';
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:index.php


示例20: error

     }
     if ($userid > 0 and $userid == $USER->id || has_capability('mod/data:manageuserpresets', $context)) {
         //ok can delete
     } else {
         error("Invalid request");
     }
     $path = data_preset_path($course, $userid, $shortname);
     $strwarning = get_string('deletewarning', 'data') . '<br />' . data_preset_name($shortname, $path);
     $options = new object();
     $options->fullname = $userid . '/' . $shortname;
     $options->action = 'delete';
     $options->d = $data->id;
     $options->sesskey = sesskey();
     $optionsno = new object();
     $optionsno->d = $data->id;
     notice_yesno($strwarning, 'preset.php', 'preset.php', $options, $optionsno, 'post', 'get');
     print_footer($course);
     exit;
     break;
 case 'delete':
     if (!data_submitted() and !confirm_sesskey()) {
         error("Invalid request");
     }
     if ($userid > 0 and $userid == $USER->id || has_capability('mod/data:manageuserpresets', $context)) {
         //ok can delete
     } els 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP notificar函数代码示例发布时间:2022-05-15
下一篇:
PHP notice函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap