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

PHP print_single_button函数代码示例

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

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



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

示例1: notice_okcancel

/**
 * Print a message along with "Ok" link for the user to continue and "Cancel" link to close window.
 *
 * @param string $message The text to display
 * @param string $linkok The link to take the user to if they choose "Ok"
 * TODO Document remaining arguments
 */
function notice_okcancel($message, $linkok, $optionsok = NULL, $methodok = 'post')
{
    global $CFG;
    $message = clean_text($message);
    $linkok = clean_text($linkok);
    print_box_start('generalbox', 'notice');
    echo '<p>' . $message . '</p>';
    echo '<div class="buttons">';
    print_single_button($linkok, $optionsok, get_string('ok'), $methodok, $CFG->framename);
    close_window_button('cancel');
    echo '</div>';
    print_box_end();
}
开发者ID:hit-moodle,项目名称:onlinejudge,代码行数:20,代码来源:rejudge.php


示例2: output

 function output()
 {
     global $CFG;
     $stradd = get_string('add');
     $manualform = '<input type="text" name="tag" /><input type="submit" value="' . $stradd . '" />';
     $manualform = $this->enclose_in_form($manualform);
     $iptcform = '';
     $deleteform = '';
     $tags = array();
     if ($tagrecords = get_records_select('lightboxgallery_image_meta', $this->sql_select(), 'description', 'id,description')) {
         $errorlevel = error_reporting(E_PARSE);
         $textlib = textlib_get_instance();
         foreach ($tagrecords as $tagrecord) {
             $tags[$tagrecord->id] = $tagrecord->description;
             //$textlib->typo3cs->utf8_decode($tagrecord->description, 'iso-8859-1');
         }
         error_reporting($errorlevel);
     }
     $path = $CFG->dataroot . '/' . $this->gallery->course . '/' . $this->gallery->folder . '/' . $this->image;
     $size = getimagesize($path, $info);
     if (isset($info['APP13'])) {
         $iptc = iptcparse($info['APP13']);
         if (isset($iptc['2#025'])) {
             $iptcform = '<input type="hidden" name="iptc" value="1" />';
             sort($iptc['2#025']);
             foreach ($iptc['2#025'] as $tag) {
                 $tag = strtolower($tag);
                 $exists = $tags && in_array($tag, array_values($tags));
                 //eric 將 htmlentities($tag); 改為htmlentities($tag,ENT_QUOTES,'UTF-8')
                 $tag = htmlentities($tag, ENT_QUOTES, 'UTF-8');
                 $iptcform .= '<label ' . ($exists ? 'class="tag-exists"' : '') . '><input type="checkbox" name="iptctags[]" value="' . $tag . '" />' . $tag . '</label><br />';
             }
             $iptcform .= '<input type="submit" value="' . $stradd . '" />';
             $iptcform = '<span class="tag-head"> ' . get_string('tagsiptc', 'lightboxgallery') . '</span>' . $this->enclose_in_form($iptcform);
         }
     }
     $iptcform .= print_single_button($CFG->wwwroot . '/mod/lightboxgallery/edit/tag/import.php', array('id' => $this->gallery->id), get_string('tagsimport', 'lightboxgallery'), 'post', '_self', true);
     if ($tags) {
         $deleteform = '<input type="hidden" name="delete" value="1" />';
         foreach ($tags as $tagid => $tagname) {
             //eric 將 htmlentities($tagname)  改為 htmlentities($tagname, ENT_QUOTES,'UTF-8')
             $deleteform .= '<label><input type="checkbox" name="deletetags[]" value="' . $tagid . '" />' . htmlentities($tagname, ENT_QUOTES, 'UTF-8') . '</label><br />';
         }
         $deleteform .= '<input type="submit" value="' . get_string('remove') . '" />';
         $deleteform = '<span class="tag-head"> ' . get_string('tagscurrent', 'lightboxgallery') . '</span>' . $this->enclose_in_form($deleteform);
     }
     return $manualform . $iptcform . $deleteform;
 }
开发者ID:kai707,项目名称:ITSA-backup,代码行数:48,代码来源:tag.class.php


