当前位置: 首页>>代码示例>>PHP>>正文


PHP adm_back_link函数代码示例

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


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

示例1: main

 function main($id, $mode)
 {
     global $config, $user, $template, $request;
     $this->tpl_name = 'acp_linkmenu_config';
     $this->page_title = $user->lang['ACP_LINKMENU_SETTINGS'];
     add_form_key('acp_linkmenu_config');
     $submit = $request->is_set_post('submit');
     if ($submit) {
         if (!check_form_key('acp_linkmenu_config')) {
             trigger_error('FORM_INVALID');
         }
         $config->set('linkmenu_enable', $request->variable('linkmenu_enable', 0));
         $config->set('linkmenu_enable_first', $request->variable('linkmenu_enable_first', 0));
         $config->set('linkmenu_name_field_first', utf8_normalize_nfc($request->variable('linkmenu_name_field_first', '', true)));
         $config->set('linkmenu_text_field_first', utf8_normalize_nfc($request->variable('linkmenu_text_field_first', '', true)));
         $config->set('linkmenu_enable_second', $request->variable('linkmenu_enable_second', 0));
         $config->set('linkmenu_name_field_second', utf8_normalize_nfc($request->variable('linkmenu_name_field_second', '', true)));
         $config->set('linkmenu_text_field_second', utf8_normalize_nfc($request->variable('linkmenu_text_field_second', '', true)));
         $config->set('linkmenu_enable_third', $request->variable('linkmenu_enable_third', 0));
         $config->set('linkmenu_name_field_third', utf8_normalize_nfc($request->variable('linkmenu_name_field_third', '', true)));
         $config->set('linkmenu_text_field_third', utf8_normalize_nfc($request->variable('linkmenu_text_field_third', '', true)));
         trigger_error($user->lang['ACP_LINKMENU_CONFIG_SAVED'] . adm_back_link($this->u_action));
     }
     $template->assign_vars(array('ACP_LINKMENU_VERSION' => isset($config['linkmenu_version']) ? $config['linkmenu_version'] : '', 'ACP_LINKMENU_ENABLE' => !empty($config['linkmenu_enable']) ? true : false, 'ACP_LINKMENU_ENABLE_FIRST' => !empty($config['linkmenu_enable_first']) ? true : false, 'LINKMENU_NAME_FIELD_FIRST' => isset($config['linkmenu_name_field_first']) ? $config['linkmenu_name_field_first'] : '', 'LINKMENU_TEXT_FIELD_FIRST' => isset($config['linkmenu_text_field_first']) ? $config['linkmenu_text_field_first'] : '', 'ACP_LINKMENU_ENABLE_SECOND' => !empty($config['linkmenu_enable_second']) ? true : false, 'LINKMENU_NAME_FIELD_SECOND' => isset($config['linkmenu_name_field_second']) ? $config['linkmenu_name_field_second'] : '', 'LINKMENU_TEXT_FIELD_SECOND' => isset($config['linkmenu_text_field_second']) ? $config['linkmenu_text_field_second'] : '', 'ACP_LINKMENU_ENABLE_THIRD' => !empty($config['linkmenu_enable_third']) ? true : false, 'LINKMENU_NAME_FIELD_THIRD' => isset($config['linkmenu_name_field_third']) ? $config['linkmenu_name_field_third'] : '', 'LINKMENU_TEXT_FIELD_THIRD' => isset($config['linkmenu_text_field_third']) ? $config['linkmenu_text_field_third'] : '', 'U_ACTION' => $this->u_action));
 }
开发者ID:alhitary,项目名称:Link-menu,代码行数:25,代码来源:linkmenu_module.php

