Exemple #1
0
 public function core_page_footer($event)
 {
     global $phpbb_admin_path;
     // core.admin_path doesn't seem to exist.
     $query_string = $this->user->page['query_string'];
     $params = $template_vars = array();
     parse_str($query_string, $params);
     foreach ($params as $name => $value) {
         $template_vars['CUSTOMCODE_PARAM_' . strtoupper($name)] = $value;
     }
     if (sizeof($template_vars)) {
         $this->template->assign_vars($template_vars);
     }
     $show_events = $this->request->variable('customcode_show_events', 0) ? true : false;
     if ($show_events && $this->auth->acl_get('a_')) {
         $query_string = str_replace('&customcode_show_events=1', '&customcode_show_events=0', $query_string);
         $query_string = str_replace('customcode_show_events=1', 'customcode_show_events=0', $query_string);
         $this->template->assign_var('U_CUSTOMCODE_HIDE_EVENTS', append_sid($this->user->page['page_name'], $query_string));
         $customcode_directory = new customcode_directory($this->user, $this->phpbb_root_path);
         $filenames = $customcode_directory->get_filenames();
         $template_edit_urls = array();
         $params = array('i' => '-marttiphpbb-customcode-acp-main_module', 'mode' => 'edit');
         foreach ($filenames as $filename) {
             $params['filename'] = $filename;
             $this->template->assign_var('U_CUSTOMCODE_' . strtoupper($customcode_directory->get_basename($filename)), append_sid($phpbb_admin_path . 'index.' . $this->php_ext, $params, true, $this->user->session_id));
         }
         $this->user->add_lang_ext('marttiphpbb/customcode', 'common');
     }
 }