示例3: test_print_single_button

 public function test_print_single_button()
 {
     global $PAGE, $CFG;
     // Basic params, absolute URL
     $link = 'http://www.test.com/index.php';
     $options = array('param1' => 'value1');
     $label = 'OK';
     $method = 'get';
     $return = true;
     $tooltip = '';
     $disabled = false;
     $jsconfirmmessage = '';
     $formid = '';
     $html = print_single_button($link, $options, $label, $method, '', $return, $tooltip, $disabled, $jsconfirmmessage, $formid);
     $this->assert(new ContainsTagWithAttributes('form', array('method' => $method, 'action' => $link)), $html);
     $this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'param1', 'value' => 'value1')), $html);
     $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => 'OK')), $html);
     // URL with &amp; params
     $newlink = $link . '?param1=value1&amp;param2=value2';
     $html = print_single_button($newlink, $options, $label, $method, '', $return, $tooltip, $disabled, $jsconfirmmessage, $formid);
     $this->assert(new ContainsTagWithAttributes('form', array('method' => $method, 'action' => $link)), $html);
     $this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'param1', 'value' => 'value1')), $html);
     $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => 'OK')), $html);
     // URL with & params
     $newlink = $link . '?param1=value1&param2=value2';
     $html = print_single_button($newlink, $options, $label, $method, '', $return, $tooltip, $disabled, $jsconfirmmessage, $formid);
     $this->assert(new ContainsTagWithAttributes('form', array('method' => $method, 'action' => $link)), $html);
     $this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'param1', 'value' => 'value1')), $html);
     $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => 'OK')), $html);
     // relative URL with & params
     $newlink = 'index.php?param1=value1&param2=value2';
     $PAGE->set_url('index.php');
     $html = print_single_button($newlink, $options, $label, $method, '', $return, $tooltip, $disabled, $jsconfirmmessage, $formid);
     $this->assert(new ContainsTagWithAttributes('form', array('method' => $method, 'action' => $CFG->wwwroot . '/index.php')), $html);
     $this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'param1', 'value' => 'value1')), $html);
     $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => 'OK')), $html);
 }
开发者ID:ajv,项目名称:Offline-Caching,代码行数:37,代码来源:testdeprecatedlib.php


示例4: print_options_form

 function print_options_form($quiz, $cm, $attempts, $lowlimit = 0, $pagesize = 10)
 {
     global $CFG, $USER;
     echo '<div class="controls">';
     echo '<form id="options" action="report.php" method="post">';
     echo '<fieldset class="invisiblefieldset">';
     echo '<p class="quiz-report-options">' . get_string('analysisoptions', 'quiz') . ': </p>';
     echo '<input type="hidden" name="id" value="' . $cm->id . '" />';
     echo '<input type="hidden" name="q" value="' . $quiz->id . '" />';
     echo '<input type="hidden" name="mode" value="analysis" />';
     echo '<p><label for="menuattemptselection">' . get_string('attemptselection', 'quiz_analysis') . '</label> ';
     $options = array(QUIZ_ALLATTEMPTS => get_string("attemptsall", 'quiz_analysis'), QUIZ_HIGHESTATTEMPT => get_string("attemptshighest", 'quiz_analysis'), QUIZ_FIRSTATTEMPT => get_string("attemptsfirst", 'quiz_analysis'), QUIZ_LASTATTEMPT => get_string("attemptslast", 'quiz_analysis'));
     choose_from_menu($options, "attemptselection", "{$attempts}", "");
     echo '</p>';
     echo '<p><label for="lowmarklimit">' . get_string('lowmarkslimit', 'quiz_analysis') . '</label> ';
     echo '<input type="text" id="lowmarklimit" name="lowmarklimit" size="1" value="' . $lowlimit . '" /> % </p>';
     echo '<p><label for="pagesize">' . get_string('pagesize', 'quiz_analysis') . '</label> ';
     echo '<input type="text" id="pagesize" name="pagesize" size="1" value="' . $pagesize . '" /></p>';
     echo '<p><input type="submit" value="' . get_string('go') . '" />';
     helpbutton("analysisoptions", get_string("analysisoptions", 'quiz_analysis'), 'quiz');
     echo '</p>';
     echo '</fieldset>';
     echo '</form>';
     echo '</div>';
     echo "\n";
     echo '<table class="boxaligncenter"><tr>';
     $options = array();
     $options["id"] = "{$cm->id}";
     $options["q"] = "{$quiz->id}";
     $options["mode"] = "analysis";
     $options['sesskey'] = $USER->sesskey;
     $options["noheader"] = "yes";
     echo '<td>';
     $options["download"] = "ODS";
     print_single_button("report.php", $options, get_string("downloadods"));
     echo "</td>\n";
     echo '<td>';
     $options["download"] = "Excel";
     print_single_button("report.php", $options, get_string("downloadexcel"));
     echo "</td>\n";
     if (file_exists("{$CFG->libdir}/phpdocwriter/lib/include.php")) {
         echo '<td>';
         $options["download"] = "OOo";
         print_single_button("report.php", $options, get_string("downloadooo", "quiz_analysis"));
         echo "</td>\n";
     }
     echo '<td>';
     $options["download"] = "CSV";
     print_single_button('report.php', $options, get_string("downloadtext"));
     echo "</td>\n";
     echo "<td>";
     helpbutton('analysisdownload', get_string('analysisdownload', 'quiz_analysis'), 'quiz');
     echo "</td>\n";
     echo '</tr></table>';
 }