示例2: display_options

    /**
     * Display the options a user can configure for this extension
     *
     * @return null
     * @access public
     */
    public function display_options()
    {
        add_form_key('acp_donation');
        // Is the form being submitted to us?
        if ($this->request->is_set_post('submit')) {
            if (!check_form_key('acp_donation')) {
                $error[] = 'FORM_INVALID';
            }
            $donation_row = array('donation_body' => $this->request->variable('donation_body', '', true), 'donation_cancel' => $this->request->variable('donation_cancel', '', true), 'donation_success' => $this->request->variable('donation_success', '', true));
            foreach ($donation_row as $this->config_name => $this->config_value) {
                $sql = 'UPDATE ' . $this->donation_table . "\n\t\t\t\t\tSET config_value = '" . $this->db->sql_escape($this->config_value) . "'\n\t\t\t\t\tWHERE config_name = '" . $this->db->sql_escape($this->config_name) . "'";
                $this->db->sql_query($sql);
            }
            // Set the options the user configured
            $this->set_options();
            // Add option settings change action to the admin log
            $this->phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'DONATION_SAVED');
            trigger_error($this->user->lang['DONATION_SAVED'] . adm_back_link($this->u_action));
        }
        // let's get it on
        $sql = 'SELECT *
		FROM ' . $this->donation_table;
        $result = $this->db->sql_query($sql);
        $donation = array();
        while ($row = $this->db->sql_fetchrow($result)) {
            $donation[$row['config_name']] = $row['config_value'];
        }
        $this->db->sql_freeresult($result);
        $donation_body = isset($donation['donation_body']) ? $donation['donation_body'] : '';
        $donation_cancel = isset($donation['donation_cancel']) ? $donation['donation_cancel'] : '';
        $donation_success = isset($donation['donation_success']) ? $donation['donation_success'] : '';
        $donation_version = isset($this->config['donation_version']) ? $this->config['donation_version'] : '';
        $this->template->assign_vars(array('DONATION_VERSION' => $donation_version, 'DONATION_ENABLE' => $this->config['donation_enable'], 'DONATION_INDEX_ENABLE' => $this->config['donation_index_enable'], 'DONATION_INDEX_TOP' => $this->config['donation_index_top'], 'DONATION_INDEX_BOTTOM' => $this->config['donation_index_bottom'], 'DONATION_EMAIL' => $this->config['donation_email'], 'DONATION_ACHIEVEMENT_ENABLE' => $this->config['donation_achievement_enable'], 'DONATION_ACHIEVEMENT' => $this->config['donation_achievement'], 'DONATION_GOAL_ENABLE' => $this->config['donation_goal_enable'], 'DONATION_GOAL' => $this->config['donation_goal'], 'DONATION_GOAL_CURRENCY_ENABLE' => $this->config['donation_goal_currency_enable'], 'DONATION_GOAL_CURRENCY' => $this->config['donation_goal_currency'], 'DONATION_BODY' => $donation_body, 'DONATION_CANCEL' => $donation_cancel, 'DONATION_SUCCESS' => $donation_success, 'U_ACTION' => $this->u_action));
    }
开发者ID:3D-I,项目名称:paypaldonation,代码行数:40,代码来源:admin_controller.php

示例3: display_options

 /**
  * Display the options a user can configure for this extension
  *
  * @return null
  * @access public
  */
 public function display_options()
 {
     // Create a form key for preventing CSRF attacks
     $form_key = 'sitelogo';
     add_form_key($form_key);
     // Is the form being submitted
     if ($this->request->is_set_post('submit')) {
         // Is the submitted form is valid
         if (!check_form_key($form_key)) {
             trigger_error($this->user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
         }
         // If no errors, process the form data
         // Set the options the user configured
         $this->set_options();
         // Add option settings change action to the admin log
         $phpbb_log = $this->container->get('log');
         $phpbb_log->add('admin', $this->user->data['user_id'], $this->user->ip, 'SITE_LOGO_LOG');
         // Option settings have been updated and logged
         // Confirm this to the user and provide link back to previous page
         trigger_error($this->user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action));
     }
     // Set output vars for display in the template
     // Positions
     $positions = array();
     $positions[] = $this->user->lang('LOGO_LEFT');
     $positions[] = $this->user->lang('LOGO_CENTRE');
     $positions[] = $this->user->lang('LOGO_RIGHT');
     foreach ($positions as $value => $label) {
         $this->template->assign_block_vars('positions', array('S_CHECKED' => $this->config['site_logo_position'] == $value ? true : false, 'LABEL' => $label, 'VALUE' => $value));
     }
     $this->template->assign_vars(array('SITE_LOGO_HEIGHT' => isset($this->config['site_logo_height']) ? $this->config['site_logo_height'] : '', 'SITE_LOGO_IMAGE' => isset($this->config['site_logo_image']) ? $this->config['site_logo_image'] : '', 'SITE_LOGO_LEFT' => isset($this->config['site_logo_left']) ? $this->config['site_logo_left'] : '', 'SITE_LOGO_PIXELS' => isset($this->config['site_logo_pixels']) ? $this->config['site_logo_pixels'] : '', 'SITE_LOGO_REMOVE' => isset($this->config['site_logo_remove']) ? $this->config['site_logo_remove'] : '', 'SITE_LOGO_RIGHT' => isset($this->config['site_logo_right']) ? $this->config['site_logo_right'] : '', 'SITE_LOGO_WIDTH' => isset($this->config['site_logo_width']) ? $this->config['site_logo_width'] : '', 'SITE_NAME_SUPRESS' => isset($this->config['site_name_supress']) ? $this->config['site_name_supress'] : '', 'SITE_SEARCH_REMOVE' => isset($this->config['site_search_remove']) ? $this->config['site_search_remove'] : '', 'U_ACTION' => $this->u_action));
 }
