本文整理汇总了PHP中add_info函数的典型用法代码示例。如果您正苦于以下问题:PHP add_info函数的具体用法?PHP add_info怎么用?PHP add_info使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_info函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete_privilege
function delete_privilege($id, $priv_id)
{
$this->_model()->delete_privilege($id, $priv_id);
$this->cache->context_delete($this->_model()->CACHE_KEY_PRIVILEGE);
add_info(l('Privilege deleted.'));
redirect($_SERVER['HTTP_REFERER']);
}
示例2: _save
function _save($id = null)
{
$this->_view = $this->_name . '/show';
$model = $this->_model();
if ($_POST) {
if ($this->_validate()) {
$_POST['id'] = $id;
try {
$tags = $_POST['tags'];
unset($_POST['tags']);
$id = $model->save($_POST, $id);
$model->update_tag($tags, $id);
if (!$this->input->is_ajax_request()) {
redirect($this->_get_uri('listing'));
}
add_info($id ? l('Record updated') : l('Record added'));
} catch (Exception $e) {
add_error(l($e->getMessage()));
}
}
} else {
if ($id !== null) {
$this->_data['id'] = $id;
$_POST = $model->get($id);
$_POST['tags'] = $model->get_tag($id);
}
}
}
示例3: ReceiveSettings
function ReceiveSettings($formname = '')
{
$this->dataset = manage_receive_dataset_from_selector($formname);
if ($this->dataset == null) {
return false;
}
if ($this->dataset->GetID() < 0) {
add_info('Не указан набор данных');
return false;
}
$this->dataset->Ref();
$fields = array('uid' => 'INT', 'order' => 'INT');
$arr = $this->dataset->GenCreateFields();
foreach ($arr as $k => $v) {
$fields[$k] = $v;
}
$this->settings['dataset'] = array('id' => $this->dataset->GetID(), 'settings' => $this->dataset->GetSettings());
$this->settings['content'] = content_create_support_table($this->content_id, $this->dataset->GetID(), $fields);
$this->settings['script'] = -1;
$this->settings['itemScript'] = -1;
$this->settings['fullScript'] = -1;
$this->settings['detailed'] = $_POST[$formname . '_detailed'] ? 1 : 0;
$this->UpdateScripts();
$s = 'content_' . $this->content_id . '_count';
manage_settings_create('Количество элементов на странице для раздела ' . '«' . htmlspecialchars($this->GetName()) . '»', 'Разделы', $s, 'CSCSignedNumber');
opt_set($s, '10');
return true;
}
示例4: send
function send()
{
global $keystring, $login, $email;
$hash = md5('#RANDOM_PREFIX#' . mtime() . '#RANDOM_SEPARATOR#' . $login . '#WITH#' . $email . '#RANDOM_SUFFIX#');
if ($_SESSION['CAPTCHA_Keystring'] == '' || strtolower($keystring) != $_SESSION['CAPTCHA_Keystring']) {
add_info('Вы не прошли тест Тьюринга на подтверждение того, что вы не бот.');
return false;
}
$r = db_row_value('user', "(`login` =\"{$login}\") AND (`email`=\"{$email}\") AND (`authorized`=1)");
if ($r['id'] == '') {
add_info('Неверное сочетание login <-> email');
return false;
}
$s = unserialize($r['settings']);
if ($s['restore_timestamp'] && time() - $s['restore_timestamp'] < config_get('restore-timeout')) {
add_info('Вы не можете просить восстановку пароля так часто');
return false;
}
$s['restore_hash'] = $hash;
$s['restore_timestamp'] = time();
db_update('user', array('settings' => db_string(serialize($s))), '`id`=' . $r['id']);
$link = config_get('http-document-root') . '/login/restore/confirm/?id=' . $r['id'] . '&hash=' . $hash;
sendmail_tpl(stripslashes($email), 'Восстановление пароля в системе ' . config_get('site-name'), 'restore', array('login' => stripslashes($login), 'email' => stripslashes($email), 'link' => $link));
return true;
}
示例5: CanCreate
function CanCreate()
{
if (db_count('service', '`sclass` = "CSCLog"') == 0) {
return true;
}
add_info('Может существовать лишь один серфис журналирования.');
return false;
}
示例6: Update
function Update()
{
$name = htmlspecialchars(addslashes($this->name));
if (db_count('service', '`name`="' . $name . '" AND `id`<>' . $this->id) > 0) {
add_info('Сервис с таким именем уже существует.');
return false;
}
db_update('service', array('name' => "\"{$name}\""), '`id`=' . $this->id);
return true;
}
示例7: group_update
function group_update($id)
{
$name = htmlspecialchars(trim($_POST['name']));
if ($name == '') {
return;
}
if (db_count('group', '(`name`="' . $name . '") AND (`id`<>' . $id . ')') > 0) {
add_info('Группа с таким именем уже существует.');
} else {
db_update('group', array('name' => '"' . $name . '"', 'default' => manage_setting_get_received('default_group') ? 1 : 0), "`id`={$id}");
}
}
示例8: ReceiveSettings
function ReceiveSettings()
{
$this->dataset = manage_receive_dataset_from_selector($this->GetClassName());
if ($this->dataset == null) {
return false;
}
if ($this->dataset->GetID() < 0) {
add_info('Не указан набор данных');
return false;
}
$this->dataset->Ref();
$this->settings['dataset'] = array('id' => $this->dataset->GetID(), 'settings' => $this->dataset->GetSettings());
$this->settings['content'] = content_create_support_table($this->content_id, $this->dataset->GetID(), $this->dataset->GenCreateFields());
$this->settings['script'] = -1;
return true;
}
示例9: user_delete
function user_delete($id)
{
if (user_is_system($id)) {
add_info('Невозможно удалить этого пользователя, ' . 'так как он является системным.');
return false;
}
user_delete_from_groups($id);
hook_call('CORE.Security.OnUserDelete', $id);
return db_delete('user', 'id=' . $id);
}
示例10: UpdateCat
function UpdateCat($id, $name)
{
if (trim($name) == '') {
add_info('Название подкаталога не может быть пустым.');
return false;
}
db_update($this->settings['content'], array('name' => db_html_string($name)), "`id`={$id}");
return true;
}
示例11: _save
function _save($id = null)
{
$this->_view = $this->_name . '/show';
if ($_POST) {
if ($this->_validate()) {
$_POST['id'] = $id;
try {
$this->_model()->save($_POST, $id);
$referrer = $this->session->userdata('referrer');
if (empty($referrer)) {
$referrer = $this->_get_uri('listing');
}
add_info($id ? l('Record updated') : l('Record added'));
if (!$this->input->is_ajax_request()) {
redirect($referrer);
}
} catch (Exception $e) {
add_error(l($e->getMessage()));
}
}
} else {
if ($id !== null) {
$this->_data['id'] = $id;
$_POST = $this->_model()->get($id);
if (empty($_POST)) {
show_404($this->uri->uri_string);
}
}
$this->load->library('user_agent');
$this->session->set_userdata('referrer', $this->agent->referrer());
}
$this->_data['fields'] = $this->_model()->list_fields(true);
}
示例12: parameteres
/**
Redirects to the given request and Adds an information message to the global array of information $__info.
@param arg_arr_request the array that contains the request parameteres (Controller, action ...).
@param arg_str_info_msg [Optional] the message that is shown to the user.
@param arg_arr_info_params [Optional] any extra parameters added to the info message if the message text has placeholders (Like %s or %d).
@param arg_type [Optional] The type of the message that can be ("info" or "warning") which decides the style of the information shown.
@return the output of the new request.
*/
public static function redirect($arg_arr_request, $arg_str_info_msg = "", array $arg_arr_info_params = array(), $arg_type = "info")
{
global $__in;
if (!is_array($arg_arr_request)) {
$arr_req = split("/", $arg_arr_request);
$arg_arr_request = array();
if (count($arr_req) == 1) {
$arg_arr_request['action'] = $arr_req[0];
} else {
if (count($arr_req) == 2) {
$arg_arr_request['controller'] = $arr_req[0];
$arg_arr_request['action'] = $arr_req[1];
}
}
}
if ($arg_str_info_msg) {
add_info($arg_str_info_msg, $arg_arr_info_params, $arg_type);
}
if (!$arg_arr_request['controller']) {
$arg_arr_request['controller'] = $__in['controller'];
}
$_SESSION['__GET_REPITITION_STOPPER_OLD'] = $__in;
$_SESSION['__GET_REPITITION_STOPPER_NEW'] = $arg_arr_request;
$__in = $arg_arr_request;
return dispatcher::request();
}
示例13: Categories_Add
function Categories_Add($contest_id = -1)
{
global $name;
if (!$this->GetAllowed('CONTEST.MANAGE')) {
return;
}
if ($contest_id < 0) {
$contest_id = $_SESSION['WT_contest_id'];
}
$name = stripslashes($name);
if (trim($name) == '') {
add_info('Имя категории не может быть пустым.');
return false;
}
if (db_count('tester_categories', '`name`=' . db_string($name))) {
add_info('Категория с таким именем уже существует.');
return false;
}
$order = db_max('tester_categories', 'order', '`contest_id`=' . $_SESSION['WT_contest_id']) + 1;
db_insert('tester_categories', array('name' => db_string(htmlspecialchars($name)), 'contest_id' => $contest_id, 'order' => $order));
return true;
}
示例14: Create
function Create()
{
global $_POST;
$name = addslashes(htmlspecialchars(trim($this->name)));
$path = addslashes($this->path);
if ($name == '' || $path == '') {
return false;
}
if (!check_dir($path)) {
return false;
}
if (db_count('storage', '`name`="' . $name . '"')) {
add_info('Хранилище данных с таким именем уже существует.');
return false;
} else {
if (db_count('storage', '`path`="' . $path . '"')) {
add_info('Хранилище данных с таким путем уже существует.');
return false;
} else {
if (dir_exists($this->GetFullPath())) {
add_info('Данный путь уже используется в системе. Пожалуйста, укажите другой.');
return false;
} else {
$sdir = config_get('site-root') . config_get('document-root') . config_get('storage-root');
@mkdir($sdir);
@chmod($sdir, 0775);
@mkdir($this->GetFullPath());
@chmod($this->GetFullPath(), 0775);
db_insert('storage', array('name' => "\"{$name}\"", 'path' => "\"{$path}\""));
$this->id = db_last_insert();
db_create_table('storage_volume_' . $this->id, array('id' => 'INT NOT NULL PRIMARY KEY AUTO_INCREMENT', 'file' => 'TEXT', 'user_id' => 'INT', 'timestamp' => 'INT', 'accepted' => 'BOOL DEFAULT 0', 'params' => 'TEXT DEFAULT ""'));
return true;
}
}
}
}
示例15: delete_organization
function delete_organization($id, $priv_id)
{
$this->_model()->delete_organization($id, $priv_id);
add_info(l('Group data deleted.'));
redirect($_SERVER['HTTP_REFERER']);
}