开发者ID:veritech,项目名称:pare-project,代码行数:55,代码来源:report.php


示例5: get_completion_page

 function get_completion_page($crsid)
 {
     global $CFG;
     $output = '';
     $crs = new course($crsid);
     $table = new stdClass();
     $elements = $crs->get_completion_elements();
     if ($elements) {
         $columns = array('idnumber' => get_string('completion_idnumber', 'block_curr_admin'), 'name' => get_string('completion_name', 'block_curr_admin'), 'description' => get_string('completion_description', 'block_curr_admin'), 'completion_grade' => get_string('completion_grade', 'block_curr_admin'), 'required' => get_string('required', 'block_curr_admin'));
         foreach ($columns as $column => $cdesc) {
             $columndir = "ASC";
             $columnicon = $columndir == "ASC" ? "down" : "up";
             $columnicon = " <img src=\"{$CFG->pixpath}/t/{$columnicon}.gif\" alt=\"\" />";
             ${$column} = $cdesc;
             $table->head[] = ${$column};
             $table->align[] = "left";
             $table->wrap[] = false;
         }
         $table->head[] = "";
         $table->align[] = "center";
         $table->wrap[] = true;
         foreach ($elements as $element) {
             $deletebutton = '<a href="index.php?s=crs&amp;section=curr&amp;action=delem&amp;id=' . $crs->id . '&amp;elemid=' . $element->id . '">' . '<img src="pix/delete.gif" alt="Delete" title="Delete" /></a>';
             $editbutton = '<a href="index.php?s=crs&amp;section=curr&amp;action=eelem&amp;id=' . $crs->id . '&amp;elemid=' . $element->id . '">' . '<img src="pix/edit.gif" alt="Edit" title="Edit" /></a>';
             $newarr = array();
             foreach ($columns as $column => $cdesc) {
                 if ($column == 'required') {
                     $newarr[] = empty($element->required) ? get_string('no') : get_string('yes');
                 } else {
                     $newarr[] = $element->{$column};
                 }
             }
             $newarr[] = $editbutton . ' ' . $deletebutton;
             $table->data[] = $newarr;
         }
         $output .= print_table($table, true);
     } else {
         $output .= '<div align="center">' . get_string('no_completion_elements', 'block_curr_admin') . '</div>';
     }
     $output .= '<br clear="all" />' . "\n";
     $output .= '<div align="center">';
     $options = array('s' => 'crs', 'section' => 'curr', 'action' => 'celem', 'id' => $crs->id);
     $output .= print_single_button('index.php', $options, 'Add Element', 'get', '_self', true, 'Add New Element');
     $output .= '</div>';
     return $output;
 }
开发者ID:remotelearner,项目名称:elis.cm,代码行数:46,代码来源:coursepage.class.php


示例6: print_continue

 /**
  * Either prints a "Export" box, which will redirect the user to the download page,
  * or prints the URL for the published data.
  * @return void
  */
 function print_continue()
 {
     global $CFG;
     $params = $this->get_export_params();
     print_heading(get_string('export', 'grades'));
     echo '<div class="gradeexportlink">';
     if (!$this->userkey) {
         // this button should trigger a download prompt
         print_single_button($CFG->wwwroot . '/grade/export/' . $this->plugin . '/export.php', $params, get_string('download', 'admin'));
     } else {
         $paramstr = '';
         $sep = '?';
         foreach ($params as $name => $value) {
             $paramstr .= $sep . $name . '=' . $value;
             $sep = '&amp;';
         }
         $link = $CFG->wwwroot . '/grade/export/' . $this->plugin . '/dump.php' . $paramstr . '&amp;key=' . $this->userkey;
         echo get_string('download', 'admin') . ': <a href="' . $link . '">' . $link . '</a>';
     }
     echo '</div>';
 }
开发者ID:arshanam,项目名称:Moodle-ITScholars-LMS,代码行数:26,代码来源:lib.php


示例7: print_single_button

            echo "\t\t\t<object type=\"text/html\" data=\"preview.php?preview={$theme}\" height=\"200\" width=\"400\">{$theme}</object>\n\t\t</td>\n";
        }
    }
    if ($CFG->theme == $theme) {
        echo "\t\t" . '<td valign="top" style="border-style:solid; border-width:1px; border-color:#555555">' . "\n";
    } else {
        echo "\t\t" . '<td valign="top">' . "\n";
    }
    if (isset($THEME->sheets)) {
        echo "\t\t\t" . '<p style="font-size:1.5em;font-weight:bold;">' . $theme . '</p>' . "\n";
    } else {
        echo "\t\t\t" . '<p style="font-size:1.5em;font-weight:bold;color:red;">' . $theme . ' (Moodle 1.4)</p>' . "\n";
    }
    if ($screenshot or $readme) {
        echo "\t\t\t<ul>\n";
        if (!$USER->screenreader) {
            echo "\t\t\t\t<li><a href=\"preview.php?preview={$theme}\">{$strpreview}</a></li>\n";
        }
        echo $screenshot . $readme;
        echo "\t\t\t</ul>\n";
    }
    $options = null;
    $options['choose'] = $theme;
    $options['sesskey'] = $sesskey;
    echo "\t\t\t" . print_single_button('index.php', $options, $strchoose, 'get', null, true) . "\n";
    echo "\t\t</td>\n";
    echo "\t</tr>\n";
}
echo "</table>\n";
$THEME = $original_theme;
admin_externalpage_print_footer();
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:31,代码来源:index.php