开发者ID:Galixte,项目名称:david63-sitelogo,代码行数:38,代码来源:admin_controller.php

示例4: main

 public function main($id, $mode)
 {
     global $config, $user, $template, $request;
     $user->add_lang_ext('rinsrans/textbox', 'common');
     $this->tpl_name = 'acp_textbox_body';
     $this->page_title = $user->lang('ACP_TEXTBOX_TITLE');
     add_form_key('acp_textbox');
     // Form is submitted
     if ($request->is_set_post('submit')) {
         if (!check_form_key('acp_textbox')) {
             trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
         }
         // Set the new settings to config
         $uid = $bitfield = $options = '';
         $textbox_content = $request->variable('textbox_content', '', true);
         generate_text_for_storage($textbox_content, $uid, $bitfield, $options, true, true, true);
         $config->set('textbox_content', $textbox_content);
         $config->set('textbox_bbcode_uid', $uid);
         $config->set('textbox_bbcode_bitfield', $bitfield);
         trigger_error($user->lang('ACP_TEXTBOX_SAVED') . adm_back_link($this->u_action));
     }
     $textbox_content = generate_text_for_edit($config['textbox_content'], $config['textbox_bbcode_uid'], 3);
     // Send the curent settings to template
     $template->assign_vars(array('U_ACTION' => $this->u_action, 'TEXTBOX_CONTENT' => $textbox_content['text']));
 }
开发者ID:rinsrans,项目名称:phpBB-textbox,代码行数:25,代码来源:textbox_module.php

示例5: main

 function main($id, $mode)
 {
     global $db, $user, $auth, $template, $cache, $request;
     global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
     $this->pool_root = $phpbb_root_path . 'store/d120de/banner/';
     $user->add_lang('acp/common');
     $this->tpl_name = 'banner_settings';
     $this->page_title = $user->lang('ACP_D120DE_BANNER_SETTINGS_DEFAULT');
     add_form_key('d120de/banner');
     $this->load_banner_list('default');
     $this->load_banner_list('event');
     if ($request->is_set_post('submit')) {
         if (!check_form_key('d120de/banner')) {
             trigger_error('FORM_INVALID');
         }
         $filename = $request->variable('d120de_banner_picture', '');
         $filepath = $this->pool_root . $filename;
         if (is_file($filepath)) {
             $image_dimension = getimagesize($filepath);
             $config->set('d120de_banner_width', $image_dimension[0]);
             $config->set('d120de_banner_height', $image_dimension[1]);
         } elseif ($filename != '') {
             trigger_error('The selected Image does not exist!', E_USER_WARNING);
         }
         $config->set('d120de_banner_link_default', $request->variable('d120de_banner_link_default', ''));
         $config->set('d120de_banner_picture', $request->variable('d120de_banner_picture', ''));
         $config->set('d120de_banner_alt_text_default', $request->variable('d120de_banner_alt_text_default', ''));
         $config->set('d120de_banner_hidesearchbox', $request->Is_set('d120de_banner_hidesearchbox'));
         $config->set('d120de_banner_hidesearchbox_default', $request->Is_set('d120de_banner_hidesearchbox_default'));
         trigger_error($user->lang('ACP_D120DE_BANNER_SETTING_SAVED') . adm_back_link($this->u_action));
     }
     $template->assign_vars(array('U_ACTION' => $this->u_action, 'D120DE_BANNER_LINK_DEFAULT' => $config['d120de_banner_link_default'], 'D120DE_BANNER_PICTURE' => $config['d120de_banner_picture'], 'D120DE_BANNER_ALT_TEXT_DEFAULT' => $config['d120de_banner_alt_text_default'], 'D120DE_BANNER_HIDESEARCHBOX' => $config['d120de_banner_hidesearchbox'], 'D120DE_BANNER_HIDESEARCHBOX_DEFAULT' => $config['d120de_banner_hidesearchbox_default']));
 }
开发者ID:d120,项目名称:phpbb-banner,代码行数:33,代码来源:main_module.php

