本文整理汇总了PHP中flash_success函数的典型用法代码示例。如果您正苦于以下问题:PHP flash_success函数的具体用法?PHP flash_success怎么用?PHP flash_success使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了flash_success函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update_category
/**
* Show and process config category form
*
* @param void
* @return null
*/
function update_category()
{
$category = ConfigCategories::findById(get_id());
if (!$category instanceof ConfigCategory) {
flash_error(lang('config category dnx'));
$this->redirectToReferer(get_url('administration'));
}
// if
if ($category->isEmpty()) {
flash_error(lang('config category is empty'));
$this->redirectToReferer(get_url('administration'));
}
// if
$options = $category->getOptions(false);
$categories = ConfigCategories::getAll(false);
tpl_assign('category', $category);
tpl_assign('options', $options);
tpl_assign('config_categories', $categories);
$submitted_values = array_var($_POST, 'options');
if (is_array($submitted_values)) {
foreach ($options as $option) {
$new_value = array_var($submitted_values, $option->getName());
if (is_null($new_value) || $new_value == $option->getValue()) {
continue;
}
$option->setValue($new_value);
$option->save();
}
// foreach
flash_success(lang('success update config category', $category->getDisplayName()));
$this->redirectTo('administration', 'configuration');
}
// if
$this->setSidebar(get_template_path('update_category_sidebar', 'config'));
}
示例2: index
/**
* Show invoicing settings panel
*
* @param void
* @return null
*/
function index()
{
require_once INVOICING_MODULE_PATH . '/models/InvoicePdfGenerator.class.php';
$paper_formats = array(PAPER_FORMAT_A4, PAPER_FORMAT_A3, PAPER_FORMAT_A5, PAPER_FORMAT_LETTER, PAPER_FORMAT_LEGAL);
$paper_orientations = array(PAPER_ORIENTATION_PORTRAIT, PAPER_ORIENTATION_LANDSCAPE);
$pdf_settings_data = $this->request->post('pdf_settings');
if (!is_array($pdf_settings_data)) {
$pdf_settings_data = array('paper_format' => ConfigOptions::getValue('invoicing_pdf_paper_format'), 'paper_orientation' => ConfigOptions::getValue('invoicing_pdf_paper_orientation'), 'header_text_color' => ConfigOptions::getValue('invoicing_pdf_header_text_color'), 'page_text_color' => ConfigOptions::getValue('invoicing_pdf_page_text_color'), 'border_color' => ConfigOptions::getValue('invoicing_pdf_border_color'), 'background_color' => ConfigOptions::getValue('invoicing_pdf_background_color'));
}
// if
if ($this->request->isSubmitted()) {
db_begin_work();
ConfigOptions::setValue('invoicing_pdf_paper_format', array_var($pdf_settings_data, 'paper_format', 'A4'));
ConfigOptions::setValue('invoicing_pdf_paper_orientation', array_var($pdf_settings_data, 'paper_orientation', 'Portrait'));
ConfigOptions::setValue('invoicing_pdf_header_text_color', array_var($pdf_settings_data, 'header_text_color', '000000'));
ConfigOptions::setValue('invoicing_pdf_page_text_color', array_var($pdf_settings_data, 'page_text_color', '000000'));
ConfigOptions::setValue('invoicing_pdf_border_color', array_var($pdf_settings_data, 'border_color', '000000'));
ConfigOptions::setValue('invoicing_pdf_background_color', array_var($pdf_settings_data, 'background_color', 'FFFFFF'));
db_commit();
flash_success('Successfully modified PDF settings');
$this->redirectTo('admin_invoicing_pdf');
}
// if
$this->smarty->assign(array('paper_formats' => $paper_formats, 'paper_orientations' => $paper_orientations, 'pdf_settings_data' => $pdf_settings_data));
}
示例3: delete
/**
* Delete version
*
* @param void
* @return null
*/
function delete()
{
if ($this->request->isSubmitted()) {
if (!$this->active_page_version->canDelete($this->logged_user)) {
$this->httpError(HTTP_ERR_FORBIDDEN);
}
// if
$delete = $this->active_page_version->delete();
if ($delete && !is_error($delete)) {
if ($this->request->isAsyncCall()) {
$this->httpOk();
} else {
flash_success('Version #:version has been deleted', array('version' => $this->active_page_version->getVersion()));
}
// if
} else {
if ($this->request->isAsyncCall()) {
$this->httpError(HTTP_ERR_OPERATION_FAILED);
} else {
flash_success('Failed to delete version #:version', array('version' => $this->active_page_version->getVersion()));
}
// if
}
// if
$this->redirectToUrl($this->active_page->getViewUrl());
} else {
$this->httpError(HTTP_ERR_BAD_REQUEST);
}
// if
}
示例4: index
/**
* Settings form
*
* @param void
* @return null
*/
function index()
{
js_assign('test_svn_url', assemble_url('admin_source_test_svn'));
$source_data = $this->request->post('source');
if (!is_foreachable($source_data)) {
$source_data = array('svn_path' => ConfigOptions::getValue('source_svn_path'), 'svn_config_dir' => ConfigOptions::getValue('source_svn_config_dir'), 'source_svn_use_output_redirect' => ConfigOptions::getValue('source_svn_use_output_redirect'), 'source_svn_trust_server_cert' => ConfigOptions::getValue('source_svn_trust_server_cert'));
}
// if
if ($this->request->isSubmitted()) {
$svn_path = array_var($source_data, 'svn_path', null);
$svn_path = $svn_path ? with_slash($svn_path) : null;
ConfigOptions::setValue('source_svn_path', $svn_path);
$svn_config_dir = array_var($source_data, 'svn_config_dir') == '' ? null : array_var($source_data, 'svn_config_dir');
ConfigOptions::setValue('source_svn_config_dir', $svn_config_dir);
$svn_use_output_redirection = array_var($source_data, 'source_svn_use_output_redirect') == "1";
ConfigOptions::setValue('source_svn_use_output_redirect', $svn_use_output_redirection);
$svn_trust_server_certificate = array_var($source_data, 'source_svn_trust_server_cert') == "1";
ConfigOptions::setValue('source_svn_trust_server_cert', $svn_trust_server_certificate);
flash_success("Source settings successfully saved");
$this->redirectTo('admin_source');
}
// if
if (!RepositoryEngine::executableExists()) {
$this->wireframe->addPageMessage(lang("SVN executable not found. You won't be able to use this module"), 'error');
}
// if
$this->smarty->assign(array('source_data' => $source_data));
}
示例5: add
function add()
{
$pt = DB::escape(array_var($_GET, 'pt'));
$t = DB::escape(array_var($_GET, 't'));
$dep = ProjectTaskDependencies::findOne(array('conditions' => "`previous_task_id` = {$pt} AND `task_id` = {$t}"));
if (!$dep instanceof ProjectTaskDependency) {
try {
DB::beginWork();
$dep = new ProjectTaskDependency();
$dep->setPreviousTaskId(array_var($_GET, 'pt'));
$dep->setTaskId(array_var($_GET, 't'));
$dep->save();
DB::commit();
} catch (Exception $e) {
flash_error($e->getMessage());
DB::rollback();
}
}
flash_success(lang('success add task dependency'));
$reload = array_var($_GET, 'reload', true);
if ($reload) {
ajx_current("reload");
} else {
ajx_current("empty");
}
}
示例6: index
/**
* Show pages
*
* @param string $type
*/
public function index($action = '', $subaction = NULL)
{
new Menu_Tabs('pages', Url::gear('pages'));
switch ($action) {
case 'create':
if (!page_access('pages create')) {
return;
}
$form = new Form('Pages.createdit');
if ($result = $form->result()) {
$page = new Pages_Object();
$page->object($result);
$page->aid = cogear()->user->id;
$page->created_date = time();
$page->last_update = time();
$page->save();
flash_success(t('New page has been successfully added!', 'Pages'));
redirect($page->getUrl());
}
append('content', $form->render());
break;
case 'show':
$this->showPage($subaction);
break;
case 'edit':
$page = new Pages_Object();
$page->where('id', intval($subaction));
if ($page->find()) {
if (access('pages edit_all') or $cogear->user->id == $page->aid) {
$form = new Form('Pages.createdit');
$form->init();
if (access('pages delete')) {
$form->addElement('delete', array('label' => t('Delete'), 'type' => 'submit'));
}
$form->setValues($page->object());
if ($result = $form->result()) {
if ($result->delete) {
$page->delete();
redirect(Url::gear('pages'));
}
$page->object()->mix($result);
$page->last_update = time();
$page->update();
$link = $page->getUrl();
success(t('Page has been update. You can visit it by link <a href="%s">%s</a>', 'Pages', $link, $link));
//redirect($page->getUrl());
}
$form->elements->submit->setValue(t('Update'));
append('content', $form->render());
} else {
return _403();
}
} else {
return _404();
}
break;
default:
$this->showPages($action);
}
}
示例7: enable_all_context_help
function enable_all_context_help()
{
$context_help_options = UserWsConfigOptions::getOptionsByCategoryName('context help', true);
foreach ($context_help_options as $option) {
set_user_config_option($option->getName(), true, logged_user()->getId());
}
ajx_current("empty");
flash_success(lang('success enable all context help'));
}
示例8: admin_action
/**
* Настройки
*/
public function admin_action()
{
$form = new Form(array('#name' => 'admin.parser', 'title' => array('label' => t('Настройки')), 'nl2br' => array('type' => 'checkbox', 'label' => t('Автоматическая обработка строк'), 'value' => config('Parser.nl2br')), 'save' => array()));
if ($result = $form->result()) {
$this->set('Parser.nl2br', $result->nl2br);
flash_success(t('Настройки сохранены!'));
reload();
}
$form->show();
}
示例9: show_context_help
function show_context_help()
{
$show_context_help = array_var($_GET, 'show_context_help');
set_user_config_option('show_context_help', $show_context_help, logged_user()->getId());
ajx_current("empty");
if ($show_context_help == 'until_close') {
flash_success(lang('success enable context help'));
} else {
flash_success(lang('success disable context help'));
}
}
示例10: delete_state
function delete_state()
{
$this->setTemplate(get_template_path('back'));
ajx_current("empty");
try {
$query = "DELETE FROM `" . TABLE_PREFIX . "guistate` WHERE `contact_id` = " . DB::escape(logged_user()->getId());
DB::executeAll($query);
flash_success(lang("success reset gui state"));
} catch (Exception $e) {
flash_error($e->getMessage());
}
}
示例11: index
/**
* Reset access data
*
* @param string $action
*/
public function index($action = NULL)
{
if ($this->user->id != 1) {
back();
}
switch ($action) {
case 'reset':
$this->clear();
flash_success(t('Access rights have been reseted successfully!', 'Access'));
back();
break;
}
}
示例12: delete
/**
* Delete specific user
*
* @access public
* @param void
* @return null
*/
function delete()
{
$this->setTemplate('del_user');
$user = Users::findById(get_id());
if (!$user instanceof User) {
flash_error(lang('user dnx'));
$this->redirectTo('administration');
}
// if
if (!$user->canDelete(logged_user())) {
flash_error(lang('no access permissions'));
$this->redirectToReferer(get_url('dashboard'));
}
// if
$delete_data = array_var($_POST, 'deleteUser');
tpl_assign('user', $user);
tpl_assign('delete_data', $delete_data);
if (!is_array($delete_data)) {
$delete_data = array('really' => 0, 'password' => '');
// array
tpl_assign('delete_data', $delete_data);
} else {
if ($delete_data['really'] == 1) {
$password = $delete_data['password'];
if (trim($password) == '') {
tpl_assign('error', new Error(lang('password value missing')));
return $this->render();
}
if (!logged_user()->isValidPassword($password)) {
tpl_assign('error', new Error(lang('invalid login data')));
return $this->render();
}
try {
DB::beginWork();
$user->delete();
ApplicationLogs::createLog($user, null, ApplicationLogs::ACTION_DELETE);
DB::commit();
flash_success(lang('success delete user', $user->getDisplayName()));
} catch (Exception $e) {
DB::rollback();
flash_error(lang('error delete user'));
}
// try
$this->redirectToUrl($user->getCompany()->getViewUrl());
} else {
flash_error(lang('error delete user'));
$this->redirectToUrl($user->getCompany()->getViewUrl());
}
}
}
示例13: __construct
function __construct($request)
{
parent::__construct($request);
$three_o_four_data = $this->request->post('three_o_four');
if (!is_array($three_o_four_data)) {
$three_o_four_data = array('etag_enabled' => ConfigOptions::getValue('three_o_four_etag_enabled'), 'response_cache_enabled' => ConfigOptions::getValue('three_o_four_response_cache_enabled'));
}
// if
$this->smarty->assign(array('three_o_four' => $three_o_four_data));
if ($this->request->isSubmitted()) {
ConfigOptions::setValue('three_o_four_etag_enabled', array_var($three_o_four_data, 'etag_enabled', null));
ConfigOptions::setValue('three_o_four_response_cache_enabled', array_var($three_o_four_data, 'response_cache_enabled', null));
flash_success('Cache settings have been updated');
$this->redirectTo('three_o_four_settings');
}
}
示例14: index
/**
* Main Backup page
*
*/
function index()
{
$backup_data = $this->request->post('backup');
if (!is_array($backup_data)) {
$backup_data = array('enabled' => $this->backup_enabled, 'how_many_backups' => $this->how_many_backups);
}
// if
$this->smarty->assign(array('backup_data' => $backup_data, 'how_many_values' => array(3, 5, 10, 15, 30, 60)));
if ($this->request->isSubmitted()) {
ConfigOptions::setValue('backup_enabled', (bool) array_var($backup_data, 'enabled', 0));
$how_many = (int) array_var($backup_data, 'how_many_backups', 5);
ConfigOptions::setValue('backup_how_many_backups', $how_many < 0 ? 5 : $how_many);
flash_success('Backup settings have been updated');
$this->redirectTo('admin');
}
// if
}
示例15: index
/**
* PublicSubmitAdmin index page
*
*/
function index()
{
$public_submit_data = $this->request->post('public_submit');
if (!is_array($public_submit_data)) {
$public_submit_data = array('project_id' => ConfigOptions::getValue('public_submit_default_project'), 'enabled' => ConfigOptions::getValue('public_submit_enabled'), 'captcha' => ConfigOptions::getValue('public_submit_enable_captcha'));
}
// if
$this->smarty->assign(array('public_submit_data' => $public_submit_data));
if ($this->request->isSubmitted()) {
ConfigOptions::setValue('public_submit_default_project', array_var($public_submit_data, 'project_id', null));
ConfigOptions::setValue('public_submit_enabled', array_var($public_submit_data, 'enabled', null));
ConfigOptions::setValue('public_submit_enable_captcha', array_var($public_submit_data, 'captcha', null));
flash_success('Public Submit settings have been updated');
$this->redirectTo('admin_settings_public_submit');
}
// if
}