示例8: quiz_print_question_list


//.........这里部分代码省略.........
                    ?>
" />
    <?php 
                    echo $pageurl->hidden_params_out();
                    ?>
    <input type="hidden" name="savechanges" value="save" />
        <?php 
                    echo '<input type="text" name="g' . $question->id . '" id="inputq' . $question->id . '" size="' . ($quiz->decimalpoints + 2) . '" value="' . (0 + $quiz->grades[$qnum]) . '" tabindex="' . ($lastindex + $qno) . '" />';
                    ?>
        <input type="submit" class="pointssubmitbutton" value="<?php 
                    echo $strsave;
                    ?>
" />
    </fieldset>
<?php 
                    if ($question->qtype == 'random') {
                        echo '<a href="' . $questionurl->out() . '" class="configurerandomquestion">' . get_string("configurerandomquestion", "quiz") . '</a>';
                    }
                    ?>
</div>
</form>

            </div>
<?php 
                } else {
                    if ($reordertool) {
                        if ($qnum) {
                            ?>
<div class="qorder">
        <?php 
                            echo '<input type="text" name="o' . $question->id . '" size="2" value="' . (10 * $count + 10) . '" tabindex="' . ($lastindex + $qno) . '" />';
                            ?>
<!--         <input type="submit" class="pointssubmitbutton" value="<?php 
                            echo $strsave;
                            ?>
" /> -->
</div>
<?php 
                        }
                    }
                }
                ?>
            <div class="questioncontentcontainer">
<?php 
                if ($question->qtype == 'random') {
                    // it is a random question
                    if (!$reordertool) {
                        quiz_print_randomquestion($question, $pageurl, $quiz, $quiz_qbanktool);
                    } else {
                        quiz_print_randomquestion_reordertool($question, $pageurl, $quiz);
                    }
                } else {
                    // it is a single question
                    if (!$reordertool) {
                        quiz_print_singlequestion($question, $returnurl, $quiz);
                    } else {
                        quiz_print_singlequestion_reordertool($question, $returnurl, $quiz);
                    }
                }
                ?>
            </div>
        </div>
    </div>
</div>

    <?php 
                /* Display question end */
                $count++;
                $sumgrade += $quiz->grades[$qnum];
            }
        }
        //a page break: end the existing page.
        if ($qnum == 0) {
            if ($pageopen) {
                if (!$reordertool && !($quiz->shufflequestions && $i < $questiontotalcount - 1)) {
                    quiz_print_pagecontrols($quiz, $pageurl, $pagecount, $hasattempts);
                } else {
                    if ($i < $questiontotalcount - 1) {
                        //do not include the last page break for reordering
                        //to avoid creating a new extra page in the end
                        echo '<input type="hidden" name="opg' . $pagecount . '" size="2" value="' . (10 * $count + 10) . '" />';
                    }
                }
                echo "</div></div>";
                if (!$reordertool && !$quiz->shufflequestions) {
                    echo "<div class=\"addpage\">";
                    print_single_button($pageurl->out(true), array('cmid' => $quiz->cmid, 'courseid' => $quiz->course, 'addpage' => $count, 'sesskey' => sesskey()), get_string('addpagehere', 'quiz'), 'get', '_self', false, '', $hasattempts);
                    echo "</div>";
                }
                $pageopen = false;
                $count++;
            }
        }
    }
    if ($reordertool) {
        echo $reordercontrolsbottom;
        echo '</div></form>';
    }
    return $sumgrade;
}
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:101,代码来源:editlib.php


示例9: switch