示例6: main

 function main($id, $mode)
 {
     global $db, $config, $request, $template, $user;
     global $phpbb_root_path, $phpbb_admin_path, $phpEx;
     $this->page_title = $user->lang['SFS_CONTROL'];
     $this->tpl_name = 'stopforumspam_body';
     add_form_key('sfs');
     $allow_sfs = $this->allow_sfs();
     if ($request->is_set_post('submit')) {
         // Test if form key is valid
         if (!check_form_key('sfs')) {
             trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
         }
         if (!function_exists('validate_data')) {
             include $phpbb_root_path . 'includes/functions_user.' . $phpEx;
         }
         $check_row = array('sfs_threshold' => $request->variable('sfs_threshold', 0));
         $validate_row = array('sfs_threshold' => array('num', false, 1, 99));
         $error = validate_data($check_row, $validate_row);
         // Replace "error" strings with their real, localised form
         $error = array_map(array($user, 'lang'), $error);
         if (!sizeof($error)) {
             // Set the options the user configured
             $this->set_options();
             trigger_error($user->lang['SFS_SETTINGS_SUCCESS'] . adm_back_link($this->u_action));
         }
     }
     $template->assign_vars(array('ERROR' => isset($error) ? sizeof($error) ? implode('<br />', $error) : '' : '', 'ALLOW_SFS' => $config['allow_sfs'] ? true : false, 'CURL_ACTIVE' => !empty($allow_sfs) ? '' : '<br /><span class="error">' . $user->lang['LOG_SFS_NEED_CURL'] . '</span>', 'SFS_THRESHOLD' => (int) $config['sfs_threshold'], 'SFS_BAN_IP' => $config['sfs_ban_ip'] ? true : false, 'SFS_LOG_MESSAGE' => $config['sfs_log_message'] ? true : false, 'SFS_DOWN' => $config['sfs_down'] ? true : false, 'SFS_BY_NAME' => $config['sfs_by_name'] ? true : false, 'SFS_BY_EMAIL' => $config['sfs_by_email'] ? true : false, 'SFS_BY_IP' => $config['sfs_by_ip'] ? true : false, 'SFS_BAN_REASON' => $config['sfs_ban_reason'] ? true : false, 'SFS_VERSION' => $config['sfs_version'], 'U_ACTION' => $this->u_action));
 }
开发者ID:cracknel,项目名称:ubuntudanmark.dk,代码行数:29,代码来源:stopforumspam_module.php

示例7: main

 function main($id, $mode)
 {
     global $config, $request, $template, $user, $phpbb_log;
     $user->add_lang('acp/common');
     $this->tpl_name = 'acp_markpostunread';
     $this->page_title = $user->lang('MARKPOSTUNREAD_TITLE');
     add_form_key('acp_markpostunread');
     if ($request->is_set_post('submit')) {
         if (!check_form_key('acp_markpostunread')) {
             trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action));
         }
         foreach ($this->settings as $setting => $default) {
             if (!is_null($default)) {
                 $value = $request->variable($setting, $default, is_string($default));
                 if ($setting === 'enabled' && $value && !$config['load_db_lastread']) {
                     trigger_error($user->lang('MARKPOSTUNREAD_ENABLE_FAILED') . adm_back_link($this->u_action), E_USER_WARNING);
                 }
                 $config->set($this->setting_prefix . $setting, $value);
             }
         }
         $user_id = empty($user->data) ? ANONYMOUS : $user->data['user_id'];
         $user_ip = empty($user->ip) ? '' : $user->ip;
         $phpbb_log->add('admin', $user_id, $user_ip, 'MARKPOSTUNREAD_CONFIG_UPDATED');
         trigger_error($user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action));
     }
     $template_vars = array();
     foreach ($this->settings as $setting => $default) {
         $setting_full = $this->setting_prefix . $setting;
         $key = strtoupper(str_replace('.', '_', $setting_full));
         $template_vars[$key] = isset($config[$setting_full]) ? $config[$setting_full] : $default;
     }
     $template->assign_vars($template_vars);
 }
开发者ID:phpbb-es,项目名称:phpbb-ext-markpostunread,代码行数:33,代码来源:markpostunread_module.php

示例8: main

 public function main($id, $mode)
 {
     global $config, $user, $template, $request, $db, $table_prefix;
     $user->add_lang_ext('tas2580/dejure', 'common');
     $this->tpl_name = 'acp_dejure_body';
     $this->page_title = $user->lang('ACP_DEJURE_TITLE');
     add_form_key('acp_dejure');
     // Form is submitted
     if ($request->is_set_post('submit')) {
         if (!check_form_key('acp_dejure')) {
             trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
         }
         // Set the new settings to config
         $config->set('tas2580_dejure_link_style', $request->variable('link_style', 'weit'));
         $config->set('tas2580_dejure_class', $request->variable('class', ''));
         $config->set('tas2580_dejure_buzer', $request->variable('buzer', 0));
         $config->set('tas2580_dejure_cache_time', $request->variable('cache_time', 4));
         $config->set('tas2580_dejure_target', $request->variable('target', ''));
         $sql = 'DELETE FROM ' . $table_prefix . 'dejure';
         $db->sql_query($sql);
         trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action));
     }
     // Send the curent settings to template
     $template->assign_vars(array('U_ACTION' => $this->u_action, 'LINK_STYLE_WEIT' => $config['tas2580_dejure_link_style'] === 'weit' ? ' selected="selected"' : '', 'LINK_STYLE_SCHMAL' => $config['tas2580_dejure_link_style'] === 'schmal' ? ' selected="selected"' : '', 'CLASS' => $config['tas2580_dejure_class'], 'TARGET' => $config['tas2580_dejure_target'], 'BUZER' => $config['tas2580_dejure_buzer'] == 1 ? ' checked="checked"' : '', 'CACHE_TIME' => $config['tas2580_dejure_cache_time']));
 }
