本文整理汇总了PHP中add_notice函数的典型用法代码示例。如果您正苦于以下问题:PHP add_notice函数的具体用法?PHP add_notice怎么用?PHP add_notice使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_notice函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update_map_coordinates
/**
* Get the map center coordinates from the address and update the database values
*
* The latitude/longitude need to be updated when the address changes, but there's no way to do that with the settings API
*/
public function update_map_coordinates()
{
// @todo - this could be done during a settings validation callback?
global $bgmp;
$have_coordinates = true;
if (isset($_POST['bgmp_map-address'])) {
if (empty($_POST['bgmp_map-address'])) {
$have_coordinates = false;
} else {
$coordinates = $bgmp->geocode($_POST['bgmp_map-address']);
if (!$coordinates) {
$have_coordinates = false;
}
}
if ($have_coordinates) {
update_option('bgmp_map-latitude', $coordinates['latitude']);
update_option('bgmp_map-longitude', $coordinates['longitude']);
} else {
add_notice("That address couldn't be geocoded, please make sure that it's correct.", 'error');
update_option('bgmp_map-latitude', '');
// @todo - update these
update_option('bgmp_map-longitude', '');
}
}
}
示例2: registerShortcode
/** Registers Shortcode */
public function registerShortcode()
{
$this->init();
try {
$this->validate();
add_shortcode($this->shortcodeTag, array($this, 'renderShortcode'));
} catch (InvalidArgumentException $e) {
add_notice($e->getMessage(), 'error');
}
}
示例3: create_post_type
/**
* Registers the custom post type
*
* @mvc Controller
*/
public static function create_post_type()
{
if (!post_type_exists(POST_TYPE_SLUG)) {
$post_type_params = self::get_post_type_params();
$post_type = register_post_type(POST_TYPE_SLUG, $post_type_params);
// CPT columns (Ohad Raz Class)
$post_columns = new CPT_columns(POST_TYPE_SLUG, true);
// $post_columns->_column_orderby( (object) array('orderby' => 'date') );
$post_columns->add_column('cb', array('label' => __(''), 'type' => 'cb'));
$post_columns->add_column('post_thumb', array('label' => __(''), 'type' => 'thumb', 'size' => array('50,50')));
$post_columns->add_column('title', array('label' => __('title'), 'type' => 'native', 'sortable' => true));
$post_columns->add_column('custom_tax_id', array('label' => __('OSmedia video category'), 'type' => 'custom_tax', 'taxonomy' => TAG_SLUG));
$post_columns->add_column('tags', array('label' => __('tag'), 'type' => 'tags'));
$post_columns->add_column('comments', array('label' => __('comments'), 'type' => 'comments'));
$post_columns->add_column('date', array('label' => __('date'), 'type' => 'date', 'sortable' => true));
if (is_wp_error($post_type)) {
add_notice(__METHOD__ . ' error: ' . $post_type->get_error_message(), 'error');
}
}
}
示例4: application_log
$ERRORSTR[] = "An error occurred while removing the Hot Topic [" . $id . "] from the system. The system administrator has been notified.You will now be redirected to the Hot Topics index; this will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . ENTRADA_URL . "/admin/settings/manage/hottopics/?org=" . $ORGANISATION_ID . "\" style=\"font-weight: bold\">click here</a> to continue.";
application_log("error", "An error occurred while removing the Hot Topic [" . $id . "] from the system. ");
}
}
}
if ($SUCCESS) {
echo display_success();
}
if ($NOTICE) {
echo display_notice();
}
$ONLOAD[] = "setTimeout('window.location=\\'" . ENTRADA_URL . "/admin/settings/manage/hottopics/?org=" . $ORGANISATION_ID . "\\'', 5000)";
break;
case 1:
default:
add_notice("Please review the following hot topics to ensure that you wish to <strong>permanently delete</strong> them.");
echo display_notice();
?>
<form action ="<?php
echo ENTRADA_URL . "/admin/settings/manage/hottopics/?section=delete&org=" . $ORGANISATION_ID . "&step=2";
?>
" method="post">
<table class="tableList" cellspacing="0" summary="List of Curriculum Types">
<colgroup>
<col class="modified"/>
<col class="title"/>
</colgroup>
<thead>
<tr>
示例5: html_encode
echo "\t<a href=\"" . ENTRADA_URL . "/admin/quizzes?section=results&community=true&id=" . $result["aquiz_id"] . "\"><img src=\"" . ENTRADA_URL . "/images/view-stats.gif\" width=\"16\" height=\"16\" alt=\"View results of " . html_encode($result["quiz_title"]) . "\" title=\"View results of " . html_encode($result["quiz_title"]) . "\" style=\"vertical-align: middle\" border=\"0\" /></a>\n";
} else {
echo "\t<img src=\"" . ENTRADA_URL . "/images/view-stats-disabled.gif\" width=\"16\" height=\"16\" alt=\"No completed quizzes at this time.\" title=\"No completed quizzes at this time.\" style=\"vertical-align: middle\" border=\"0\" />\n";
}
echo "\t</td>\n";
echo "\t<td class=\"title\"><a href=\"" . $url . "\" title=\"Community Page: " . html_encode($result["page_title"]) . "\">" . html_encode($result["page_title"]) . "</a></td>\n";
echo "\t<td class=\"title\"><a href=\"" . $url . "\" title=\"Quiz Title: " . html_encode($result["quiz_title"]) . "\">" . html_encode($result["quiz_title"]) . "</a></td>\n";
echo "\t<td class=\"completed\">" . (int) $completed_attempts . "</td>\n";
echo "</tr>\n";
}
?>
</tbody>
</table>
<?php
} else {
add_notice("This quiz is not currently attached to any community pages.<br /><br />To add this quiz to an page you are have administrative rights to, click the <strong>Attach To Community Page</strong> link above.");
echo display_notice();
}
}
?>
</div>
<?php
/**
* Sidebar item that will provide the links to the different sections within this page.
*/
$sidebar_html = "<ul class=\"menu\">\n";
$sidebar_html .= "\t<li class=\"link\"><a href=\"#quiz_information_section\" onclick=\"\$('quiz_information_section').scrollTo(); return false;\" title=\"Quiz Information\">Quiz Information</a></li>\n";
$sidebar_html .= "\t<li class=\"link\"><a href=\"#quiz_questions_section\" onclick=\"\$('quiz_questions_section').scrollTo(); return false;\" title=\"Quiz Questions\">Quiz Questions</a></li>\n";
$sidebar_html .= "\t<li class=\"link\"><a href=\"#learning_events_section\" onclick=\"\$('learning_events_section').scrollTo(); return false;\" title=\"Learning Events\">Learning Events</a></li>\n";
$sidebar_html .= "\t<li class=\"link\"><a href=\"#community_pages_section\" onclick=\"\$('community_pages_section').scrollTo(); return false;\" title=\"Learning Events\">Community Pages</a></li>\n";
示例6: add_notice
?>
<style type="text/css">
#draft-list_length {padding:5px 4px 0 0;}
#draft-list_filter {-moz-border-radius:10px 10px 0px 0px; border: 1px solid #9D9D9D;border-bottom:none;background-color:#FAFAFA;font-size: 0.9em;padding:3px;}
#draft-list_paginate a {margin:2px 5px;}
</style>
<h1>My Draft Learning Event Schedules</h1>
<div class="row-fluid"><a class="btn btn-primary pull-right" href="<?php
echo ENTRADA_URL;
?>
/admin/events/drafts?section=create-draft">Create New Draft</a></div>
<br />
<?php
$drafts = Models_Event_Draft::fetchAllByProxyID($ENTRADA_USER->getActiveID());
if ($drafts) {
add_notice("<p>You currently have <strong>" . count($drafts) . "</strong> draft" . (count($drafts) > 1 ? "s" : "") . " on the go.</p><p>When you are finished working on your draft event schedule you can click <strong>Publish Drafts</strong> to schedule them to be imported.</p>");
echo display_notice();
?>
<form name="frmSelect" id="frmSelect" action="<?php
echo ENTRADA_URL;
?>
/admin/events/drafts?section=delete" method="post">
<table class="table table-striped table-bordered" id="draft-list" cellspacing="0" cellpadding="1" summary="List of Events">
<thead>
<tr>
<th class="modified" width="5%"> </th>
<th class="title">Draft Name</th>
<th class="date">Created</th>
<th class="status">Status</th>
</tr>
</thead>
示例7: foreach
<ul class="history"><?php
foreach ($statistics as $key => $statistic) {
$module = explode(':', $statistic['module']);
$action = explode('_', $statistic['action']);
$user_action = count($action) > 1 ? $action[1] : $action[0];
$user_action = $user_action == "delete" ? $user_action . "d" : $user_action . "ed";
$activity_message = "<a href=\"" . ENTRADA_URL . "/communities/reports?section=user&community=" . $COMMUNITY_ID . "&user=" . $statistic["user_id"] . "\">" . $statistic['fullname'] . "</a> ";
$activity_message .= $user_action . " the <a href=\"" . ENTRADA_URL . "/communities/reports?section=type&community=" . $COMMUNITY_ID . "&type=" . $module[2] . "\">" . ucwords($module[2]) . "</a>";
$activity_message .= " titled <a href=\"" . ENTRADA_URL . "/communities/reports?section=page&community=" . $COMMUNITY_ID . "&page=" . $statistic["action_field"] . "-" . $statistic["action_value"] . "\">" . (isset($statistic["page"]) ? $statistic["page"] : "-") . "</a>";
$activity_message .= " at " . date('D M j/y h:i a', $statistic['timestamp']);
echo "<li" . (!($key % 2) ? " style=\"background-color: #F4F4F4\"" : "") . ">" . $activity_message . "</li>";
}
?>
</ul><?php
} else {
add_notice('No statistics available for ' . $community_details["community_title"] . '.');
echo display_notice();
}
?>
<!--/TRACKING EDITS-->
<?php
break;
}
} else {
application_log("error", "User tried to modify a community, but they aren't an administrator of this community.");
$ERROR++;
$ERRORSTR[] = "You do not appear to be an administrator of the community that you are trying to modify.<br /><br />If you feel you are getting this message in error, please contact the MEdTech Unit (page feedback on left) and we will investigate. The MEdTech Unit has automatically been informed that this error has taken place.";
echo display_error();
}
} else {
application_log("error", "User tried to modify a community id [" . $COMMUNITY_ID . "] that does not exist or is not active in the system.");
示例8: add_notice
?>
>Inactive</option>
</select>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
<div id="no_period_msg">
<?php
add_notice("There are no active periods for this curriculum type.");
echo display_notice();
?>
</div>
<script type="text/javascript">
var rowTemplate = ' <tr id="period_:id" class="curriculum_period success">\n\
<td><input type="checkbox" class="remove_checkboxes" id="remove_:id" value=":id"/></td>\n\
<td>\
<div class="input-append">\
<input type="text" name="curriculum_start_date[:id]" id="start_:id" class="start_date input-small" value=":date" />\
<button class="btn calendar" type="button" id="start_calendar_:id"><i class="icon-calendar"></i></button>\
</div>\
</td>\n\
<td>\
<div class="input-append">\
<input type="text" name="curriculum_finish_date[:id]" id="finish_:id" class="end_date input-small" value=":date" />\
示例9: add_notice
<?php
break;
default:
echo "No statistics for this marking scheme.";
break;
}
?>
</div>
<?php
if ($students && @count($students) >= 1) {
?>
<div class="row-fluid">
<?php
if (isset($_POST["error_grades"]) && @count($_POST["error_grades"])) {
$error_grades = $_POST["error_grades"];
add_notice(count($_POST["error_grades"]) > 1 ? "Errors were encountered while importing the CSV.<br /><br /> Please manually update the grades of each of the <strong>" . count($_POST["error_grades"]) . " highlighted students</strong>, otherwise those students' grades will be left as what they were prior to the CSV import process." : "An error was encountered while importing the CSV.<br /><br /> Please manually update the grade of the <strong>highlighted student</strong>, otherwise the grade for that student will be left as it was prior to the CSV import process.");
echo display_notice();
}
$editable = $ENTRADA_ACL->amIAllowed(new GradebookResource($course_details["course_id"], $course_details["organisation_id"]), "update") ? "gradebook_editable" : "gradebook_not_editable";
?>
<div id="gradebook_grades" class="span12">
<h2>Grades</h2>
<div style="margin-bottom: 5px;">
<span class="content-small"><strong>Tip: </strong><?php
echo $assessment["marking_scheme_description"];
?>
</span>
</div>
<table class="gradebook single <?php
echo $editable;
?>
示例10: foreach
<tbody>
<?php
if ($results) {
foreach ($results as $result) {
$url = ENTRADA_URL . "/profile/gradebook/assignments?section=view&id=" . $result["assignment_id"];
echo "<tr id=\"assignment-" . $result["assignment_id"] . "\">";
echo "<td class=\"modified\" width=\"20\"><img src=\"" . ENTRADA_URL . "/images/pixel.gif\" width=\"19\" height=\"19\" alt=\"\" title=\"\" /></td>";
echo "<td colspan=\"3\"><a href=\"{$url}\">" . $result["assignment_title"] . "</a></td>";
echo "<td colspan=\"2\"><a href=\"{$url}\">" . $result["course_code"] . "</a></td>";
echo "<td colspan=\"2\"><a href=\"{$url}\">" . ($result["due_date"] == 0 ? "No Due Date" : date(DEFAULT_DATE_FORMAT, $result["due_date"])) . "</a></td>";
echo "</tr>";
}
} else {
?>
<tr><td><?php
add_notice('No Assignments have been created for this course.');
echo display_notice();
?>
</td></tr><?php
}
?>
</tbody>
</table>
<?php
break;
case strpos($PAGE_URL, "assessment_strategies") !== false:
if ($ENTRADA_USER->getGroup() == 'student') {
$student_sql = "AND a.`cohort` = " . $db->qstr($ENTRADA_USER->getCohort());
} else {
$student_sql = "";
}
示例11: save_post_settings
/**
* Save Post Settings
* */
function save_post_settings()
{
wp_redirect(add_query_arg('page', WSW_Dashboard::page_id, admin_url('admin.php')));
add_notice(' Save Settings', 'update');
exit;
}
示例12: add_notice
} else {
echo "<td>-</td><td>-</td><td>-</td>";
}
echo "</tr>";
$count++;
}
?>
</tbody>
</table>
<?php
} else {
if ($procedure_total > 0) {
add_notice("No objectives have been mapped to events.");
echo display_notice();
} else {
add_notice("No events to report on for this student.");
echo display_notice();
}
}
?>
</div>
<?php
}
} else {
$NOTICE++;
$NOTICESTR[] = "No objectives to report on. Please make sure you have mapped objectives on the details tab.";
echo display_notice();
}
?>
<div class="row-fluid">
<a class="btn pull-left no-printing" href="<?php
示例13: process_schedules
public static function process_schedules()
{
$schedules = get_option('wpem-schedules');
$day_now = strtotime(date('Y-m-d'));
$mail_sent = $count = 0;
foreach ((array) $schedules as $schedule) {
$next_send = self::next_send(strtotime($schedule['start_date']), $schedule['frequency'], strtotime($schedule['end_date']));
if ($day_now == $next_send) {
$mail_sent += EM_Mailer::send_mail($schedule);
$count++;
}
}
if ($mail_sent) {
add_notice(sprintf(__('%s scheduled emails were sent to %s email addresses', 'wpem'), $count, $mail_sent));
}
}
示例14: foreach
?>
" method="post">
<table class="tableList" cellspacing="0" cellpadding="1" border="0" summary="List of Restricted Days">
<colgroup>
<col class="modified" />
<col class="title" />
</colgroup>
<thead>
<tr>
<td class="modified"> </td>
<td class="title">Restricted Day</td>
</tr>
</thead>
<tbody>
<?php
foreach ($restricted_days as $restricted_day) {
echo "<tr><td><input type=\"checkbox\" name = \"remove_ids[]\" value=\"" . $restricted_day->getID() . "\"/></td>";
echo "<td><a href=\"" . ENTRADA_URL . "/admin/settings/manage/restricteddays?section=edit&org=" . $ORGANISATION_ID . "&day_id=" . $restricted_day->getID() . "\">" . $restricted_day->getName() . "</a></td></tr>";
}
?>
</tbody>
</table>
<br />
<input type="submit" class="btn btn-danger" value="Delete Selected" />
</form>
<?php
} else {
add_notice("There are currently no Restricted Days assigned to this Organisation");
echo display_notice();
}
}
示例15: html_encode
echo "<option id=\"objective-item-" . $objective->getID() . "\" class=\"logged\" value=\"" . $objective->getID() . "\">" . html_encode($objective->getName()) . "</option>\n";
}
echo "</optgroup>\n";
}
echo "<optgroup label=\"Objectives Logged in this Entry\" id=\"objectives-entry\">\n";
if (@count($objectives["disabled"])) {
foreach ($objectives["disabled"] as $objective) {
echo "<option id=\"objective-item-" . $objective->getID() . "\" value=\"" . $objective->getID() . "\" disabled=\"disabled\">" . html_encode($objective->getName()) . "</option>\n";
}
}
echo "</optgroup>\n";
?>
</select>
<?php
} else {
add_notice("An issue was encountered while attempting to fetch the available logbook objectives for the selected course.");
echo display_notice();
}
} else {
add_notice("Please select a <strong>Rotation</strong> from list above to begin adding logbook objectives to this entry.");
echo display_notice();
}
if ($ajax) {
exit;
} else {
?>
</span>
</div>
<?php
}
}