echo '<div class="heightcontainer">';
switch ($view) {
    case 'day':
        calendar_show_day($day, $mon, $yr, $courses, $groups, $users, $courseid);
        break;
    case 'month':
        calendar_show_month_detailed($mon, $yr, $courses, $groups, $users, $courseid);
        break;
    case 'upcoming':
        calendar_show_upcoming_events($courses, $groups, $users, get_user_preferences('calendar_lookahead', CALENDAR_UPCOMING_DAYS), get_user_preferences('calendar_maxevents', CALENDAR_UPCOMING_MAXEVENTS), $courseid);
        break;
}
//Link to calendar export page
echo '<div class="bottom">';
if (!empty($CFG->enablecalendarexport)) {
    print_single_button('export.php', array('course' => $courseid), get_string('exportcalendar', 'calendar'));
    if (!empty($USER->id)) {
        $authtoken = sha1($USER->username . $USER->password . $CFG->calendar_exportsalt);
        $usernameencoded = urlencode($USER->username);
        echo "<a href=\"export_execute.php?preset_what=all&amp;preset_time=recentupcoming&amp;username={$usernameencoded}&amp;authtoken={$authtoken}\">" . '<img src="' . $CFG->pixpath . '/i/ical.gif" height="14" width="36" ' . 'alt="' . get_string('ical', 'calendar') . '" ' . 'title="' . get_string('quickdownloadcalendar', 'calendar') . '" />' . '</a>';
    }
}
echo '</div>';
echo '</div>';
echo '</td>';
// END: Main column
// START: Last column (3-month display)
echo '<td class="sidecalendar">';
list($prevmon, $prevyr) = calendar_sub_month($mon, $yr);
list($nextmon, $nextyr) = calendar_add_month($mon, $yr);
$getvars = 'id=' . $courseid . '&amp;cal_d=' . $day . '&amp;cal_m=' . $mon . '&amp;cal_y=' . $yr;
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:31,代码来源:view.php


示例10: display

 function display()
 {
     global $CFG;
     /// Set up generic stuff first, including checking for access
     parent::display();
     /// Set up some shorthand variables
     $cm = $this->cm;
     $course = $this->course;
     $resource = $this->resource;
     require_once $CFG->libdir . '/filelib.php';
     $subdir = optional_param('subdir', '', PARAM_PATH);
     $resource->reference = clean_param($resource->reference, PARAM_PATH);
     $formatoptions = new object();
     $formatoptions->noclean = true;
     $formatoptions->para = false;
     // MDL-12061, <p> in html editor breaks xhtml strict
     add_to_log($course->id, "resource", "view", "view.php?id={$cm->id}", $resource->id, $cm->id);
     if ($resource->reference) {
         $relativepath = "{$course->id}/{$resource->reference}";
     } else {
         $relativepath = "{$course->id}";
     }
     if ($subdir) {
         $relativepath = "{$relativepath}{$subdir}";
         if (stripos($relativepath, 'backupdata') !== FALSE or stripos($relativepath, $CFG->moddata) !== FALSE) {
             error("Access not allowed!");
         }
         $subs = explode('/', $subdir);
         array_shift($subs);
         $countsubs = count($subs);
         $count = 0;
         $backsub = '';
         foreach ($subs as $sub) {
             $count++;
             if ($count < $countsubs) {
                 $backsub .= "/{$sub}";
                 $this->navlinks[] = array('name' => $sub, 'link' => "view.php?id={$cm->id}", 'type' => 'title');
             } else {
                 $this->navlinks[] = array('name' => $sub, 'link' => '', 'type' => 'title');
             }
         }
     }
     $pagetitle = strip_tags($course->shortname . ': ' . format_string($resource->name));
     $update = update_module_button($cm->id, $course->id, $this->strresource);
     if (has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $course->id))) {
         $options = array('id' => $course->id, 'wdir' => '/' . $resource->reference . $subdir);
         $editfiles = print_single_button("{$CFG->wwwroot}/files/index.php", $options, get_string("editfiles"), 'get', '', true);
         $update = $editfiles . $update;
     }
     $navigation = build_navigation($this->navlinks, $cm);
     print_header($pagetitle, $course->fullname, $navigation, "", "", true, $update, navmenu($course, $cm));
     if (trim(strip_tags($resource->summary))) {
         print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $course->id), "center");
         print_spacer(10, 10);
     }
     $files = get_directory_list("{$CFG->dataroot}/{$relativepath}", array($CFG->moddata, 'backupdata'), false, true, true);
     if (!$files) {
         print_heading(get_string("nofilesyet"));
         print_footer($course);
         exit;
     }
     print_simple_box_start("center", "", "", '0');
     $strftime = get_string('strftimedatetime');
     $strname = get_string("name");
     $strsize = get_string("size");
     $strmodified = get_string("modified");
     $strfolder = get_string("folder");
     $strfile = get_string("file");
     echo '<table cellpadding="4" cellspacing="1" class="files" summary="">';
     echo "<tr><th class=\"header name\" scope=\"col\">{$strname}</th>" . "<th align=\"right\" colspan=\"2\" class=\"header size\" scope=\"col\">{$strsize}</th>" . "<th align=\"right\" class=\"header date\" scope=\"col\">{$strmodified}</th>" . "</tr>";
     foreach ($files as $file) {
         if (is_dir("{$CFG->dataroot}/{$relativepath}/{$file}")) {
             // Must be a directory
             $icon = "folder.gif";
             $relativeurl = "/view.php?blah";
             $filesize = display_size(get_directory_size("{$CFG->dataroot}/{$relativepath}/{$file}"));
         } else {
             $icon = mimeinfo("icon", $file);
             $relativeurl = get_file_url("{$relativepath}/{$file}");
             $filesize = display_size(filesize("{$CFG->dataroot}/{$relativepath}/{$file}"));
         }
         if ($icon == 'folder.gif') {
             echo '<tr class="folder">';
             echo '<td class="name">';
             echo "<a href=\"view.php?id={$cm->id}&amp;subdir={$subdir}/{$file}\">";
             echo "<img src=\"{$CFG->pixpath}/f/{$icon}\" class=\"icon\" alt=\"{$strfolder}\" />&nbsp;{$file}</a>";
         } else {
             echo '<tr class="file">';
             echo '<td class="name">';
             link_to_popup_window($relativeurl, "resourcedirectory{$resource->id}", "<img src=\"{$CFG->pixpath}/f/{$icon}\" class=\"icon\" alt=\"{$strfile}\" />&nbsp;{$file}", 450, 600, '');
         }
         echo '</td>';
         echo '<td>&nbsp;</td>';
         echo '<td align="right" class="size">';
         echo $filesize;
         echo '</td>';
         echo '<td align="right" class="date">';
         echo userdate(filemtime("{$CFG->dataroot}/{$relativepath}/{$file}"), $strftime);
         echo '</td>';
         echo '</tr>';
//.........这里部分代码省略.........
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:101,代码来源:resource.class.php


示例11: print_heading

    print_heading(format_string($category->name) . ' ' . profile_category_icons($category));
    if (count($table->data)) {
        print_table($table);
    } else {
        notify($strnofields);
    }
}
/// End of $categories foreach
echo '<hr />';
echo '<div class="profileeditor">';
/// Create a new field link
$options = profile_list_datatypes();
popup_form($CFG->wwwroot . '/user/profile/index.php?id=0&amp;action=editfield&amp;datatype=', $options, 'newfieldform', '', 'choose', '', '', false, 'self', $strcreatefield);
/// Create a new category link
$options = array('action' => 'editcategory');
print_single_button('index.php', $options, get_string('profilecreatecategory', 'admin'));
echo '</div>';
admin_externalpage_print_footer();
die;
/***** Some functions relevant to this script *****/
/**
 * Create a string containing the editing icons for the user profile categories
 * @param   object   the category object
 * @return  string   the icon string
 */