开发者ID:tas2580,项目名称:dejure,代码行数:25,代码来源:dejure_module.php

示例9: main

 public function main($id, $mode)
 {
     global $config, $request, $template, $user;
     $this->config = $config;
     $this->request = $request;
     $this->template = $template;
     $this->user = $user;
     // Add the common lang file
     $this->user->add_lang(array('acp/common'));
     // Add the board snowstormlights ACP lang file
     $this->user->add_lang_ext('prosk8er/snowstormlights', 'info_acp_snowstorm_lights');
     // Load a template from adm/style for our ACP page
     $this->tpl_name = 'snowstorm_lights';
     // Set the page title for our ACP page
     $this->page_title = $user->lang['ACP_SNOWSTORM_LIGHTS'];
     // Define the name of the form for use as a form key
     $form_key = 'acp_snowstorm_lights';
     add_form_key($form_key);
     // If form is submitted or previewed
     if ($this->request->is_set_post('submit')) {
         // Test if form key is valid
         if (!check_form_key($form_key)) {
             trigger_error('FORM_INVALID');
         }
         // Store the config enable/disable state
         $scl_enabled = $this->request->variable('scl_enabled', 0);
         $this->config->set('scl_enabled', $scl_enabled);
         $snow_enabled = $request->variable('snow_enabled', 0);
         $this->config->set('snow_enabled', $snow_enabled);
         // Output message to user for the update
         trigger_error($this->user->lang('SNOWSTORM_LIGHTS_SAVED') . adm_back_link($this->u_action));
     }
     // Output data to the template
     $this->template->assign_vars(array('SCL_ENABLED' => isset($this->config['scl_enabled']) ? $this->config['scl_enabled'] : '', 'SNOW_ENABLED' => isset($this->config['snow_enabled']) ? $this->config['snow_enabled'] : '', 'U_ACTION' => $this->u_action));
 }
开发者ID:Mauron,项目名称:Snowstorm-Lights,代码行数:35,代码来源:snowstorm_lights_module.php

示例10: main

 function main($id, $mode)
 {
     global $user, $config, $request, $template;
     add_form_key('wwh');
     $user->add_lang('ucp');
     $this->tpl_name = 'acp_wwh';
     $this->page_title = $user->lang['WWH_TITLE'];
     $submit = $request->is_set_post('submit');
     if ($submit) {
         if (!check_form_key('wwh')) {
             trigger_error('FORM_INVALID');
         }
         $config->set('wwh_disp_bots', $request->variable('wwh_disp_bots', 0));
         $config->set('wwh_disp_guests', $request->variable('wwh_disp_guests', 0));
         $config->set('wwh_disp_hidden', $request->variable('wwh_disp_hidden', 0));
         $config->set('wwh_disp_time', $request->variable('wwh_disp_time', 0));
         $config->set('wwh_disp_time_format', $request->variable('wwh_disp_time_format', 'H:i'));
         $config->set('wwh_disp_ip', $request->variable('wwh_disp_ip', 0));
         $config->set('wwh_version', $request->variable('wwh_version', 0));
         $config->set('wwh_del_time_h', $request->variable('wwh_del_time_h', 0));
         $config->set('wwh_del_time_m', $request->variable('wwh_del_time_m', 0));
         $config->set('wwh_del_time_s', $request->variable('wwh_del_time_s', 0));
         $config->set('wwh_sort_by', $request->variable('wwh_sort_by', 0));
         $config->set('wwh_record', $request->variable('wwh_record', 0));
         $config->set('wwh_record_timestamp', $request->variable('wwh_record_timestamp', 'D j. M Y'));
         if ($request->variable('wwh_reset', 0) > 0) {
             $config->set('wwh_record_ips', 1);
             $config->set('wwh_record_time', time());
             $config->set('wwh_reset_time', time());
         }
         trigger_error($user->lang['WWH_SAVED_SETTINGS'] . adm_back_link($this->u_action));
     }
     $template->assign_vars(array('WWH_MOD_VERSION' => sprintf($user->lang['WWH_INSTALLED'], $config['wwh_mod_version']), 'WWH_DISP_BOTS' => $config['wwh_disp_bots'], 'WWH_DISP_GUESTS' => $config['wwh_disp_guests'], 'WWH_DISP_HIDDEN' => $config['wwh_disp_hidden'], 'WWH_DISP_TIME' => $config['wwh_disp_time'], 'WWH_DISP_TIME_FORMAT' => $config['wwh_disp_time_format'], 'WWH_DISP_IP' => $config['wwh_disp_ip'], 'WWH_VERSION' => $config['wwh_version'], 'WWH_DEL_TIME_H' => $config['wwh_del_time_h'], 'WWH_DEL_TIME_M' => $config['wwh_del_time_m'], 'WWH_DEL_TIME_S' => $config['wwh_del_time_s'], 'WWH_SORT_BY' => $config['wwh_sort_by'], 'WWH_RECORD' => $config['wwh_record'], 'WWH_RECORD_TIMESTAMP' => $config['wwh_record_timestamp'], 'U_ACTION' => $this->u_action));
 }
