本文整理汇总了PHP中_AC函数的典型用法代码示例。如果您正苦于以下问题:PHP _AC函数的具体用法?PHP _AC怎么用?PHP _AC使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_AC函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Send
/**
* Appends a custom AChecker footer to all outgoing email then sends the email.
* If mail_queue is enabled then instead of sending the mail out right away, it
* places it in the database and waits for the cron to send it using SendQueue().
* The mail queue does not support reply-to, or attachments, and converts all BCCs
* to regular To emails.
* @access public
* @return boolean whether or not the mail was sent (or queued) successfully.
* @see parent::send()
* @since AChecker 0.2
* @author Joel Kronenberg
*/
function Send()
{
global $_config;
// attach the AChecker footer to the body first:
$this->Body .= "\n\n" . '----------------------------------------------' . "\n";
$this->Body .= _AC('sent_via_achecker', AC_BASE_HREF);
$this->Body .= "\n" . _AC('achecker_home') . ': http://achecker.ca';
// if this email has been queued then don't send it. instead insert it in the db
// for each bcc or to or cc
if ($_config['enable_mail_queue'] && !$this->attachment) {
require_once AC_INCLUDE_PATH . 'classes/DAO/MailQueueDAO.class.php';
$mailQueueDAO = new MailQueueDAO();
for ($i = 0; $i < count($this->to); $i++) {
$mailQueueDAO->Create(addslashes($this->to[$i][0]), addslashes($this->to[$i][1]), addslashes($this->From), addslashes($this->FromName), addslashes($this->Subject), addslashes($this->Body), addslashes($this->CharSet));
}
for ($i = 0; $i < count($this->cc); $i++) {
$mailQueueDAO->Create(addslashes($this->cc[$i][0]), addslashes($this->cc[$i][1]), addslashes($this->From), addslashes($this->FromName), addslashes($this->Subject), addslashes($this->Body), addslashes($this->CharSet));
}
for ($i = 0; $i < count($this->bcc); $i++) {
$mailQueueDAO->Create(addslashes($this->bcc[$i][0]), addslashes($this->bcc[$i][1]), addslashes($this->From), addslashes($this->FromName), addslashes($this->Subject), addslashes($this->Body), addslashes($this->CharSet));
}
return true;
} else {
return parent::Send();
}
}
示例2: print_feedback
function print_feedback($feedback, $notes = '')
{
?>
<div class="input-form">
<table border="0" class="fbkbox" cellpadding="3" cellspacing="2" width="100%" summary="" align="center">
<tr class="fbkbox">
<td><h3 class="feedback2"><img src="images/feedback.gif" align="top" alt="" class="img" /> <?php
echo _AC('AC_FEEDBACK_UPDATE_INSTALLED_SUCCESSFULLY');
?>
</h3>
<?php
echo '<ul>';
foreach ($feedback as $p) {
echo '<li>' . $p . '</li>';
}
echo '</ul>';
?>
</td>
</tr>
<tr>
<td>
<?php
echo $notes;
?>
</td>
</tr>
</table>
</div>
<?php
}
示例3: print_handbook
function print_handbook($handbook_pages)
{
global $_pages;
foreach ($handbook_pages as $page_key => $page_value) {
if (is_array($page_value)) {
if (isset($_pages[$page_key])) {
echo _AC($_pages[$page_key]['guide']) . "<br /><br />";
print_handbook($page_value);
}
} else {
if (isset($_pages[$page_value])) {
echo _AC($_pages[$page_value]['guide']) . "<br /><br />";
}
}
}
}
示例4: get_status_by_code
function get_status_by_code($status_code)
{
if ($status_code == AC_STATUS_DISABLED) {
return _AC('disabled');
} else {
if ($status_code == AC_STATUS_ENABLED) {
return _AC('enabled');
} else {
if ($status_code == AC_STATUS_DEFAULT) {
return _AC('default');
} else {
if ($status_code == AC_STATUS_UNCONFIRMED) {
return _AC('unconfirmed');
} else {
return '';
}
}
}
}
}
示例5: hb_print_toc
/**
* handbook toc printer
* prints an unordered html list representation of the multidimensional array.
* $handbook_pages the array of items to print.
* $section the directory name of the files.
*/
function hb_print_toc($handbook_pages)
{
global $_pages;
echo '<ul id="handbook-toc">';
foreach ($handbook_pages as $page_key => $page_value) {
echo '<li>';
if (is_array($page_value)) {
if (isset($_pages[$page_key])) {
echo '<a href="frame_content.php?p=' . $page_key . '" id="id' . $page_key . '" class="tree">' . _AC($_pages[$page_key]['title_var']) . '</a>';
hb_print_toc($page_value);
}
} else {
if (isset($_pages[$page_value])) {
echo '<a href="frame_content.php?p=' . $page_value . '" id="id' . $page_value . '" class="leaf">' . _AC($_pages[$page_value]['title_var']) . '</a>';
}
}
echo '</li>';
}
echo '</ul>';
}
示例6: Update
/**
* Update an existing user group
* @access public
* @param user_group_id
* title
* description
* @return user id, if successful
* false and add error into global var $msg, if unsuccessful
* @author Cindy Qi Li
*/
public function Update($user_group_id, $title, $description)
{
global $addslashes, $msg;
$missing_fields = array();
$user_group_id = intval($user_group_id);
$title = $addslashes(trim($title));
$description = $addslashes(trim($description));
/* login name check */
if ($title == '') {
$missing_fields[] = _AC('title');
}
if ($missing_fields) {
$missing_fields = implode(', ', $missing_fields);
$msg->addError(array('EMPTY_FIELDS', $missing_fields));
}
if (!$msg->containsErrors()) {
/* insert into the db */
$sql = "UPDATE " . TABLE_PREFIX . "user_groups\n\t\t\t SET title = '" . $title . "',\n\t\t\t description = '" . $description . "',\n\t\t\t last_update = now()\n\t\t\t WHERE user_group_id = " . $user_group_id;
return $this->execute($sql);
}
}
示例7: dispaly_check_table
function dispaly_check_table($checks_array)
{
if (is_array($checks_array)) {
?>
<table class="data" rules="rows" >
<thead>
<tr>
<th align="center"><?php
echo _AC('html_tag');
?>
</th>
<th align="center"><?php
echo _AC('error_type');
?>
</th>
<th align="center"><?php
echo _AC('description');
?>
</th>
<th align="center"><?php
echo _AC('check_id');
?>
</th>
</tr>
</thead>
<tbody>
<?php
foreach ($checks_array as $check_row) {
?>
<tr>
<td><?php
echo htmlspecialchars($check_row['html_tag']);
?>
</td>
<td><?php
echo get_confidence_by_code($check_row['confidence']);
?>
</td>
<td><span class="msg"><a target="_new" href="<?php
echo AC_BASE_HREF;
?>
checker/suggestion.php?id=<?php
echo $check_row["check_id"];
?>
" onclick="AChecker.popup('<?php
echo AC_BASE_HREF;
?>
checker/suggestion.php?id=<?php
echo $check_row["check_id"];
?>
'); return false;"><?php
echo htmlspecialchars(_AC($check_row['name']));
?>
</a></span></td>
<td><?php
echo $check_row['check_id'];
?>
</td>
</tr>
<?php
}
// end of foreach
?>
</tbody>
</table>
<?php
}
// end of if
}
示例8: define
/* Inclusive Design Institute */
/* */
/* This program is free software. You can redistribute it and/or */
/* modify it under the terms of the GNU General Public License */
/* as published by the Free Software Foundation. */
/************************************************************************/
// $Id: index.php 495 2011-02-10 21:27:00Z cindy $
// Called by ajax request from guidelineline view report -> "make decision(s)" buttons
// @ see checker/js/checker.js
define('AC_INCLUDE_PATH', '../include/');
include AC_INCLUDE_PATH . 'vitals.inc.php';
include_once AC_INCLUDE_PATH . 'classes/Utility.class.php';
include_once AC_INCLUDE_PATH . 'classes/DAO/GuidelinesDAO.class.php';
include_once AC_INCLUDE_PATH . 'classes/DAO/UserLinksDAO.class.php';
// main process to save decisions
$guidelinesDAO = new GuidelinesDAO();
$guideline_rows = $guidelinesDAO->getGuidelineByIDs($_POST['gids']);
if (!is_array($guideline_rows)) {
echo _AC("AC_ERROR_EMPTY_GID");
exit;
}
$utility = new Utility();
$seals = $utility->getSeals($guideline_rows);
if (is_array($seals)) {
$userLinksDAO = new UserLinksDAO();
$rows = $userLinksDAO->getByUserIDAndURIAndSession($_SESSION['user_id'], $_POST['uri'], $_POST['jsessionid']);
$savant->assign('user_link_id', $rows[0]['user_link_id']);
$savant->assign('seals', $seals);
$savant->display('checker/seals.tmpl.php');
}
exit;
示例9: header
} else {
if ($usersDAO->Update($_GET['id'], $_POST['user_group_id'], $_POST['login'], $_POST['email'], $_POST['first_name'], $_POST['last_name'], $_POST['status'])) {
$msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
header('Location: index.php');
exit;
}
}
}
}
}
// end of handle submit
// initialize page
$userGroupsDAO = new UserGroupsDAO();
if (isset($_GET['id'])) {
$usersDAO = new UsersDAO();
$savant->assign('user_row', $usersDAO->getUserByID($_GET['id']));
$savant->assign('show_password', false);
} else {
$savant->assign('show_password', true);
}
/*****************************/
/* template starts down here */
global $onload;
$onload = 'document.form.login.focus();';
$savant->assign('show_user_group', true);
$savant->assign('show_status', true);
$savant->assign('all_user_groups', $userGroupsDAO->getAll());
$savant->assign('title', _AC('create_edit_user'));
$savant->assign('submit_button_text', _AC('save'));
$savant->assign('show_captcha', false);
$savant->display('register.tmpl.php');
示例10: isFieldsValid
/**
* Validate fields preparing for insert and update
* @access private
* @param $html_tag
* $confidence
* $name
* $err
* $open_to_public
* @return true if all fields are valid
* false if any field is not valid
* @author Cindy Qi Li
*/
private function isFieldsValid($html_tag, $confidence, $name, $err, $open_to_public)
{
global $msg;
$missing_fields = array();
if ($html_tag == '') {
$missing_fields[] = _AC('html_tag');
}
if ($confidence != KNOWN && $confidence != LIKELY && $confidence != POTENTIAL) {
$missing_fields[] = _AC('error_type');
}
if ($name == '') {
$missing_fields[] = _AC('name');
}
if ($err == '') {
$missing_fields[] = _AC('error');
}
if ($open_to_public != 0 && $open_to_public != 1) {
$missing_fields[] = _AC('open_to_public');
}
if ($missing_fields) {
$missing_fields = implode(', ', $missing_fields);
$msg->addError(array('EMPTY_FIELDS', $missing_fields));
}
if (!$msg->containsErrors()) {
return true;
} else {
return false;
}
}
示例11: header
}
if (isset($_GET['gg'])) {
$guidelineGroupsDAO->Delete($_GET['gg']);
}
header('Location: create_edit_guideline.php?id=' . $gid);
exit;
}
// interface display
if (!isset($gid)) {
// create guideline
$checksDAO = new ChecksDAO();
$savant->assign('author', $_current_user->getUserName());
} else {
// edit existing guideline
$checksDAO = new ChecksDAO();
$rows = $guidelinesDAO->getGuidelineByIDs($gid);
// get author name
$usersDAO = new UsersDAO();
$user_name = $usersDAO->getUserName($rows[0]['user_id']);
if (!$user_name) {
$user_name = _AC('author_not_exist');
}
$savant->assign('gid', $gid);
$savant->assign('row', $rows[0]);
$savant->assign('author', $user_name);
$savant->assign('checksDAO', $checksDAO);
}
if (isset($_current_user)) {
$savant->assign('is_admin', $_current_user->isAdmin());
}
$savant->display('guideline/create_edit_guideline.tmpl.php');
示例12: _AC
<input type="text" name="query" /> <input type="submit" name="search" value="<?php
echo _AC('search');
?>
" /> |
<a href="print.php?p=<?php
echo $this_page;
?>
" target="_top"><?php
echo _AC('print_version');
?>
</a>
<script type="text/javascript">
//<!--
document.writeln(' | ');
showTocToggle('<?php
echo _AC('show_contents');
?>
' ,'<?php
echo _AC('hide_contents');
?>
');
if (top.name == 'popup') {
toggleToc(true);
}
//-->
</script>
</form>
</body>
</html>
示例13: dispaly_check_table
/**
* Display checks in the given $checks_array in html table with 'remove' button at the bottom
* @param $checks_array : array of all checks to display
* @param $prefix: indicates where the checks belong to: guideline, guideline group or guideline subgroup.
* 'g_[guidelineID] for guideline checks
* 'gg_[groupID] for guideline group checks
* 'gsg_[subgroupID] for guideline subgroup checks
* @return a html table to display all checks in $checks_array
*/
function dispaly_check_table($checks_array, $prefix)
{
if (is_array($checks_array)) {
?>
<form name="input_form_<?php
echo $prefix;
?>
" method="post" action="<?php
echo $_SERVER['PHP_SELF'];
if (isset($_GET["id"])) {
echo '?id=' . $_GET["id"];
}
?>
" >
<table class="data" rules="rows" >
<thead>
<tr>
<th align="left" width="10%"><input type="checkbox" value="<?php
echo _AC('select_all');
?>
" id="all_del_<?php
echo $prefix;
?>
" title="<?php
echo _AC('select_all');
?>
" name="selectall_delchecks_<?php
echo $prefix;
?>
" onclick="CheckAll('del_checks_id_<?php
echo $prefix;
?>
[]','selectall_delchecks_<?php
echo $prefix;
?>
');" /></th>
<th align="left" width="20%"><?php
echo _AC('html_tag');
?>
</th>
<th align="left" width="20%"><?php
echo _AC('error_type');
?>
</th>
<th align="left" width="40%"><?php
echo _AC('description');
?>
</th>
<th align="left" width="10%"><?php
echo _AC('check_id');
?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="5">
<input type="submit" name="remove" value="<?php
echo _AC('remove');
?>
" onclick="javascript: return get_confirm();" />
</td>
</tr>
</tfoot>
<tbody>
<?php
foreach ($checks_array as $check_row) {
?>
<tr onmousedown="document.getElementById('del_checks_<?php
echo $prefix . '_' . $check_row['check_id'];
?>
').checked = !document.getElementById('del_checks_<?php
echo $prefix . '_' . $check_row['check_id'];
?>
').checked; togglerowhighlight(this, 'del_checks_<?php
echo $prefix . '_' . $check_row['check_id'];
?>
');"
onkeydown="document.getElementById('del_checks_<?php
echo $prefix . '_' . $check_row['check_id'];
?>
').checked = !document.getElementById('del_checks_<?php
echo $prefix . '_' . $check_row['check_id'];
?>
').checked; togglerowhighlight(this, 'del_checks_<?php
echo $prefix . '_' . $check_row['check_id'];
?>
');"
id="rdel_checks_<?php
//.........这里部分代码省略.........
示例14: htmlspecialchars
echo htmlspecialchars($_POST['name']);
} else {
echo htmlspecialchars(_AC($this->row['name']));
}
?>
</textarea></td>
</tr>
</table>
<div class="row">
<input type="submit" name="submit" value="<?php
echo _AC('submit');
?>
" class="submit" />
<input type="button" name="cancel" value="<?php
echo _AC('cancel');
?>
" onclick="javascript: self.close(); return false;" class="submit"/>
</div>
</fieldset>
</div>
</form>
<script type="text/JavaScript">
//<!--
function initial()
{
// set cursor focus
document.input_form.name.focus();
}
示例15: isFieldsValid
/**
* Validate fields preparing for insert and update
* @access private
* @param $title
* $abbr
* $create_new: flag to indicate if this is creating new record or update.
* true is to create new record, false is update record.
* if update record, only check abbr uniqueness when abbr is modified.
* $guidelineID: must be given at updating record, when $create_new == false
* @return true if all fields are valid
* false if any field is not valid
* @author Cindy Qi Li
*/
private function isFieldsValid($title, $abbr, $create_new, $guidelineID = 0)
{
global $msg;
// check missing fields
$missing_fields = array();
if ($title == '') {
$missing_fields[] = _AC('title');
}
if ($abbr == '') {
$missing_fields[] = _AC('abbr');
}
if ($missing_fields) {
$missing_fields = implode(', ', $missing_fields);
$msg->addError(array('EMPTY_FIELDS', $missing_fields));
}
if (!$create_new) {
$current_grow = $this->getGuidelineByIDs($guidelineID);
}
if ($create_new || !$create_new && $current_grow[0]['abbr'] != $abbr) {
// abbr must be unique
$sql = "SELECT * FROM " . TABLE_PREFIX . "guidelines WHERE abbr='" . $abbr . "'";
if (is_array($this->execute($sql))) {
$msg->addError('ABBR_EXISTS');
}
}
if (!$msg->containsErrors()) {
return true;
} else {
return false;
}
}