function profile_category_icons($category)
{
    global $CFG, $USER;
    $strdelete = get_string('delete');
    $strmoveup = get_string('moveup');
    $strmovedown = get_string('movedown');
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:31,代码来源:index.php


示例12: elseif

} elseif ($certrecord->certdate == 0) {
    ///Create certificate
    if (empty($action)) {
        view_header($course, $certificate, $cm);
        if ($certificate->delivery == 0) {
            echo '<p align="center">' . get_string('openwindow', 'certificate') . '</p>';
        } elseif ($certificate->delivery == 1) {
            echo '<p align="center">' . get_string('opendownload', 'certificate') . '</p>';
        } elseif ($certificate->delivery == 2) {
            echo '<p align="center">' . get_string('openemail', 'certificate') . '</p>';
        }
        $opt = new stdclass();
        $opt->id = $cm->id;
        $opt->action = 'get';
        echo '<center>';
        print_single_button('view.php', $opt, $strgetcertificate, 'get', '_blank');
        echo '</center>';
        add_to_log($course->id, 'certificate', 'received', "view.php?id={$cm->id}", $certificate->id, $cm->id);
        print_footer(NULL, $course);
        exit;
    }
    certificate_issue($course, $certificate, $certrecord, $cm);
    // update certrecord as issued
}
// Output to pdf
certificate_file_area($USER->id);
$filesafe = clean_filename($certificate->name . '.pdf');
$file = $CFG->dataroot . '/' . $course->id . '/moddata/certificate/' . $certificate->id . '/' . $USER->id . '/' . $filesafe;
if ($certificate->savecert == 1) {
    $pdf->Output($file, 'F');
    //save as file
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:31,代码来源:view.php


示例13: print_error

if (!ims_save_serialized_file($resourcedir . '/moodle_inx.ser', $items)) {
    print_error('errorcreatingfile', 'error', '', 'moodle_inx.ser');
}
/// Create the HASH file (moodle_hash.ser - where the hash of the ims is stored serialized) file
$hash = $resource_obj->calculatefilehash($resourcefile);
if (!ims_save_serialized_file($resourcedir . '/moodle_hash.ser', $hash)) {
    print_error('errorcreatingfile', 'error', '', 'moodle_hash.ser');
}
/// End button (go to view mode)
echo '<center>';
print_simple_box(get_string('imspackageloaded', 'resource'), 'center');
$link = $CFG->wwwroot . '/mod/resource/view.php';
$options['r'] = $resource->id;
$label = get_string('viewims', 'resource');
$method = 'post';
print_single_button($link, $options, $label, $method);
echo '</center>';
///
/// End of main process, where everything is deployed
///
/// Print the footer of the page
print_footer();
///
/// Common and useful functions used by the body of the script
///
/*** This function will return a tree of manifests (xmlized) as they are
 *   found and extracted from one manifest file. The first manifest in the
 *   will be the main one, while the rest will be submanifests. In the
 *   future (when IMS CP suppors it, external submanifest will be detected
 *   and retrieved here too). See IMS specs for more info.
 */
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:deploy.php


示例14: restore_precheck


//.........这里部分代码省略.........
        $xml_file = $CFG->dataroot . "/temp/backup/" . $backup_unique_code . "/moodle.xml";
        if (!defined('RESTORE_SILENTLY')) {
            echo "<li>" . get_string("checkingbackup") . '</li>';
        }
        if (!($status = restore_check_moodle_file($xml_file))) {
            if (!is_file($xml_file)) {
                $errorstr = 'Error checking backup file. moodle.xml not found at root level of zip file.';
            } else {
                $errorstr = 'Error checking backup file. moodle.xml is incorrect or corrupted.';
            }
            if (!defined('RESTORE_SILENTLY')) {
                notify($errorstr);
            } else {
                return false;
            }
        }
    }
    $info = "";
    $course_header = "";
    //Now read the info tag (all)
    if ($status) {
        if (!defined('RESTORE_SILENTLY')) {
            echo "<li>" . get_string("readinginfofrombackup") . '</li>';
        }
        //Reading info from file
        $info = restore_read_xml_info($xml_file);
        //Reading course_header from file
        $course_header = restore_read_xml_course_header($xml_file);
        if (!is_object($course_header)) {
            // ensure we fail if there is no course header
            $course_header = false;
        }
    }
    if (!defined('RESTORE_SILENTLY')) {
        //End the main ul
        echo "</ul>\n";
        //End the main table
        echo "</td></tr>";
        echo "</table>";
    }
    //We compare Moodle's versions
    if ($CFG->version < $info->backup_moodle_version && $status) {
        $message = new object();
        $message->serverversion = $CFG->version;
        $message->serverrelease = $CFG->release;
        $message->backupversion = $info->backup_moodle_version;
        $message->backuprelease = $info->backup_moodle_release;
        print_simple_box(get_string('noticenewerbackup', '', $message), "center", "70%", '', "20", "noticebox");
    }
    //Now we print in other table, the backup and the course it contains info
    if ($info and $course_header and $status) {
        //First, the course info
        if (!defined('RESTORE_SILENTLY')) {
            $status = restore_print_course_header($course_header);
        }
        //Now, the backup info
        if ($status) {
            if (!defined('RESTORE_SILENTLY')) {
                $status = restore_print_info($info);
            }
        }
    }
    //Save course header and info into php session
    if ($status) {
        $SESSION->info = $info;
        $SESSION->course_header = $course_header;
    }
    //Finally, a little form to continue
    //with some hidden fields
    if ($status) {
        if (!defined('RESTORE_SILENTLY')) {
            echo "<br /><div style='text-align:center'>";
            $hidden["backup_unique_code"] = $backup_unique_code;
            $hidden["launch"] = "form";
            $hidden["file"] = $file;
            $hidden["id"] = $id;
            print_single_button("restore.php", $hidden, get_string("continue"), "post");
            echo "</div>";
        } else {
            if (empty($noredirect)) {
                // in 2.0 we must not print "Continue" redirect link here, because ppl click on it and the execution gets interrupted on next page!!!
                // imo RESTORE_SILENTLY is an ugly hack :-P
                $sillystr = get_string('donotclickcontinue');
                redirect($CFG->wwwroot . '/backup/restore.php?backup_unique_code=' . $backup_unique_code . '&launch=form&file=' . $file . '&id=' . $id, $sillystr, 0);
            } else {
                return $backup_unique_code;
            }
        }
    }
    if (!$status) {
        if (!defined('RESTORE_SILENTLY')) {
            error("An error has ocurred");
        } else {
            $errorstr = "An error has occured";
            // helpful! :P
            return false;
        }
    }
    return true;
}
开发者ID:kai707,项目名称:ITSA-backup,代码行数:101,代码来源:restorelib.php