开发者ID:alhitary,项目名称:who-was-here,代码行数:34,代码来源:acp_wwh_module.php

示例11: manage_list

 /**
  * @param string $list_name whitelist or blacklist
  * @param string $u_action phpbb acp-u_action
  */
 private function manage_list($u_action, $list_name)
 {
     $list_name_upper = strtoupper($list_name);
     // Define the name of the form for use as a form key
     $form_name = 'topictags';
     add_form_key($form_name);
     $errors = array();
     if ($this->request->is_set_post('submit')) {
         if (!check_form_key($form_name)) {
             trigger_error('FORM_INVALID');
         }
         $this->config->set(prefixes::CONFIG . '_' . $list_name . '_enabled', $this->request->variable(prefixes::CONFIG . '_' . $list_name . '_enabled', 0));
         $list = rawurldecode(base64_decode($this->request->variable(prefixes::CONFIG . '_' . $list_name, '')));
         if (!empty($list)) {
             $list = json_decode($list, true);
             $tags = array();
             for ($i = 0, $size = sizeof($list); $i < $size; $i++) {
                 $tags[] = $list[$i]['text'];
             }
             $list = json_encode($tags);
         }
         // store the list
         $this->config_text->set(prefixes::CONFIG . '_' . $list_name, $list);
         trigger_error($this->user->lang('TOPICTAGS_' . $list_name_upper . '_SAVED') . adm_back_link($u_action));
     }
     // display
     $list = $this->config_text->get(prefixes::CONFIG . '_' . $list_name);
     $list = base64_encode(rawurlencode($list));
     $this->template->assign_vars(array('TOPICTAGS_VERSION' => $this->user->lang('TOPICTAGS_INSTALLED', $this->config[prefixes::CONFIG . '_version']), 'TOPICTAGS_' . $list_name_upper . '_ENABLED' => $this->config[prefixes::CONFIG . '_' . $list_name . '_enabled'], 'TOPICTAGS_' . $list_name_upper => $list, 'S_RH_TOPICTAGS_INCLUDE_NG_TAGS_INPUT' => true, 'S_RH_TOPICTAGS_INCLUDE_CSS' => true, 'TOPICTAGS_CONVERT_SPACE_TO_MINUS' => $this->config[prefixes::CONFIG . '_convert_space_to_minus'] ? 'true' : 'false', 'S_ERROR' => sizeof($errors) ? true : false, 'ERROR_MSG' => implode('<br />', $errors), 'U_ACTION' => $u_action));
 }
开发者ID:nerestaren,项目名称:phpbb-ext-topictags,代码行数:34,代码来源:white_and_blacklist_controller.php