示例15: choose_from_menu

            }
            choose_from_menu($displaylist, "moveto", "", get_string("moveselectedcoursesto"), "javascript: submitFormById('movecourses')");
            echo '<input type="hidden" name="id" value="' . $category->id . '" />';
            if (has_capability('moodle/category:update', get_context_instance(CONTEXT_SYSTEM, SITEID)) and $numcourses > 1) {
                print_submit_button('deletecourses', 'Delete Selected Courses', null);
            }
            echo '</td></tr>';
        }
        echo '</table>';
        echo '</div></form>';
        echo '<br />';
    }
}
echo '<div class="buttons">';
if (has_capability('moodle/category:update', get_context_instance(CONTEXT_SYSTEM)) and $numcourses > 1) {
    /// Print button to re-sort courses by name
    unset($options);
    $options['id'] = $category->id;
    $options['resort'] = 'name';
    $options['sesskey'] = $USER->sesskey;
    print_single_button('category.php', $options, get_string('resortcoursesbyname'), 'get');
}
if (has_capability('moodle/course:create', $context)) {
    /// Print button to create a new course
    unset($options);
    $options['category'] = $category->id;
    print_single_button('edit.php', $options, get_string('addnewcourse'), 'get');
}
echo '</div>';
print_course_search();
print_footer();
开发者ID:r007,项目名称:PMoodle,代码行数:31,代码来源:category.php


示例16: quiz_grade_item_update

/**
 * Create grade item for given quiz
 *
 * @param object $quiz object with extra cmidnumber
 * @param mixed optional array/object of grade(s); 'reset' means reset grades in gradebook
 * @return int 0 if ok, error code otherwise
 */
function quiz_grade_item_update($quiz, $grades = NULL)
{
    global $CFG;
    if (!function_exists('grade_update')) {
        //workaround for buggy PHP versions
        require_once $CFG->libdir . '/gradelib.php';
    }
    if (array_key_exists('cmidnumber', $quiz)) {
        //it may not be always present
        $params = array('itemname' => $quiz->name, 'idnumber' => $quiz->cmidnumber);
    } else {
        $params = array('itemname' => $quiz->name);
    }
    if ($quiz->grade > 0) {
        $params['gradetype'] = GRADE_TYPE_VALUE;
        $params['grademax'] = $quiz->grade;
        $params['grademin'] = 0;
    } else {
        $params['gradetype'] = GRADE_TYPE_NONE;
    }
    /* description by TJ:
    1/ If the quiz is set to not show scores while the quiz is still open, and is set to show scores after
       the quiz is closed, then create the grade_item with a show-after date that is the quiz close date.
    2/ If the quiz is set to not show scores at either of those times, create the grade_item as hidden.
    3/ If the quiz is set to show scores, create the grade_item visible.
    */
    if (!($quiz->review & QUIZ_REVIEW_SCORES & QUIZ_REVIEW_CLOSED) and !($quiz->review & QUIZ_REVIEW_SCORES & QUIZ_REVIEW_OPEN)) {
        $params['hidden'] = 1;
    } else {
        if ($quiz->review & QUIZ_REVIEW_SCORES & QUIZ_REVIEW_CLOSED and !($quiz->review & QUIZ_REVIEW_SCORES & QUIZ_REVIEW_OPEN)) {
            if ($quiz->timeclose) {
                $params['hidden'] = $quiz->timeclose;
            } else {
                $params['hidden'] = 1;
            }
        } else {
            // a) both open and closed enabled
            // b) open enabled, closed disabled - we can not "hide after", grades are kept visible even after closing
            $params['hidden'] = 0;
        }
    }
    if ($grades === 'reset') {
        $params['reset'] = true;
        $grades = NULL;
    }
    $gradebook_grades = grade_get_grades($quiz->course, 'mod', 'quiz', $quiz->id);
    if (!empty($gradebook_grades->items)) {
        $grade_item = $gradebook_grades->items[0];
        if ($grade_item->locked) {
            $confirm_regrade = optional_param('confirm_regrade', 0, PARAM_INT);
            if (!$confirm_regrade) {
                $message = get_string('gradeitemislocked', 'grades');
                $back_link = $CFG->wwwroot . '/mod/quiz/report.php?q=' . $quiz->id . '&amp;mode=overview';
                $regrade_link = qualified_me() . '&amp;confirm_regrade=1';
                print_box_start('generalbox', 'notice');
                echo '<p>' . $message . '</p>';
                echo '<div class="buttons">';
                print_single_button($regrade_link, null, get_string('regradeanyway', 'grades'), 'post', $CFG->framename);
                print_single_button($back_link, null, get_string('cancel'), 'post', $CFG->framename);
                echo '</div>';
                print_box_end();
                return GRADE_UPDATE_ITEM_LOCKED;
       

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP print_sort_icon函数代码示例发布时间:2022-05-15
下一篇:
PHP print_simple_box_start函数代码示例发布时间: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