示例12: main

 public function main($id, $mode)
 {
     global $config, $user, $template, $request, $phpbb_container, $phpbb_root_path, $phpEx;
     $user->add_lang_ext('tas2580/mobilenotifier', 'common');
     $wa = $phpbb_container->get('tas2580.mobilenotifier.src.helper');
     $this->tpl_name = 'acp_mobilenotifier_body';
     $this->page_title = $user->lang('ACP_MOBILENOTIFIER_TITLE');
     add_form_key('acp_mobilenotifier');
     // Form is submitted
     if ($request->is_set_post('submit')) {
         if (!check_form_key('acp_mobilenotifier')) {
             trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
         }
         $config->set('whatsapp_sender', $request->variable('sender', ''));
         $config->set('whatsapp_password', $request->variable('password', ''));
         $config->set('whatsapp_status', $request->variable('status', ''));
         $config->set('whatsapp_default_cc', $request->variable('default_cc', ''));
         $wa->update_status($config['whatsapp_status']);
         if ($request->file('image')) {
             include_once $phpbb_root_path . 'includes/functions_upload.' . $phpEx;
             $upload = new \fileupload();
             $upload->set_allowed_extensions(array('jpg', 'png', 'gif'));
             $file = $upload->form_upload('image');
             if ($file->filename) {
                 $wa->update_picture($file->filename);
             }
         }
         trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action));
     }
     $template->assign_vars(array('WA_VERSION' => WA_VER, 'U_ACTION' => $this->u_action, 'SENDER' => isset($config['whatsapp_sender']) ? $config['whatsapp_sender'] : '', 'PASSWORD' => isset($config['whatsapp_password']) ? $config['whatsapp_password'] : '', 'STATUS' => isset($config['whatsapp_status']) ? $config['whatsapp_status'] : '', 'CC_SELECT' => $wa->cc_select(isset($config['whatsapp_default_cc']) ? $config['whatsapp_default_cc'] : '')));
 }
开发者ID:NicolasCapon,项目名称:mobilenotifier,代码行数:31,代码来源:mobilenotifier_module.php

示例13: main

 function main($id, $mode)
 {
     global $db, $user, $auth, $template, $cache;
     global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
     $user->add_lang('acp/common');
     $this->tpl_name = 'acp_shareon';
     $this->page_title = $user->lang['SHARE_ON_MOD'];
     add_form_key('acp_shareon');
     // Version Check
     $config['SHAREON_VERSION'] = isset($config['SHAREON_VERSION']) ? $config['SHAREON_VERSION'] : '2.2.0';
     $submit = isset($_POST['submit']) ? true : false;
     if ($submit) {
         if (!check_form_key('acp_shareon')) {
             trigger_error('FORM_INVALID');
         }
         set_config('so_status', request_var('so_status', true));
         set_config('so_position', request_var('so_position', true));
         set_config('so_type', request_var('so_type', true));
         set_config('so_facebook', request_var('so_facebook', true));
         set_config('so_twitter', request_var('so_twitter', true));
         set_config('so_tuenti', request_var('so_tuenti', true));
         set_config('so_sonico', request_var('so_sonico', true));
         set_config('so_friendfeed', request_var('so_friendfeed', true));
         set_config('so_orkut', request_var('so_orkut', true));
         set_config('so_digg', request_var('so_digg', true));
         set_config('so_reddit', request_var('so_reddit', true));
         set_config('so_delicious', request_var('so_delicious', true));
         set_config('so_vk', request_var('so_vk', true));
         set_config('so_tumblr', request_var('so_tumblr', true));
         set_config('so_google', request_var('so_google', true));
         set_config('so_myspace', request_var('so_myspace', true));
         trigger_error($user->lang['SO_SAVED'] . adm_back_link($this->u_action));
     }
     $template->assign_vars(array('SO_STATUS' => !empty($config['so_status']) ? true : false, 'SO_POSITION' => !empty($config['so_position']) ? true : false, 'SO_TYPE' => !empty($config['so_type']) ? true : false, 'SO_FACEBOOK' => !empty($config['so_facebook']) ? true : false, 'SO_TWITTER' => !empty($config['so_twitter']) ? true : false, 'SO_TUENTI' => !empty($config['so_tuenti']) ? true : false, 'SO_SONICO' => !empty($config['so_sonico']) ? true : false, 'SO_FRIENDFEED' => !empty($config['so_friendfeed']) ? true : false, 'SO_ORKUT' => !empty($config['so_orkut']) ? true : false, 'SO_DIGG' => !empty($config['so_digg']) ? true : false, 'SO_REDDIT' => !empty($config['so_reddit']) ? true : false, 'SO_DELICIOUS' => !empty($config['so_delicious']) ? true : false, 'SO_VK' => !empty($config['so_vk']) ? true : false, 'SO_TUMBLR' => !empty($config['so_tumblr']) ? true : false, 'SO_GOOGLE' => !empty($config['so_google']) ? true : false, 'SO_MYSPACE' => !empty($config['so_myspace']) ? true : false, 'U_ACTION' => $this->u_action, 'SHAREON_VERSION' => $config['SHAREON_VERSION'], 'S_VERSION_UP_TO_DATE' => $this->shareon_version_compare($config['SHAREON_VERSION'])));
 }
开发者ID:Galixte,项目名称:share-on,代码行数:35,代码来源:acp_shareon.php

示例14: main

 public function main($id, $mode)
 {
     global $config, $user, $template, $request;
     $user->add_lang_ext('tas2580/paypal', 'common');
     switch ($mode) {
         case 'settings':
             $this->tpl_name = 'acp_paypal_body';
             $this->page_title = $user->lang('ACP_PAYPAL_TITLE');
             add_form_key('acp_paypal');
             // Form is submitted
             if ($request->is_set_post('submit')) {
                 if (!check_form_key('acp_paypal')) {
                     trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
                 }
                 $config->set('paypal_email', $request->variable('paypal_email', ''));
                 $config->set('paypal_default_item', $request->variable('paypal_default_item', ''));
                 $config->set('paypal_description', $request->variable('paypal_description', ''));
                 trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action));
             }
             $template->assign_vars(array('U_ACTION' => $this->u_action, 'PAYPAL_EMAIL' => isset($config['paypal_email']) ? $config['paypal_email'] : '', 'PAYPAL_DEFAULT_ITEM' => isset($config['paypal_default_item']) ? $config['paypal_default_item'] : '', 'PAYPAL_DESCRIPTION' => isset($config['paypal_description']) ? $config['paypal_description'] : ''));
             break;
         case 'items':
             $this->tpl_name = 'acp_paypal_items_body';
             $this->page_title = $user->lang('ACP_PAYPAL_ITEMS');
             break;
     }
 }
开发者ID:Talk19Zehn,项目名称:paypal,代码行数:27,代码来源:paypal_module.php

示例15: main

 function main($id, $mode)
 {
     global $db, $user, $auth, $template;
     global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
     $user->add_lang('acp/board');
     $captcha_vars = array('captcha_gd_x_grid' => 'CAPTCHA_GD_X_GRID', 'captcha_gd_y_grid' => 'CAPTCHA_GD_Y_GRID', 'captcha_gd_foreground_noise' => 'CAPTCHA_GD_FOREGROUND_NOISE', 'captcha_gd' => 'CAPTCHA_GD_PREVIEWED', 'captcha_gd_wave' => 'CAPTCHA_GD_WAVE', 'captcha_gd_3d_noise' => 'CAPTCHA_GD_3D_NOISE', 'captcha_gd_fonts' => 'CAPTCHA_GD_FONTS');
     if (isset($_GET['demo'])) {
         $captcha_vars = array_keys($captcha_vars);
         foreach ($captcha_vars as $captcha_var) {
             $config[$captcha_var] = isset($_REQUEST[$captcha_var]) ? request_var($captcha_var, 0) : $config[$captcha_var];
         }
         if ($config['captcha_gd']) {
             include $phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx;
         } else {
             include $phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx;
         }
         $captcha = new captcha();
         $captcha->execute(gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)), time());
         exit;
     }
     $config_vars = array('enable_confirm' => 'REG_ENABLE', 'enable_post_confirm' => 'POST_ENABLE', 'confirm_refresh' => 'CONFIRM_REFRESH', 'captcha_gd' => 'CAPTCHA_GD');
     $this->tpl_name = 'acp_captcha';
     $this->page_title = 'ACP_VC_SETTINGS';
     $form_key = 'acp_captcha';
     add_form_key($form_key);
     $submit = request_var('submit', '');
     if ($submit && check_form_key($form_key)) {
         $config_vars = array_keys($config_vars);
         foreach ($config_vars as $config_var) {
             set_config($config_var, request_var($config_var, ''));
         }
         $captcha_vars = array_keys($captcha_vars);
         foreach ($captcha_vars as $captcha_var) {
             $value = request_var($captcha_var, 0);
             if ($value >= 0) {
                 set_config($captcha_var, $value);
             }
         }
         add_log('admin', 'LOG_CONFIG_VISUAL');
         trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
     } else {
         if ($submit) {
             trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action));
         } else {
             $preview_image_src = append_sid(append_sid("{$phpbb_admin_path}index.{$phpEx}", "i={$id}&amp;demo=demo"));
             if (@extension_loaded('gd')) {
                 $template->assign_var('GD', true);
             }
             foreach ($config_vars as $config_var => $template_var) {
                 $template->assign_var($template_var, isset($_REQUEST[$config_var]) ? request_var($config_var, '') : $config[$config_var]);
             }
             foreach ($captcha_vars as $captcha_var => $template_var) {
                 $var = isset($_REQUEST[$captcha_var]) ? request_var($captcha_var, 0) : $config[$captcha_var];
                 $template->assign_var($template_var, $var);
                 $preview_image_src .= "&amp;{$captcha_var}=" . $var;
             }
             $template->assign_vars(array('CAPTCHA_PREVIEW' => $preview_image_src, 'PREVIEW' => isset($_POST['preview'])));
         }
     }
 }
开发者ID:html,项目名称:PI,代码行数:60,代码来源:acp_captcha.php


注:本文中的adm_back_link函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。