private function generateMenuStructure()
 {
     $export_array[] = "----";
     // Search for plugins and make sure they are registered
     $raidexport_folder = $this->root_path . 'core/calendarexport/';
     if ($dir = opendir($raidexport_folder)) {
         while ($d_plugin_code = @readdir($dir)) {
             $cwd = $raidexport_folder . $d_plugin_code;
             // regenerate the link to the 'plugin'
             if (@is_file($cwd) && valid_folder($d_plugin_code)) {
                 // check if valid
                 include $cwd;
                 $export_array[$rpexport_plugin[$d_plugin_code]['function']] = $rpexport_plugin[$d_plugin_code]['name'];
                 // add to array
             }
         }
     }
     // search for game export plugins
     $raidexport_game = $this->root_path . 'games/' . $this->game->get_game() . '/raidexport/';
     if (is_dir($raidexport_game) && ($dir = opendir($raidexport_game))) {
         while ($d_plugin_code = @readdir($dir)) {
             $cwd = $raidexport_game . $d_plugin_code;
             // regenerate the link to the 'plugin'
             if (@is_file($cwd) && valid_folder($d_plugin_code)) {
                 // check if valid
                 include $cwd;
                 $export_array[$rpexport_plugin[$d_plugin_code]['function']] = $rpexport_plugin[$d_plugin_code]['name'];
                 // add to array
             }
         }
     }
     return $export_array;
 }
 public function run()
 {
     if ($dir = @opendir($this->pfh->FolderPath('imageupload', 'eqdkp'))) {
         while ($file = @readdir($dir)) {
             if (is_file($this->pfh->FolderPath('imageupload', 'eqdkp') . $file) && valid_folder($file) && substr($file, 10, 2) == '__') {
                 $this->pfh->Delete('imageupload/' . $file, 'eqdkp');
             }
         }
     }
 }
Esempio n. 3
0
 private function scanGlobalHookFolder()
 {
     if ($dir = @opendir($this->root_path . 'core/hooks/')) {
         while ($file = @readdir($dir)) {
             if (is_file($this->root_path . 'core/hooks/' . $file) && valid_folder($file)) {
                 $path_parts = pathinfo($file);
                 $filename = str_replace("_hook", "", $path_parts['filename']);
                 $filename = str_replace(".class", "", $filename);
                 $strHook = substr($filename, strrpos($filename, '_') + 1);
                 $strClassname = str_replace(".class", "", $path_parts['filename']);
                 $strMethodname = $strHook;
                 $strClasspath = 'core/hooks';
                 $this->register($strHook, $strClassname, $strMethodname, $strClasspath);
             }
         }
     }
 }
Esempio n. 4
0
function myScandir(&$parentDir, $actual_dir)
{
    global $pfh;
    $scanDir = scandir($actual_dir);
    for ($i = 0; $i < count($scanDir); $i++) {
        if (!valid_folder($scanDir[$i]) || $scanDir[$i] == "thumbs") {
            continue;
        }
        if (is_file($actual_dir . '/' . $scanDir[$i])) {
        } elseif (is_dir($actual_dir . '/' . $scanDir[$i])) {
            $dir = $scanDir[$i];
            $parentDir[$dir] = str_replace($pfh->FolderPath('system', 'files'), "system", "{$actual_dir}*+*+*{$dir}");
            myScandir($parentDir, "{$actual_dir}/{$dir}");
        }
    }
    return true;
}
Esempio n. 5
0
 private function generateMenuStructure()
 {
     $export_array[] = "----";
     // Search for plugins and make sure they are registered
     if ($dir = opendir($this->root_path . 'calendar/raidexport/plugins/')) {
         while ($d_plugin_code = @readdir($dir)) {
             $cwd = $this->root_path . 'calendar/raidexport/plugins/' . $d_plugin_code;
             // regenerate the link to the 'plugin'
             if (@is_file($cwd) && valid_folder($d_plugin_code)) {
                 // check if valid
                 include $cwd;
                 $export_array[$rpexport_plugin[$d_plugin_code]['function']] = $rpexport_plugin[$d_plugin_code]['name'];
                 // add to array
             }
         }
     }
     return $export_array;
 }
Esempio n. 6
0
 private function deleteWatermarkImages()
 {
     $strThumbfolder = $this->pfh->FolderPath('thumbs', 'mediacenter');
     $arrFiles = scandir($strThumbfolder);
     foreach ($arrFiles as $strFile) {
         if (valid_folder($strFile)) {
             if (strpos($strFile, 'wm_') === 0) {
                 $this->pfh->Delete($strThumbfolder . $strFile);
             }
         }
     }
 }
Esempio n. 7
0
 private function file_tree($folder, $first_call = true)
 {
     if (!is_array($this->value)) {
         $this->value = array($this->value);
     }
     // Get and sort directories/files
     $file = scandir($folder);
     natcasesort($file);
     // Make directories first
     $files = $dirs = array();
     foreach ($file as $this_file) {
         if (is_dir("{$folder}/{$this_file}")) {
             $dirs[] = $this_file;
         } elseif (!$this->dirsOnly && valid_folder($this_file)) {
             $files[] = $this_file;
         }
     }
     $file = array_merge($dirs, $files);
     // Filter unwanted extensions
     if (!empty($this->extensions)) {
         foreach (array_keys($file) as $key) {
             if (!is_dir("{$folder}/{$file[$key]}")) {
                 $ext = substr($file[$key], strrpos($file[$key], ".") + 1);
                 if (!in_array($ext, $this->extensions)) {
                     unset($file[$key]);
                 }
             }
         }
     }
     $dd_data = array();
     if (count($file) > 2) {
         // Use 2 instead of 0 to account for . and .. "directories"
         $php_file_tree = "<ul";
         //if( $first_call ) { $php_file_tree .= " class=\"file-tree-".$this->name."\""; $first_call = false; }
         $php_file_tree .= ">";
         foreach ($file as $this_file) {
             if ($this_file != "." && $this_file != "..") {
                 if (is_dir("{$folder}/{$this_file}")) {
                     // Directory
                     $php_file_tree .= "<li class=\"pft-directory\"><i class=\"fa fa-lg fa-folder-o\"></i> " . ($this->inputBoxFormat == "checkbox" ? "<input type=\"checkbox\" name=\"" . $this->name . "[]\" value=\"" . str_replace("//", "/", $folder . "/" . $this_file) . "\"> " : '') . "<a href=\"javascript:void(0);\">" . sanitize($this_file) . "</a>";
                     $php_file_tree .= $this->file_tree("{$folder}/{$this_file}", false);
                     $php_file_tree .= "</li>";
                     $dd_data["{$folder}/{$this_file}"] = $this_file;
                     $bla = $this->file_tree(str_replace("//", "/", $folder . "/" . $this_file), false);
                     if (is_array($bla)) {
                         foreach ($bla as $key => $value) {
                             $dd_data[$key] = '&nbsp;&nbsp;&nbsp;' . $value;
                         }
                     }
                     $i++;
                 } else {
                     // File
                     // Get extension (prepend 'ext-' to prevent invalid classes from extensions that begin with numbers)
                     $ext = "ext-" . substr($this_file, strrpos($this_file, ".") + 1);
                     $link = str_replace("[link]", "{$folder}/" . urlencode($this_file), $return_link);
                     $php_file_tree .= "<li class=\"pft-file " . strtolower($ext) . "\">" . ($this->inputBoxFormat == "checkbox" ? '<input type="checkbox" name="' . $this->name . '[]" value="' . str_replace("//", "/", $folder . "/" . $this_file) . '"> ' : '') . (true ? "<input type=\"radio\" name=\"" . $this->name . "\" value=\"" . str_replace("//", "/", $folder . "/" . $this_file) . "\"" . (in_array(str_replace("//", "/", $folder . "/" . $this_file), $this->value) ? ' checked="checked"' : '') . "> " : '') . "<a>" . sanitize($this_file) . "</a></li>";
                 }
             }
         }
         $php_file_tree .= "</ul>";
     }
     return $php_file_tree;
 }
Esempio n. 8
0
 public function get_all_modules()
 {
     $this->pdh->process_hook_queue();
     $modules = $this->pdh->aget('portal', 'path', 0, array($this->pdh->get('portal', 'id_list')));
     foreach ($modules as $id => $path) {
         if (!$this->get_module($path, $this->pdh->get('portal', 'plugin', array($id)))) {
             continue;
         }
         $this->check_update($id, $path);
     }
     //EQDKP PORTAL MODULES
     // Search for portal-modules and make sure they are registered
     if ($dir = @opendir($this->root_path . 'portal/')) {
         while ($d_plugin_code = @readdir($dir)) {
             $cwd = $this->root_path . 'portal/' . $d_plugin_code;
             if (valid_folder($cwd)) {
                 if (in_array($d_plugin_code, $modules)) {
                     continue;
                 } else {
                     $this->install($d_plugin_code);
                 }
             }
             unset($d_plugin_code, $cwd);
         }
         // readdir
     }
     // EQDKP PLUGIN PORTAL MODULES
     foreach ($this->pm->get_plugins() as $plugin_code) {
         $plug_modules = $this->pm->get_plugin($plugin_code)->get_portal_modules();
         foreach ($plug_modules as $module_name) {
             if (!in_array($module_name, $modules)) {
                 $this->install($module_name, $plugin_code);
             }
         }
     }
     $this->pdh->process_hook_queue();
     return $this->objs;
 }
 public function display_form()
 {
     if ((int) $this->config->get('cmsbridge_active') == 1 && strlen($this->config->get('cmsbridge_reg_url'))) {
         redirect($this->config->get('cmsbridge_reg_url'), false, true);
     }
     //Captcha
     if ($this->config->get('enable_captcha') == 1) {
         require $this->root_path . 'libraries/recaptcha/recaptcha.class.php';
         $captcha = new recaptcha();
         $this->tpl->assign_vars(array('CAPTCHA' => $captcha->get_html($this->config->get('lib_recaptcha_okey')), 'S_DISPLAY_CATPCHA' => true));
     }
     $language_array = array();
     if ($dir = @opendir($this->root_path . 'language/')) {
         while ($file = @readdir($dir)) {
             if (!is_file($this->root_path . 'language/' . $file) && !is_link($this->root_path . 'language/' . $file) && valid_folder($file)) {
                 $language_array[$file] = ucfirst($file);
             }
         }
     }
     //User Profilefields
     $arrUserProfileFields = $this->pdh->get('user_profilefields', 'registration_fields');
     if (count($arrUserProfileFields)) {
         $form = register('form', array('register'));
         $form->validate = true;
         $form->add_fields($arrUserProfileFields);
         $form->output($this->userProfileData);
     }
     $this->tpl->assign_vars(array('S_CURRENT_PASSWORD' => false, 'S_NEW_PASSWORD' => false, 'S_SETTING_ADMIN' => false, 'S_MU_TABLE' => false, 'S_PROFILEFIELDS' => count($arrUserProfileFields) ? true : false, 'VALID_EMAIL_INFO' => $this->config->get('account_activation') == 1 ? '<br />' . $this->user->lang('valid_email_note') : '', 'AUTH_REGISTER_BUTTON' => ($arrRegisterButtons = $this->user->handle_login_functions('register_button')) ? implode(' ', $arrRegisterButtons) : '', 'REGISTER' => true, 'DD_LANGUAGE' => new hdropdown('user_lang', array('options' => $language_array, 'value' => $this->data['user_lang'])), 'DD_TIMEZONES' => new hdropdown('user_timezone', array('options' => $this->time->timezones, 'value' => $this->data['user_timezone'])), 'HIDDEN_FIELDS' => isset($this->data['auth_account']) ? new hhidden('lmethod', array('value' => $this->in->get('lmethod'))) . new hhidden('auth_account', array('value' => $this->crypt->encrypt($this->data['auth_account']))) : '', 'USERNAME' => $this->data['username'], 'USER_EMAIL' => $this->data['user_email'], 'USER_EMAIL2' => $this->data['user_email2']));
     $this->core->set_vars(array('page_title' => $this->user->lang('register_title'), 'template_file' => 'register.html', 'display' => true));
 }
 public function get_available_bridges()
 {
     $bridges = array();
     // Build auth array
     if ($dir = @opendir($this->root_path . 'core/bridges/')) {
         while ($file = @readdir($dir)) {
             if (is_file($this->root_path . 'core/bridges/' . $file) && valid_folder($file)) {
                 include_once $this->root_path . 'core/bridges/' . $file;
                 $name = substr($file, 0, strpos($file, '.'));
                 $classname = $name . '_bridge';
                 $class = registry::register($classname);
                 $bridges[$name] = isset($class->name) ? $class->name : $name;
                 unset($class);
             }
         }
     }
     return $bridges;
 }
Esempio n. 11
0
 public function display_form()
 {
     if ((int) $this->config->get('cmsbridge_reg_redirect') == 1 && (int) $this->config->get('cmsbridge_active') == 1) {
         if (strlen($this->config->get('cmsbridge_reg_url')) > 1) {
             redirect($this->config->get('cmsbridge_reg_url'), false, true);
         } else {
             redirect('index.php');
         }
     }
     //Captcha
     if ($this->config->get('pk_enable_captcha') == 1) {
         require $this->root_path . 'libraries/recaptcha/recaptcha.class.php';
         $captcha = new recaptcha();
         $this->tpl->assign_vars(array('CAPTCHA' => $captcha->recaptcha_get_html($this->config->get('lib_recaptcha_okey')), 'S_DISPLAY_CATPCHA' => true));
     }
     $language_array = array();
     if ($dir = @opendir($this->root_path . 'language/')) {
         while ($file = @readdir($dir)) {
             if (!is_file($this->root_path . 'language/' . $file) && !is_link($this->root_path . 'language/' . $file) && valid_folder($file)) {
                 $language_array[$file] = ucfirst($file);
             }
         }
     }
     $this->tpl->assign_vars(array('S_CURRENT_PASSWORD' => false, 'S_NEW_PASSWORD' => false, 'S_SETTING_ADMIN' => false, 'S_MU_TABLE' => false, 'VALID_EMAIL_INFO' => $this->config->get('account_activation') == 1 ? '<br />' . $this->user->lang('valid_email_note') : '', 'AUTH_REGISTER_BUTTON' => ($arrRegisterButtons = $this->user->handle_login_functions('register_button')) ? implode(' ', $arrRegisterButtons) : '', 'REGISTER' => true, 'DD_LANGUAGE' => $this->html->DropDown('user_lang', $language_array, $this->data['user_lang']), 'DD_TIMEZONES' => $this->html->DropDown('user_timezone', $this->time->timezones, $this->data['user_timezone']), 'HIDDEN_FIELDS' => isset($this->data['auth_account']) ? $this->html->TextField('lmethod', '', $this->in->get('lmethod'), 'hidden') . $this->html->TextField('auth_account', '', $this->crypt->encrypt($this->data['auth_account']), 'hidden') : '', 'USERNAME' => $this->data['username'], 'USER_EMAIL' => $this->data['user_email'], 'USER_EMAIL2' => $this->data['user_email2']));
     $this->core->set_vars(array('page_title' => $this->user->lang('register_title'), 'template_file' => 'register.html', 'display' => true));
 }
 public function scan_backgrounds()
 {
     $arrOut = array();
     $strFolder = $this->root_path . 'plugins/siggenerator/includes/backgrounds/';
     $arrFiles = scandir($strFolder);
     $arrExtensions = array('jpg', 'gif', 'png');
     foreach ($arrFiles as $filename) {
         if (valid_folder($filename)) {
             $strExtension = pathinfo($filename, PATHINFO_EXTENSION);
             if (in_array($strExtension, $arrExtensions)) {
                 $arrOut[str_replace($this->root_path, '', $strFolder . $filename)] = $filename;
             }
         }
     }
     $strFolder = $this->pfh->FolderPath('backgrounds', 'signatures');
     $arrFiles = scandir($strFolder);
     $arrExtensions = array('jpg', 'gif', 'png');
     foreach ($arrFiles as $filename) {
         if (valid_folder($filename)) {
             $strExtension = pathinfo($filename, PATHINFO_EXTENSION);
             if (in_array($strExtension, $arrExtensions)) {
                 $arrOut[str_replace($this->root_path, '', $strFolder . $filename)] = $filename;
             }
         }
     }
     return $arrOut;
 }
 public function save()
 {
     $strFileFolder = $this->pfh->FolderPath('files', 'mediacenter');
     $finfo = new finfo(FILEINFO_MIME_TYPE);
     $arrFiles = scandir($strFileFolder);
     $arrLocalFilenames = $this->pdh->aget('mediacenter_media', 'localfile', 0, array($this->pdh->get('mediacenter_media', 'id_list', array())));
     $intAlbumID = $this->in->get('album');
     if (substr($intAlbumID, 0, 1) == 'c') {
         $intCategoryID = (int) substr($intAlbumID, 1);
         $intAlbumID = 0;
     } else {
         $intCategoryID = $this->pdh->get('mediacenter_albums', 'category_id', array($intAlbumID));
         $intAlbumID = intval($intAlbumID);
     }
     $arrTypes = $this->pdh->get('mediacenter_categories', 'types', array($intCategoryID));
     if (!$intCategoryID || !$arrTypes || count($arrTypes) == 0) {
         return false;
     }
     foreach ($arrFiles as $strFile) {
         if (valid_folder($strFile)) {
             if (in_array($strFile, $arrLocalFilenames)) {
                 continue;
             }
             $strMime = $finfo->file($strFileFolder . $strFile);
             $strName = $strFile;
             if (strpos($strMime, 'image/') === 0) {
                 $intType = 2;
             } elseif (strpos($strMime, 'video/') === 0) {
                 $intType = 1;
             } else {
                 $intType = 0;
             }
             //If Type is not allowed, make type file
             if (!in_array($intType, $arrTypes)) {
                 $intType = 0;
                 //File
             }
             //Try to find an image extension
             $strExtension = strtolower(pathinfo($strFile, PATHINFO_EXTENSION));
             if (!$strExtension || $strExtension == "") {
                 $strExtension = $this->mimetype_to_extension($strMime);
             }
             //If type file now allowed: wrong type
             if (!in_array($intType, $arrTypes)) {
                 $arrError[$strFile] = "filetype_not_allowed";
                 $this->tpl->assign_block_vars('mc_media_row', array('ICON' => $this->core->icon_font('fa-times'), 'NAME' => $strFile, 'STATUS' => "filetype_not_allowed", 'EXTENSION' => $strExtension));
                 continue;
             }
             $arrAdditionalData = array();
             $strLocalfile = $strFile;
             $strFileFolder = $this->pfh->FolderPath('files', 'mediacenter');
             if (file_exists($strFileFolder . $strLocalfile)) {
                 $arrAdditionalData['size'] = filesize($strFileFolder . $strLocalfile);
             }
             $strLocalPreviewImage = "";
             $strThumbfolder = $this->pfh->FolderPath('thumbs', 'mediacenter');
             if ($intType == 2 || $oldType == 2) {
                 //Preview Image
                 $filename = md5(rand() . unique_id());
                 $this->pfh->copy($strFileFolder . $strLocalfile, $strThumbfolder . $filename . '.' . $strExtension);
                 $this->pfh->thumbnail($strThumbfolder . $filename . '.' . $strExtension, $strThumbfolder, $filename . '.64.' . $strExtension, 64);
                 $this->pfh->thumbnail($strThumbfolder . $filename . '.' . $strExtension, $strThumbfolder, $filename . '.240.' . $strExtension, 240);
                 $strLocalPreviewImage = $filename . '.' . $strExtension;
             }
             if ($intType == 2) {
                 //Exif Data
                 if ($strExtension == 'jpg') {
                     $arrExif = $this->exif_data($strFileFolder . $strLocalfile);
                     if ($arrExif) {
                         $arrAdditionalData = array_merge($arrAdditionalData, $arrExif);
                     }
                 }
             }
             //Default Publish State
             $blnDefaultPublishState = $this->pdh->get('mediacenter_categories', 'default_published_state', array($intCategoryID));
             $intPublished = $this->user->check_auth('a_mediacenter_manage', false) ? 1 : $blnDefaultPublishState;
             if ($strExtension != "") {
                 $strFilename = $strFile . '.' . $strExtension;
             } else {
                 $strFilename = $strFile;
             }
             $arrQuery = array('album_id' => $intAlbumID, 'category_id' => $intCategoryID, 'name' => $strName, 'description' => "", 'type' => $intType, 'tags' => serialize(array()), 'filename' => $strFilename, 'localfile' => $strLocalfile, 'externalfile' => "", 'previewimage' => $strLocalPreviewImage, 'published' => $intPublished, 'additionaldata' => serialize($arrAdditionalData), 'date' => $this->time->time, 'user_id' => $this->user->id);
             $objQuery = $this->db->prepare("INSERT INTO __mediacenter_media :p")->set($arrQuery)->execute();
             if ($objQuery) {
                 $id = $objQuery->insertId;
                 $arrSucces[] = $strFile;
                 $this->tpl->assign_block_vars('mc_media_row', array('ICON' => $this->core->icon_font('fa-check'), 'NAME' => $strFile, 'STATUS' => "OK", 'EXTENSION' => $strExtension));
             }
         }
     }
     $this->pdh->enqueue_hook('mediacenter_media_update');
     $this->pdh->enqueue_hook('mediacenter_categories_update');
     $this->pdh->process_hook_queue();
     $this->display(false);
 }
Esempio n. 14
0
 public function display()
 {
     // Build the default game array
     $games = array();
     foreach ($this->game->get_games() as $sgame) {
         $games[$sgame] = $this->game->game_name($sgame);
     }
     // ---------------------------------------------------------
     // Build the Dropdown Arrays
     // ---------------------------------------------------------
     $newsloot_limit = array('all' => 0, '5' => 5, '10' => 10, '15' => 15, '20' => 20);
     $a_startday = array('sunday' => $this->user->lang(array('time_daynames', 6)), 'monday' => $this->user->lang(array('time_daynames', 0)));
     $a_calraid_status = array(0 => $this->user->lang(array('raidevent_raid_status', 0)), 1 => $this->user->lang(array('raidevent_raid_status', 1)), 2 => $this->user->lang(array('raidevent_raid_status', 2)), 3 => $this->user->lang(array('raidevent_raid_status', 3)), 4 => $this->user->lang(array('raidevent_raid_status', 4)));
     $a_calraid_nsfilter = array('twinks' => 'raidevent_raid_nsf_twink', 'inactive' => 'raidevent_raid_nsf_inctv', 'hidden' => 'raidevent_raid_nsf_hiddn', 'special' => 'raidevent_raid_nsf_special');
     $a_debug_mode = array('0' => 'pk_set_debug_type0', '1' => 'pk_set_debug_type1', '2' => 'pk_set_debug_type2', '3' => 'pk_set_debug_type3');
     $a_modelviewer = array('0' => 'WoWHead', '1' => 'Thottbot', '2' => 'SpeedyDragon');
     $accact_array = array('0' => 'none', '1' => 'user', '2' => 'admin');
     $portal_positions = array('right' => 'portalplugin_right', 'middle' => 'portalplugin_middle', 'bottom' => 'portalplugin_bottom');
     $mail_array = array('mail' => 'lib_email_mail', 'sendmail' => 'lib_email_sendmail', 'smtp' => 'lib_email_smtp');
     $stmp_connection_methods = array('' => 'none', 'ssl' => 'SSL/TLS', 'tls' => 'STARTTLS');
     $a_calendar_addevmode = array('event' => 'calendar_mode_event', 'raid' => 'calendar_mode_raid');
     $a_groups = $this->pdh->aget('user_groups', 'name', 0, array($this->pdh->get('user_groups', 'id_list')));
     // Startpage
     $menus = $this->core->gen_menus();
     $pages = array_merge($menus['menu1'], $menus['menu2']);
     unset($menus);
     if (is_array($this->pdh->get('pages', 'startpage_list', array()))) {
         // Add Pages to startpage array
         $pages = array_merge_recursive($pages, $this->pdh->get('pages', 'startpage_list', array()));
     }
     foreach ($pages as $page) {
         $link = preg_replace('#\\?s\\=([0-9A-Za-z]{1,32})?#', '', $page['link']);
         $link = preg_replace('#\\.php&amp;#', '.php?', $link);
         $link = preg_replace('#\\.php&#', '.php?', $link);
         $text = isset($this->user->data['username']) ? str_replace($this->user->data['username'], $this->user->lang('username'), $page['text']) : $page['text'];
         if ($link != 'login.php?logout=true') {
             $startpage_array[$link] = $text;
         }
         unset($link, $text);
     }
     // Build language array
     if ($dir = @opendir($this->core->root_path . 'language/')) {
         while ($file = @readdir($dir)) {
             if (!is_file($this->core->root_path . 'language/' . $file) && !is_link($this->core->root_path . 'language/' . $file) && valid_folder($file)) {
                 include $this->core->root_path . 'language/' . $file . '/lang_main.php';
                 $lang_name_tp = $lang['ISO_LANG_NAME'] ? $lang['ISO_LANG_NAME'] . ' (' . $lang['ISO_LANG_SHORT'] . ')' : ucfirst($file);
                 $language_array[$file] = $lang_name_tp;
                 $locale_array[$lang['ISO_LANG_SHORT']] = $lang_name_tp;
             }
         }
     }
     //Social Plugins
     $arrSocialPlugins = $this->social->getSocialPlugins();
     $arrSocialFields = array();
     foreach ($arrSocialPlugins as $key => $value) {
         $arrSocialFields['sp_' . $key] = array('fieldtype' => 'checkbox', 'name' => 'sp_' . $key);
     }
     $arrSocialButtons = $this->social->getSocialButtons();
     foreach ($arrSocialButtons as $key => $value) {
         $arrSocialFields['sp_' . $key] = array('fieldtype' => 'checkbox', 'name' => 'sp_' . $key);
     }
     // ---------------------------------------------------------
     // Member Array
     // ---------------------------------------------------------
     $members = $this->pdh->aget('member', 'name', 0, array($this->pdh->get('member', 'id_list', array(false, false, false))));
     asort($members);
     // ---------------------------------------------------------
     // Portal position
     // ---------------------------------------------------------
     $selected_portal_pos = unserialize(stripslashes($this->config->get('pk_permanent_portal')));
     // ---------------------------------------------------------
     // Default email signature
     // ---------------------------------------------------------
     $signature = "--\n";
     $signature .= $this->user->lang('lib_signature_defaultval');
     $signature .= ' ' . $this->config->get('guildtag');
     $signature .= "\nEQdkp Plus: ";
     $signature .= $this->env->link;
     // Bit of jQuery..
     if ($this->game->get_importAuth('a_members_man', 'char_mupdate')) {
         $this->jquery->Dialog('MassUpdateChars', $this->user->lang('uc_import_adm_update'), array('url' => $this->game->get_importers('char_mupdate', true), 'width' => '600', 'height' => '450', 'onclose' => $this->env->link . 'admin/manage_settings.php'));
     }
     if ($this->game->get_importAuth('a_members_man', 'guild_import')) {
         $this->jquery->Dialog('GuildImport', $this->user->lang('uc_import_guild_wh'), array('url' => $this->game->get_importers('guild_import', true), 'width' => '600', 'height' => '450', 'onclose' => $this->env->link . 'admin/manage_settings.php'));
     }
     if (($this->game->get_importAuth('a_members_man', 'char_mupdate') || $this->game->get_importAuth('a_members_man', 'guild_import')) && $this->game->get_importers('import_data_cache')) {
         $this->jquery->Dialog('ClearImportCache', $this->user->lang('uc_importer_cache'), array('url' => $this->game->get_importers('import_reseturl', true), 'width' => '400', 'height' => '250', 'onclose' => $this->env->link . 'admin/manage_settings.php'));
     }
     $this->jquery->spinner('#inactive_period, #pk_round_precision, #inactive_period, #default_nlimit, #calendar_raid_classbreak, #calendar_addraid_deadline, #failed_logins_inactivity', array('multiselector' => true));
     $this->jquery->spinner('#default_alimit, #default_climit, #default_ilimit, #default_rlimit, #default_elimit, #calendar_addraid_duration, #calendar_repeat_crondays', array('step' => 10, 'multiselector' => true));
     $this->jquery->spinner('pk_newsloot_limit', array('step' => 10, 'max' => 25, 'steps' => 5, 'min' => 0));
     // ---------------------------------------------------------
     // Output to the page
     // ---------------------------------------------------------
     $this->jquery->Tab_header('plus_sett_tabs', true);
     $this->jquery->Dialog('template_preview', $this->user->lang('template_preview'), array('url' => $this->root_path . "viewnews.php" . $this->SID . "&amp;style='+ \$(\"select[name='user_style'] option:selected\").val()+'", 'width' => '750', 'height' => '520', 'modal' => true));
     $game_array = $this->jquery->dd_ajax_request('default_game', 'game_language', $games, array('--------'), $this->config->get('default_game'), 'manage_settings.php' . $this->SID . '&ajax=games');
     $settingsdata = array('global' => array('global' => array('pk_updatecheck' => array('fieldtype' => 'checkbox', 'name' => 'pk_updatecheck', 'not4hmode' => true), 'guildtag' => array('fieldtype' => 'text', 'name' => 'guildtag', 'size' => 35), 'main_title' => array('fieldtype' => 'text', 'name' => 'main_title', 'size' => 40), 'sub_title' => array('fieldtype' => 'text', 'name' => 'sub_title', 'size' => 40), 'dkp_name' => array('fieldtype' => 'text', 'name' => 'dkp_name', 'size' => 5), 'pk_color_items' => array('fieldtype' => 'slider', 'name' => 'pk_color_items', 'label' => $this->user->lang('pk_color_items'), 'min' => 0, 'max' => 100, 'width' => '300px', 'format' => 'range', 'serialized' => true, 'datatype' => 'int'), 'pk_enable_comments' => array('fieldtype' => 'checkbox', 'name' => 'pk_enable_comments'), 'pk_round_activate' => array('fieldtype' => 'checkbox', 'name' => 'pk_round_activate', 'default' => 0), 'pk_round_precision' => array('fieldtype' => 'text', 'name' => 'pk_round_precision', 'size' => 2, 'id' => 'pk_round_precision', 'class' => '', 'default' => 0), 'pk_debug' => array('fieldtype' => 'dropdown', 'name' => 'pk_debug', 'options' => $a_debug_mode)), 'meta' => array('pk_meta_keywords' => array('fieldtype' => 'text', 'name' => 'pk_meta_keywords', 'size' => 40), 'pk_meta_description' => array('fieldtype' => 'text', 'name' => 'pk_meta_description', 'size' => 40)), 'disclaimer' => array('pk_disclaimer_show' => array('fieldtype' => 'checkbox', 'name' => 'pk_disclaimer_show'), 'pk_disclaimer_name' => array('fieldtype' => 'text', 'name' => 'pk_disclaimer_name', 'size' => 40, 'dependency' => 'pk_disclaimer_show'), 'pk_disclaimer_address' => array('fieldtype' => 'textarea', 'name' => 'pk_disclaimer_address', 'cols' => 50, 'rows' => 4, 'dependency' => 'pk_disclaimer_show'), 'pk_disclaimer_email' => array('fieldtype' => 'text', 'name' => 'pk_disclaimer_email', 'size' => 40, 'dependency' => 'pk_disclaimer_show'), 'pk_disclaimer_irc' => array('fieldtype' => 'text', 'name' => 'pk_disclaimer_irc', 'size' => 40, 'dependency' => 'pk_disclaimer_show'), 'pk_disclaimer_messenger' => array('fieldtype' => 'text', 'name' => 'pk_disclaimer_messenger', 'size' => 40, 'dependency' => 'pk_disclaimer_show'), 'pk_disclaimer_custom' => array('fieldtype' => 'text', 'name' => 'pk_disclaimer_custom', 'size' => 50, 'dependency' => 'pk_disclaimer_show'))), 'system' => array('globalsettings' => array('default_locale' => array('fieldtype' => 'dropdown', 'name' => 'default_locale', 'options' => $locale_array, 'no_lang' => true), 'server_path' => array('fieldtype' => 'text', 'name' => 'server_path', 'size' => 50, 'not4hmode' => true), 'enable_gzip' => array('fieldtype' => 'checkbox', 'name' => 'enable_gzip', 'not4hmode' => true, 'default' => 0), 'upload_allowed_extensions' => array('fieldtype' => 'text', 'name' => 'upload_allowed_extensions', 'size' => 50)), 'auth' => array('auth_method' => array('fieldtype' => 'dropdown', 'name' => 'auth_method', 'options' => $this->user->get_available_authmethods(), 'default' => 'db')), 'login' => array('login_method' => array('fieldtype' => 'jq_multiselect', 'name' => 'login_method', 'options' => $this->user->get_available_loginmethods(), 'serialized' => true, 'default' => '')), 'cookie' => array('cookie_domain' => array('fieldtype' => 'text', 'name' => 'cookie_domain', 'size' => 25, 'not4hmode' => true), 'cookie_name' => array('fieldtype' => 'text', 'name' => 'cookie_name', 'size' => 25, 'not4hmode' => true), 'cookie_path' => array('fieldtype' => 'text', 'name' => 'cookie_path', 'size' => 25, 'not4hmode' => true)), 'email' => array('lib_email_method' => array('fieldtype' => 'dropdown', 'name' => 'lib_email_method', 'options' => $mail_array), 'admin_email' => array('fieldtype' => 'text', 'name' => 'admin_email', 'size' => 30, 'encrypt' => true), 'lib_email_sender_name' => array('fieldtype' => 'text', 'name' => 'lib_email_sender_name', 'size' => 30), 'lib_email_sendmail_path' => array('fieldtype' => 'text', 'name' => 'lib_email_sendmail_path', 'size' => 30, 'dependency' => array('lib_email_method', 'sendmail')), 'lib_email_smtp_host' => array('fieldtype' => 'text', 'name' => 'lib_email_smtp_host', 'size' => 30, 'dependency' => array('lib_email_method', 'smtp')), 'lib_email_smtp_port' => array('fieldtype' => 'text', 'name' => 'lib_email_smtp_port', 'size' => 5, 'default' => 25, 'dependency' => array('lib_email_method', 'smtp')), 'lib_email_smtp_connmethod' => array('fieldtype' => 'dropdown', 'name' => 'lib_email_smtp_connmethod', 'options' => $stmp_connection_methods, 'dependency' => array('lib_email_method', 'smtp')), 'lib_email_smtp_auth' => array('fieldtype' => 'checkbox', 'name' => 'lib_email_smtp_auth', 'dependency' => array('lib_email_method', 'smtp')), 'lib_email_smtp_user' => array('fieldtype' => 'text', 'name' => 'lib_email_smtp_user', 'size' => 30, 'dependency' => array('lib_email_method', 'smtp')), 'lib_email_smtp_pw' => array('fieldtype' => 'password', 'name' => 'lib_email_smtp_pw', 'size' => 30, 'dependency' => array('lib_email_method', 'smtp')), 'lib_email_signature' => array('fieldtype' => 'checkbox', 'name' => 'lib_email_signature', 'default' => 0), 'lib_email_signature_value' => array('fieldtype' => 'textarea', 'name' => 'lib_email_signature_value', 'default' => $signature, 'cols' => 80, 'rows' => 5, 'dependency' => 'lib_email_signature')), 'recaptcha' => array('lib_recaptcha_okey' => array('fieldtype' => 'text', 'name' => 'lib_recaptcha_okey', 'size' => 30), 'lib_recaptcha_pkey' => array('fieldtype' => 'text', 'name' => 'lib_recaptcha_pkey', 'size' => 30)), 'date' => array('timezone' => array('fieldtype' => 'dropdown', 'name' => 'timezone', 'options' => $this->time->timezones), 'pk_date_startday' => array('fieldtype' => 'dropdown', 'name' => 'pk_date_startday', 'options' => $a_startday, 'no_lang' => true), 'default_date_time' => array('fieldtype' => 'text', 'name' => 'default_date_time', 'size' => 10, 'default' => $this->user->lang('style_time')), 'default_date_short' => array('fieldtype' => 'text', 'name' => 'default_date_short', 'size' => 20, 'default' => $this->user->lang('style_date_short')), 'default_date_long' => array('fieldtype' => 'text', 'name' => 'default_date_long', 'size' => 20, 'default' => $this->user->lang('style_date_long')))), 'user' => array('user' => array('default_lang' => array('fieldtype' => 'dropdown', 'name' => 'default_lang', 'options' => $language_array, 'no_lang' => true), 'account_activation' => array('fieldtype' => 'radio', 'name' => 'account_activation', 'options' => $accact_array, 'default' => 0), 'failed_logins_inactivity' => array('fieldtype' => 'text', 'name' => 'failed_logins_inactivity', 'size' => 5, 'id' => 'failed_logins_inactivity', 'class' => '', 'default' => 5), 'disable_registration' => array('fieldtype' => 'checkbox', 'name' => 'disable_registration'), 'pk_enable_captcha' => array('fieldtype' => 'checkbox', 'name' => 'pk_enable_captcha'), 'pk_disable_username_change' => array('fieldtype' => 'checkbox', 'name' => 'pk_disable_username_change'), 'default_style_overwrite' => array('fieldtype' => 'checkbox', 'name' => 'default_style_overwrite'), 'special_user' => array('fieldtype' => 'jq_multiselect', 'name' => 'special_user', 'options' => $this->pdh->aget('user', 'name', 0, array($this->pdh->get('user', 'id_list'))), 'serialized' => true, 'datatype' => 'int', 'no_lang' => true))), 'chars' => array('chars' => array('pk_class_color' => array('fieldtype' => 'checkbox', 'name' => 'pk_class_color'), 'special_members' => array('fieldtype' => 'jq_multiselect', 'name' => 'special_members', 'options' => $members, 'serialized' => true, 'datatype' => 'int', 'no_lang' => true), 'pk_show_twinks' => array('fieldtype' => 'checkbox', 'name' => 'pk_show_twinks', 'default' => 0), 'pk_detail_twink' => array('fieldtype' => 'checkbox', 'name' => 'pk_detail_twink', 'default' => 0), 'hide_inactive' => array('fieldtype' => 'checkbox', 'name' => 'hide_inactive', 'default' => 0), 'inactive_period' => array('fieldtype' => 'text', 'name' => 'inactive_period', 'size' => 5, 'id' => 'inactive_period', 'class' => '', 'default' => 0))), 'calendar' => array('calendar' => array('calendar_addevent_mode' => array('fieldtype' => 'dropdown', 'name' => 'calendar_addevent_mode', 'options' => $a_calendar_addevmode)), 'raids' => array('calendar_raid_guests' => array('fieldtype' => 'checkbox', 'name' => 'calendar_raid_guests'), 'calendar_raid_random' => array('fieldtype' => 'checkbox', 'name' => 'calendar_raid_random'), 'calendar_raid_classbreak' => array('fieldtype' => 'text', 'name' => 'calendar_raid_classbreak', 'size' => 4, 'id' => 'calendar_raid_classbreak', 'class' => ''), 'calendar_raid_status' => array('fieldtype' => 'jq_multiselect', 'name' => 'calendar_raid_status', 'options' => $a_calraid_status, 'serialized' => true, 'datatype' => 'int', 'no_lang' => true), 'calendar_raid_nsfilter' => array('fieldtype' => 'jq_multiselect', 'name' => 'calendar_raid_nsfilter', 'options' => $a_calraid_nsfilter, 'serialized' => true, 'datatype' => 'string'), 'calendar_addraid_deadline' => array('fieldtype' => 'text', 'name' => 'calendar_addraid_deadline', 'size' => 5, 'id' => 'calendar_addraid_deadline', 'class' => '', 'default' => '1'), 'calendar_addraid_duration' => array('fieldtype' => 'text', 'name' => 'calendar_addraid_duration', 'size' => 5, 'id' => 'calendar_addraid_duration', 'class' => '', 'default' => '120'), 'calendar_addraid_use_def_start' => array('fieldtype' => 'checkbox', 'name' => 'calendar_addraid_use_def_start'), 'calendar_addraid_def_starttime' => array('fieldtype' => 'timepicker', 'name' => 'calendar_addraid_def_starttime', 'dependency' => 'calendar_addraid_use_def_start', 'default' => '20:00'), 'calendar_repeat_crondays' => array('fieldtype' => 'text', 'name' => 'calendar_repeat_crondays', 'size' => 5, 'id' => 'calendar_repeat_crondays', 'class' => '', 'default' => '40'), 'calendar_raid_autoconfirm' => array('fieldtype' => 'jq_multiselect', 'name' => 'calendar_raid_autoconfirm', 'options' => $a_groups, 'serialized' => true, 'datatype' => 'int', 'no_lang' => true), 'calendar_raid_autocaddchars' => array('fieldtype' => 'jq_multiselect', 'name' => 'calendar_raid_autocaddchars', 'options' => $a_groups, 'serialized' => true, 'datatype' => 'int', 'no_lang' => true), 'calendar_raid_shownotes' => array('fieldtype' => 'jq_multiselect', 'name' => 'calendar_raid_shownotes', 'options' => $a_groups, 'serialized' => true, 'datatype' => 'int', 'no_lang' => true), 'calendar_raid_notsigned_classsort' => array('fieldtype' => 'checkbox', 'name' => 'calendar_raid_notsigned_classsort'), 'calendar_raid_coloredclassnames' => array('fieldtype' => 'checkbox', 'name' => 'calendar_raid_coloredclassnames'), 'calendar_raid_shownotsigned' => array('fieldtype' => 'checkbox', 'name' => 'calendar_raid_shownotsigned'), 'calendar_raid_allowstatuschange' => array('fieldtype' => 'checkbox', 'name' => 'calendar_raid_allowstatuschange')), 'calendar_mails' => array('calendar_email_statuschange' => array('fieldtype' => 'checkbox', 'name' => 'calendar_email_statuschange'), 'calendar_email_newraid' => array('fieldtype' => 'checkbox', 'name' => 'calendar_email_newraid'), 'calendar_email_openclose' => array('fieldtype' => 'checkbox', 'name' => 'calendar_email_openclose'))), 'game' => array('game' => array('pk_defaultgame' => array('fieldtype' => 'direct', 'name' => 'pk_defaultgame', 'direct' => $game_array[0]), 'pk_defaultgamelang' => array('fieldtype' => 'direct', 'name' => 'pk_defaultgamelang', 'direct' => $game_array[1]))), 'portal' => array('portal' => array('start_page' => array('fieldtype' => 'dropdown', 'name' => 'start_page', 'options' => $startpage_array), 'pk_permanent_portal' => array('fieldtype' => 'jq_multiselect', 'name' => 'pk_permanent_portal', 'options' => $portal_positions, 'selected' => $selected_portal_pos, 'serialized' => true, 'datatype' => 'string'), 'pk_portal_website' => array('fieldtype' => 'text', 'name' => 'pk_portal_website', 'size' => 40), 'eqdkpm_shownote' => array('fieldtype' => 'checkbox', 'name' => 'eqdkpm_shownote')), 'news' => array('enable_newscategories' => array('fieldtype' => 'checkbox', 'name' => 'enable_newscategories'), 'disable_embedly' => array('fieldtype' => 'checkbox', 'name' => 'disable_embedly'), 'thumbnail_defaultsize' => array('fieldtype' => 'int', 'name' => 'thumbnail_defaultsize', 'size' => 3, 'default' => 500)), 'social_sharing' => $arrSocialFields), 'layout' => array('layout' => array('custom_logo' => array('fieldtype' => 'imageuploader', 'name' => 'custom_logo', 'imgpath' => $this->pfh->FolderPath('logo', 'eqdkp'), 'options' => array('noimgfile' => "templates/" . $this->user->style['template_path'] . "/images/logo.png")), 'pk_itemhistory_dia' => array('fieldtype' => 'checkbox', 'name' => 'pk_itemhistory_dia')), 'default' => array('default_alimit' => array('fieldtype' => 'text', 'name' => 'default_alimit', 'size' => 5, 'id' => 'default_alimit', 'class' => '', 'default' => 0), 'default_elimit' => array('fieldtype' => 'text', 'name' => 'default_elimit', 'size' => 5, 'id' => 'default_elimit', 'class' => '', 'default' => 0), 'default_ilimit' => array('fieldtype' => 'text', 'name' => 'default_ilimit', 'size' => 5, 'id' => 'default_ilimit', 'class' => '', 'default' => 0), 'default_nlimit' => array('fieldtype' => 'text', 'name' => 'default_nlimit', 'size' => 5, 'id' => 'default_nlimit', 'class' => '', 'default' => 0), 'default_rlimit' => array('fieldtype' => 'text', 'name' => 'default_rlimit', 'size' => 5, 'id' => 'default_rlimit', 'class' => '', 'default' => 0), 'pk_newsloot_limit' => array('fieldtype' => 'text', 'name' => 'pk_newsloot_limit', 'size' => 5, 'id' => 'pk_newsloot_limit', 'class' => '', 'default' => '0'))), 'itemtooltip' => array(), 'sms' => array('sms' => array('pk_sms_enable' => array('fieldtype' => 'checkbox', 'name' => 'pk_sms_enable'), 'pk_sms_username' => array('fieldtype' => 'text', 'name' => 'pk_sms_username', 'size' => 40, 'dependency' => 'pk_sms_enable'), 'pk_sms_password' => array('fieldtype' => 'password', 'name' => 'pk_sms_password', 'size' => 40, 'dependency' => 'pk_sms_enable'))));
     // ItemTooltip Inject
     if (in_array($this->game->get_game(), $this->itt->get_supported_games())) {
         $settingsdata['itemtooltip']['itemtooltip'] = array('infotooltip_use' => array('fieldtype' => 'checkbox', 'name' => 'infotooltip_use'), 'itt_debug' => array('fieldtype' => 'checkbox', 'name' => 'itt_debug'), 'itt_trash' => array('name' => 'itt_trash', 'fieldtype' => 'direct', 'direct' => '<input type="submit" name="itt_reset" value="' . $this->user->lang('pk_itt_reset') . '" class="mainoption bi_reset" />'));
         $itt_parserlist = $this->itt->get_parserlist();
         $settingsdata['itemtooltip']['priorities'] = array('itt_prio1' => array('fieldtype' => 'dropdown', 'name' => 'itt_prio1', 'options' => $itt_parserlist), 'itt_prio2' => array('fieldtype' => 'dropdown', 'name' => 'itt_prio2', 'options' => $itt_parserlist));
         $ittsettdata = $this->itt->get_extra_settings();
         if (is_array($ittsettdata)) {
             foreach ($ittsettdata as $confvars) {
                 $ittsett_value = $this->config->get($confvars['name']) ? $this->config->get($confvars['name']) : $confvars['default'];
                 $settingsdata['itemtooltip']['ittdbsettings'][$confvars['name']] = $confvars;
             }
             //add button to reload defaults
             $settingsdata['itemtooltip']['ittdbsettings']['itt_force_default'] = array('name' => 'pk_itt_force_default', 'fieldtype' => 'direct', 'direct' => '<input type="submit" name="itt_force_default" value="' . $this->user->lang('pk_itt_force_default') . '" class="mainoption bi_reset" />');
         }
         $itt_langlist = $this->itt->get_supported_languages();
         for ($i = 1; $i <= 3; $i++) {
             $settingsdata['itemtooltip']['ittlanguages']['itt_langprio' . $i] = array('fieldtype' => 'dropdown', 'name' => 'itt_langprio' . $i, 'options' => $itt_langlist, 'no_lang' => true);
         }
         //check if user wanted to reset itt-cache
         if ($this->in->get('itt_reset', false)) {
             $this->itt->reset_cache();
             $this->core->message($this->user->lang('itt_reset_success'), $this->user->lang('success'), 'green');
         }
         //check if user wanted to reload defaults$
         if ($this->in->get('itt_force_default', '') != '') {
             $this->config->set($this->itt->changed_prio1($this->in->get('itt_prio1')));
             $this->core->message($this->user->lang('itt_default_success'), $this->user->lang('success'), 'green');
         }
     }
     // The importer settings
     if ($this->game->get_importAuth('a_members_man', 'guild_import')) {
         if ($this->game->get_importers('guild_imp_rsn') && $this->config->get('uc_servername') == '') {
             $gimport_out = '<input type="button" name="add" value="' . $this->user->lang('uc_bttn_import') . '" disabled="disabled" />';
         } else {
             $gimport_out = '<input type="button" name="add" value="' . $this->user->lang('uc_bttn_import') . '" class="mainoption" onclick="javascript:GuildImport()" />';
         }
         $settingsdata['game']['importer']['uc_import_guild'] = array('name' => 'uc_import_guild', 'fieldtype' => 'direct', 'direct' => $gimport_out);
     }
     if ($this->game->get_importAuth('a_members_man', 'char_mupdate')) {
         if ($this->game->get_importers('guild_imp_rsn') && $this->config->get('uc_servername') == '') {
             $cupdate_out = '<input type="button" name="add" value="' . $this->user->lang('uc_bttn_update') . '" disabled="disabled" />';
         } else {
             $cupdate_out = '<input type="button" name="add" value="' . $this->user->lang('uc_bttn_update') . '" class="mainoption" onclick="javascript:MassUpdateChars()" />';
         }
         $cupdate_out .= ' [' . ($this->config->get('uc_profileimported') ? $this->user->lang('uc_last_updated') . ': ' . date($this->user->style['date_time'], $this->config->get('uc_profileimported')) : $this->user->lang('uc_never_updated')) . ']';
         $settingsdata['game']['importer']['uc_update_all'] = array('name' => 'uc_update_all', 'fieldtype' => 'direct', 'direct' => $cupdate_out);
     }
     // Importer cache reset button
     if (($this->game->get_importAuth('a_members_man', 'guild_import') || $this->game->get_importAuth('a_members_man', 'char_mupdate')) && $this->game->get_importers('import_data_cache')) {
         $settingsdata['game']['importer']['uc_importer_cache'] = array('name' => 'uc_importer_cache', 'fieldtype' => 'direct', 'direct' => '<input type="button" name="add" value="' . $this->user->lang('uc_bttn_resetcache') . '" class="mainoption" onclick="javascript:ClearImportCache()" />');
     }
     // merge the game admin array to the existing one
     $myprofiledata = $this->root_path . 'games/' . $this->game->get_game() . '/admin_data.php';
     if (is_file($myprofiledata)) {
         require_once $myprofiledata;
         if (is_array($settingsdata_admin)) {
             $settingsdata = array_merge_recursive($settingsdata, $settingsdata_admin);
         }
     }
     //Merge authmethod-settings
     if ($this->user->get_authmethod_settings()) {
         $settingsdata = array_merge_recursive($settingsdata, $this->user->get_authmethod_settings());
     }
     //Merge loginmethod-settings
     if ($arrLoginmethodSettings = $this->user->get_loginmethod_settings()) {
         $settingsdata = array_merge_recursive($settingsdata, $arrLoginmethodSettings);
     }
     // Inject Plugin Settings
     // PLACEHOLDER.. maybe we will do that one day...
     // save the setting
     if ($this->in->get('save_plus') && $this->checkCSRF('display')) {
         foreach ($settingsdata as $tabname => $fieldsetdata) {
             foreach ($fieldsetdata as $fieldsetname => $fielddata) {
                 foreach ($fielddata as $name => $confvars) {
                     if (isset($confvars['serialized'])) {
                         $tmp_get = serialize($this->in->getArray($confvars['name'], $confvars['datatype']));
                     } else {
                         $tmp_get = $this->html->widget_return($confvars);
                     }
                     if (isset($confvars['edecode'])) {
                         $tmp_get = html_entity_decode($tmp_get);
                     }
                     $save_array[$confvars['name']] = $tmp_get;
                 }
             }
         }
         //check for changed game
         $game_changed = false;
         if ($this->in->get('default_game') != $this->config->get('default_game') || $this->in->get('game_language') != $this->config->get('game_language')) {
             $game_changed = true;
         }
         //check for changed itt 1.prio and load defaults if so
         if ($this->config->get('itt_prio1') != $this->in->get('itt_prio1', '')) {
             $save_array = array_merge($save_array, $this->itt->changed_prio1($this->in->get('itt_prio1')));
         }
         // Save the settings array
         $this->config->set($save_array);
         // Since ChangeGame alters Config it has to be executed after config-save
         if ($game_changed) {
             $this->game->ChangeGame($this->in->get('default_game'), $this->in->get('game_language'));
             $this->pdc->flush();
             redirect('admin/manage_settings.php' . $this->SID);
             // we need to reload cause of the per-game settings
         }
         //clear cache now
         $this->pdc->flush();
         // The Saved-Message
         $this->core->message($this->user->lang('pk_succ_saved'), $this->user->lang('pk_save_title'), 'green');
     }
     // Output
     foreach ($settingsdata as $tabname => $fieldsetdata) {
         $this->tpl->assign_block_vars('tabs', array('NAME' => $this->user->lang('pk_tab_' . $tabname), 'ID' => $tabname));
         foreach ($fieldsetdata as $fieldsetname => $fielddata) {
             $this->tpl->assign_block_vars('tabs.fieldset', array('NAME' => $this->user->lang('pk_tab_fs_' . $fieldsetname, false, false) ? $this->user->lang('pk_tab_fs_' . $fieldsetname) : $this->game->glang('pk_tab_fs_' . $fieldsetname), 'INFO' => $this->user->lang('pk_tab_info_' . $fieldsetname, false, false) ? $this->user->lang('pk_tab_info_' . $fieldsetname) : $this->game->glang('pk_tab_info_' . $fieldsetname)));
             foreach ($fielddata as $name => $confvars) {
                 // continue if hmode == true
                 if ($this->hmode && $confvars['not4hmode'] || isset($confvars['disabled']) && $confvars['disabled'] === true) {
                     continue;
                 }
                 $no_lang = isset($confvars['no_lang']) ? true : false;
                 $selection = $this->config->get($confvars['name']) ? $this->config->get($confvars['name']) : (isset($confvars['default']) ? $confvars['default'] : '');
                 $this->tpl->assign_block_vars('tabs.fieldset.field', array('NAME' => $this->user->lang($confvars['name'], false, false) ? $this->user->lang($confvars['name']) : ($this->game->glang($confvars['name']) ? $this->game->glang($confvars['name']) : $confvars['name']), 'HELP' => $this->user->lang($confvars['name'] . '_help', false, false) ? $this->user->lang($confvars['name'] . '_help') : ($this->game->glang($confvars['name'] . '_help') ? $this->game->glang($confvars['name'] . '_help') : ''), 'FIELD' => $this->html->generateField($confvars, $name, $selection, $no_lang)));
             }
         }
     }
     $this->core->set_vars(array('page_title' => $this->user->lang('config_title'), 'template_file' => 'admin/manage_settings.html', 'display' => true));
 }
Esempio n. 15
0
 public function scan_templates($templatepath, $orig_templatepath = false, $remove_templatepath = true)
 {
     $files = array();
     if (!$orig_templatepath) {
         $orig_templatepath = $templatepath;
     }
     if ($dir = @opendir($templatepath)) {
         while ($file = @readdir($dir)) {
             if (is_dir($templatepath . '/' . $file) && valid_folder($templatepath . '/' . $file)) {
                 $files_rec = $this->scan_templates($templatepath . '/' . $file, $templatepath, $remove_templatepath);
                 $files = array_merge($files, $files_rec);
             } else {
                 $ext = pathinfo($file, PATHINFO_EXTENSION);
                 if ($file != "index.php" && $file != "index.html" && $file != 'user_additions.css' && $file != 'jquery_tmpl.css' && $file != "main.css" && in_array($ext, $this->allowed_extensions)) {
                     $filepath = $remove_templatepath ? str_replace($orig_templatepath . '/', '', $templatepath . '/' . $file) : $file;
                     $files[$filepath] = $file;
                 }
             }
         }
     }
     return $files;
 }
Esempio n. 16
0
 public function get_available_authmethods()
 {
     $auth = array();
     // Build auth array
     if ($dir = @opendir($this->root_path . 'core/auth/')) {
         while ($file = @readdir($dir)) {
             if (is_file($this->root_path . 'core/auth/' . $file) && valid_folder($file)) {
                 $name = substr(substr($file, 0, strpos($file, '.')), 5);
                 $auth[$name] = $this->lang('auth_' . $name, false, false) ? $this->lang('auth_' . $name) : ucfirst($name);
             }
         }
     }
     return $auth;
 }
Esempio n. 17
0
    public function display()
    {
        //Show error / success messages
        if ($this->in->exists('mes')) {
            $arrMessage = unserialize(base64_decode($this->in->get('mes')));
            if (isset($arrMessage[0]) && $arrMessage[1]) {
                $this->core->message($arrMessage[0], $arrMessage[1], $arrMessage[2]);
            }
        }
        //Get Extensions
        $arrExtensionList = $this->repo->getExtensionList();
        $arrExtensionListNamed = array();
        if (is_array($arrExtensionList)) {
            foreach ($arrExtensionList as $catid => $extensions) {
                if (is_array($extensions)) {
                    foreach ($extensions as $id => $ext) {
                        if (!isset($arrExtensionListNamed[$catid])) {
                            $arrExtensionListNamed[$catid] = array();
                        }
                        $arrExtensionListNamed[$catid][$ext['plugin']] = $id;
                    }
                }
            }
        }
        //Get Updates
        $urgendUpdates = $this->repo->BuildUpdateArray();
        $allUpdates = $this->repo->BuildUpdateArray(false);
        $arrUpdateCount = array(1 => array('red' => 0, 'yellow' => 0), 2 => array('red' => 0, 'yellow' => 0), 3 => array('red' => 0, 'yellow' => 0), 4 => array('red' => 0, 'yellow' => 0), 7 => array('red' => 0, 'yellow' => 0), 11 => array('red' => 0, 'yellow' => 0));
        //=================================================================
        //Plugins
        $this->pm->search();
        //search for new plugins
        $plugins_array = $this->pm->get_plugins(PLUGIN_ALL);
        //maybe plugins want to auto-install portalmodules
        $this->portal->get_all_modules();
        $plugin_count = count($plugins_array);
        $db_plugins = $this->pdh->get('plugins', 'id_list');
        foreach ($plugins_array as $plugin_code) {
            if ($plugin_code == 'pluskernel') {
                continue;
            }
            $contact = $this->pm->get_data($plugin_code, 'contact');
            $version = $this->pm->get_data($plugin_code, 'version');
            $description = $this->pm->get_data($plugin_code, 'description');
            $long_description = $this->pm->get_data($plugin_code, 'long_description');
            $manuallink = $this->pm->get_data($plugin_code, 'manuallink');
            $homepagelink = $this->pm->get_data($plugin_code, 'homepage');
            $author = $this->pm->get_data($plugin_code, 'author');
            $bugtracker_url = isset($arrExtensionListNamed[1][$plugin_code]) ? sanitize($this->pdh->get('repository', 'bugtracker_url', array(1, $arrExtensionListNamed[1][$plugin_code]))) : '';
            if ($this->pm->check($plugin_code, PLUGIN_BROKEN)) {
                //Delete it from database if plugin is broken - means it isn't there anymore.
                $this->pm->delete($plugin_code);
                /*
                $this->tpl->assign_block_vars('plugins_row_broken', array(
                	'NAME'			=> $plugin_code,
                	'CODE'			=> $plugin_code,
                	'DELETE'		=> (in_array($plugin_code, $db_plugins)) ? true : false,
                	'DEL_LINK'		=> 'manage_extensions.php'.$this->SID.'&amp;cat=1&amp;mode=delete&amp;code='.$plugin_code.'&amp;link_hash='.$this->CSRFGetToken('mode'),
                ));
                */
                continue;
            }
            //dependencies
            $dep['plusv'] = $this->pm->check_dependency($plugin_code, 'plus_version');
            $dep['games'] = $this->pm->check_dependency($plugin_code, 'games');
            $dep['phpf'] = $this->pm->check_dependency($plugin_code, 'php_functions');
            //show missing functions
            $deptt['phpf'] = $this->user->lang('plug_dep_phpf');
            $needed_functions = $this->pm->get_plugin($plugin_code)->get_dependency('php_functions');
            if (is_array($needed_functions) && count($needed_functions) > 0) {
                $deptt['phpf'] .= ':<br />';
                foreach ($needed_functions as $function) {
                    $deptt['phpf'] .= function_exists($function) ? '<span class="positive">' . $function . '</span><br />' : '<span class="negative">' . $function . '</span><br />';
                }
            }
            $dep_all = $dep['plusv'] && $dep['games'] && $dep['phpf'];
            if ($this->pm->check($plugin_code, PLUGIN_DISABLED)) {
                $link = $dep_all ? '<a href="manage_extensions.php' . $this->SID . '&amp;cat=1&amp;mode=enable&amp;code=' . $plugin_code . '&amp;link_hash=' . $this->CSRFGetToken('mode') . '" title="' . $this->user->lang('enable') . '"><i class="fa fa-lg fa-toggle-off"></i></a>' : '<i class="fa fa-lg fa-exclamation-triangle" title="' . $this->user->lang('plug_dep_broken_deps') . '"></i>';
                $row = 'yellow';
            } elseif ($this->pm->check($plugin_code, PLUGIN_INSTALLED)) {
                if (isset($urgendUpdates[$plugin_code])) {
                    $row = 'red';
                    $link = '<a href="javascript:repo_update(' . $urgendUpdates[$plugin_code]['plugin_id'] . ', 1, \'' . $plugin_code . '\');" class="needs_update" data-id="' . $urgendUpdates[$plugin_code]['plugin_id'] . '" data-category="1" data-code="' . $plugin_code . '" title="' . $this->user->lang('uc_bttn_update') . '"><i class="fa fa-lg fa-refresh"></i>';
                    $arrUpdateCount[1]['red']++;
                } else {
                    $row = 'green';
                    $link = $dep_all ? '<a href="manage_extensions.php' . $this->SID . '&amp;cat=1&amp;mode=uninstall&amp;code=' . $plugin_code . '&amp;link_hash=' . $this->CSRFGetToken('mode') . '" title="' . $this->user->lang('uninstall') . '"><i class="fa fa-lg fa-toggle-on"></i></a>' : '<i class="fa fa-lg fa-exclamation-triangle" title="' . $this->user->lang('plug_dep_broken_deps') . '"></i>';
                }
            } elseif (isset($allUpdates[$plugin_code])) {
                $row = 'yellow';
                $link = '<a href="javascript:repo_update(' . $allUpdates[$plugin_code]['plugin_id'] . ', 1, \'' . $plugin_code . '\');" class="needs_update" data-id="' . $allUpdates[$plugin_code]['plugin_id'] . '" data-category="1" data-code="' . $plugin_code . '" title="' . $this->user->lang('uc_bttn_update') . '"><i class="fa fa-lg fa-refresh"></i></a>';
                $arrUpdateCount[1]['yellow']++;
                $link .= '&nbsp;&nbsp;&nbsp;<a href="manage_extensions.php' . $this->SID . '&amp;cat=1&amp;mode=remove&amp;code=' . $plugin_code . '&amp;link_hash=' . $this->CSRFGetToken('mode') . '" title="' . $this->user->lang('delete') . '"><i class="fa fa-lg fa-trash-o"></i></a>';
            } else {
                $row = 'grey';
                $link = $dep_all ? '<a href="manage_extensions.php' . $this->SID . '&amp;cat=1&amp;mode=install&amp;code=' . $plugin_code . '&amp;link_hash=' . $this->CSRFGetToken('mode') . '" title="' . $this->user->lang('install') . '"><i class="fa fa-lg fa-toggle-off"></i></a>' : '<i class="fa fa-lg fa-exclamation-triangle" title="' . $this->user->lang('plug_dep_broken_deps') . '"></i>';
                $link .= '&nbsp;&nbsp;&nbsp;<a href="manage_extensions.php' . $this->SID . '&amp;cat=1&amp;mode=remove&amp;code=' . $plugin_code . '&amp;link_hash=' . $this->CSRFGetToken('mode') . '" title="' . $this->user->lang('delete') . '"><i class="fa fa-lg fa-trash-o"></i></a>';
            }
            $this->tpl->assign_block_vars('plugins_row_' . $row, array('NAME' => isset($arrExtensionListNamed[1][$plugin_code]) ? '<a href="javascript:repoinfo(' . $arrExtensionListNamed[1][$plugin_code] . ')">' . $this->pm->get_data($plugin_code, 'name') . '</a>' : $this->pm->get_data($plugin_code, 'name'), 'VERSION' => !empty($version) ? $version : '&nbsp;', 'CODE' => $plugin_code, 'CONTACT' => !empty($contact) ? !empty($author) ? '<a href="mailto:' . $contact . '">' . $author . '</a>' : '<a href="mailto:' . $contact . '">' . $contact . '</a>' : $author, 'DESCRIPTION' => !empty($description) ? $description : '&nbsp;', 'LONG_DESCRIPTION' => $long_description, 'HOMEPAGE_LINK' => $homepagelink != '' ? $homepagelink : false, 'HOMEPAGE' => $this->user->lang('homepage'), 'MANUAL_LINK' => $manuallink != '' ? $manuallink : false, 'MANUAL' => $this->user->lang('manual'), 'ACTION_LINK' => $link, 'BUGTRACKER_URL' => $bugtracker_url));
            foreach ($dep as $key => $depdata) {
                $tt = isset($deptt[$key]) ? $deptt[$key] : $this->user->lang('plug_dep_' . $key);
                $this->tpl->assign_block_vars('plugins_row_' . $row . '.dep_row', array('DEPENDENCY_TT' => $tt, 'DEPENDENCY_NAME' => $this->user->lang('plug_dep_' . $key . '_short'), 'ICON' => $depdata ? 'eqdkp-icon-online' : 'eqdkp-icon-offline'));
            }
        }
        //Now bring the Extensions from the REPO to template
        if (isset($arrExtensionList[1]) && is_array($arrExtensionList[1])) {
            foreach ($arrExtensionList[1] as $id => $extension) {
                if ($this->pm->search($extension['plugin']) || $extension['plugin'] == 'pluskernel') {
                    continue;
                }
                $row = 'grey_repo';
                $dep['plusv'] = version_compare($extension['dep_coreversion'], $this->config->get('plus_version'), '<=');
                $dep['games'] = 'skip';
                $dep['phpf'] = 'skip';
                $dl_link = '<a href="javascript:repo_install(' . $extension['plugin_id'] . ', 1, \'' . sanitize($extension['plugin']) . '\');" ><i class="fa fa-toggle-off fa-lg" title="' . $this->user->lang('install') . '"></i></a>';
                $link = $dep['plusv'] ? $dl_link : '';
                $this->tpl->assign_block_vars('plugins_row_' . $row, array('NAME' => '<a href="javascript:repoinfo(' . $id . ')">' . $extension['name'] . '</a>', 'VERSION' => sanitize($extension['version']), 'CODE' => sanitize($extension['plugin']), 'CONTACT' => sanitize($extension['author']), 'DESCRIPTION' => sanitize($extension['description']), 'ACTION_LINK' => $link, 'BUGTRACKER_URL' => sanitize($extension['bugtracker_url'])));
                foreach ($dep as $key => $depdata) {
                    $tt = $this->user->lang('plug_dep_' . $key);
                    $this->tpl->assign_block_vars('plugins_row_' . $row . '.dep_row', array('DEPENDENCY_TT' => $tt, 'DEPENDENCY_NAME' => $this->user->lang('plug_dep_' . $key . '_short'), 'ICON' => $depdata ? 'eqdkp-icon-online' : 'eqdkp-icon-offline'));
                }
            }
        }
        $badge = '';
        if ($arrUpdateCount[1]['red']) {
            $badge = '<span class="update_available">' . (int) $arrUpdateCount[1]['red'] . '</span>';
        } elseif ($arrUpdateCount[1]['yellow']) {
            $badge = '<span class="update_available_yellow">' . (int) $arrUpdateCount[1]['yellow'] . '</span>';
        }
        $this->tpl->assign_vars(array('DEP_COUNT' => 3, 'BADGE_1' => $badge));
        //=================================================================
        //Templates
        $default_style = $this->config->get('default_style');
        $arrTemplates = $this->pdh->get('styles', 'styles');
        $arrLocalStyleUpdates = $this->objStyles->getLocalStyleUpdates();
        $arrUninstalledStyles = $this->objStyles->getUninstalledStyles();
        $arrStyles = array();
        foreach ($arrUninstalledStyles as $key => $install_xml) {
            $plugin_code = $key;
            if (isset($allUpdates[$plugin_code])) {
                $row = 'yellow';
                $link = '<a href="javascript:repo_update(' . $allUpdates[$plugin_code]['plugin_id'] . ',2, \'' . $plugin_code . '\');" class="needs_update" data-id="' . $allUpdates[$plugin_code]['plugin_id'] . '" data-category="2" data-code="' . $plugin_code . '" title="' . $this->user->lang('uc_bttn_update') . '"><i class="fa fa-lg fa-refresh"></i></a>';
                $link .= '&nbsp;&nbsp;&nbsp;<a href="manage_extensions.php' . $this->SID . '&amp;cat=2&amp;mode=remove&amp;code=' . $plugin_code . '&amp;link_hash=' . $this->CSRFGetToken('mode') . '" title="' . $this->user->lang('delete') . '"><i class="fa fa-lg fa-trash-o"></i></a>';
                $arrUpdateCount[2]['yellow']++;
            } else {
                $row = 'grey';
                $link = '<a href="manage_extensions.php' . $this->SID . '&amp;cat=2&amp;mode=install&amp;code=' . $key . '&amp;link_hash=' . $this->CSRFGetToken('mode') . '" title="' . $this->user->lang('install') . '"><i class="fa fa-lg fa-toggle-off"></i></a>';
                $link .= '&nbsp;&nbsp;&nbsp;<a href="manage_extensions.php' . $this->SID . '&amp;cat=2&amp;mode=remove&amp;code=' . $plugin_code . '&amp;link_hash=' . $this->CSRFGetToken('mode') . '" title="' . $this->user->lang('delete') . '"><i class="fa fa-lg fa-trash-o"></i></a>';
            }
            $screenshot = '';
            if (file_exists($this->root_path . 'templates/' . $plugin_code . '/screenshot.png')) {
                $screenshot = '<img src="' . $this->root_path . 'templates/' . $plugin_code . '/screenshot.png" style="max-width:300px;" alt="" />';
            } elseif (file_exists($this->root_path . 'templates/' . $plugin_code . '/screenshot.jpg')) {
                $screenshot = '<img src="' . $this->root_path . 'templates/' . $plugin_code . '/screenshot.jpg" style="max-width:300px;" alt="" />';
            }
            $this->tpl->assign_block_vars('styles_row_' . $row, array('TT_CONTENT' => $screenshot, 'TT_NAME' => $install_xml->name ? $install_xml->name : stripslashes($key), 'VERSION' => $install_xml->version, 'AUTHOR' => $install_xml->authorEmail != "" ? '<a href="mailto:' . $install_xml->authorEmail . '">' . $install_xml->author . '</a>' : $install_xml->author, 'ACTION_LINK' => $link, 'TEMPLATE' => $key));
            $arrStyles[] = $install_xml->folder ? $install_xml->folder : stripslashes($key);
        }
        foreach ($arrTemplates as $row) {
            $screenshot = '';
            if (file_exists($this->root_path . 'templates/' . $row['template_path'] . '/screenshot.png')) {
                $screenshot = '<img src="' . $this->root_path . 'templates/' . $row['template_path'] . '/screenshot.png" style="max-width:300px;" alt="" />';
            } elseif (file_exists($this->root_path . 'templates/' . $row['template_path'] . '/screenshot.jpg')) {
                $screenshot = '<img src="' . $this->root_path . 'templates/' . $row['template_path'] . '/screenshot.jpg" style="max-width:300px;" alt="" />';
            }
            $plugin_code = $row['template_path'];
            if (isset($urgendUpdates[$plugin_code])) {
                if (isset($arrLocalStyleUpdates[$plugin_code])) {
                    $rowname = 'red_local';
                    $link = '<a href="manage_extensions.php' . $this->SID . '&amp;cat=2&amp;mode=update&amp;code=' . $row['style_id'] . '&amp;link_hash=' . $this->CSRFGetToken('mode') . '" title="' . $this->user->lang('uc_bttn_update') . '"><i class="fa fa-lg fa-refresh"></i></a>';
                } else {
                    $rowname = 'red';
                    $link = '<a href="javascript:repo_update(' . $urgendUpdates[$plugin_code]['plugin_id'] . ', 2, \'' . $plugin_code . '\');" class="needs_update" data-id="' . $urgendUpdates[$plugin_code]['plugin_id'] . '" data-category="2" data-code="' . $plugin_code . '" title="' . $this->user->lang('uc_bttn_update') . '"><i class="fa fa-lg fa-refresh"></i></a>';
                }
                $arrUpdateCount[2]['red']++;
            } elseif (isset($allUpdates[$plugin_code])) {
                $rowname = 'yellow';
                $link = '<a href="javascript:repo_update(' . $allUpdates[$plugin_code]['plugin_id'] . ', 2, \'' . $plugin_code . '\');" class="needs_update" data-id="' . $allUpdates[$plugin_code]['plugin_id'] . '" data-category="2" data-code="' . $plugin_code . '" title="' . $this->user->lang('uc_bttn_update') . '"><i class="fa fa-lg fa-refresh"></i></a>';
                $arrUpdateCount[2]['yellow']++;
            } else {
                $rowname = 'green';
                $link = $row['style_id'] == $default_style ? '' : '<a href="javascript:style_delete_warning(' . $row['style_id'] . ');" title="' . $this->user->lang('uninstall') . '"><i class="fa fa-lg fa-toggle-on"></i></a>';
            }
            $this->jquery->Dialog('style_preview', $this->user->lang('template_preview'), array('url' => $this->server_path . "" . $this->SID . "&style='+ styleid+'", 'width' => '750', 'height' => '520', 'modal' => true, 'withid' => 'styleid'));
            $this->tpl->assign_block_vars('styles_row_' . $rowname, array('ID' => $row['style_id'], 'U_EDIT_STYLE' => 'manage_styles.php' . $this->SID . '&amp;edit=true&amp;styleid=' . $row['style_id'], 'U_DOWNLOAD_STYLE' => 'manage_extensions.php' . $this->SID . '&amp;cat=2&amp;mode=export&amp;code=' . $row['style_id'] . '&amp;link_hash=' . $this->CSRFGetToken('mode'), 'L_ENABLE' => $row['enabled'] == '1' ? $this->user->lang('deactivate') : $this->user->lang('activate'), 'ENABLE' => $row['enabled'] == '1' ? 'fa fa-check-square-o fa-lg icon-color-green' : 'fa fa-square-o fa-lg icon-color-red', 'U_ENABLE' => $row['enabled'] == '1' ? 'manage_extensions.php' . $this->SID . '&amp;cat=2&amp;mode=disable&amp;code=' . $row['style_id'] . '&amp;link_hash=' . $this->CSRFGetToken('mode') : 'manage_extensions.php' . $this->SID . '&amp;mode=enable&amp;cat=2&amp;code=' . $row['style_id'] . '&amp;link_hash=' . $this->CSRFGetToken('mode'), 'S_DEFAULT' => $row['style_id'] == $default_style ? true : false, 'S_DEACTIVATED' => $row['enabled'] != '1' ? true : false, 'STANDARD' => $row['style_id'] == $default_style ? 'checked="checked"' : '', 'VERSION' => $row['style_version'], 'AUTHOR' => $row['style_contact'] != "" ? '<a href="mailto:' . $row['style_contact'] . '">' . $row['style_author'] . '</a>' : $row['style_author'], 'TT_CONTENT' => $screenshot, 'TT_NAME' => isset($arrExtensionListNamed[2][$plugin_code]) ? '<a href="javascript:repoinfo(' . $arrExtensionListNamed[2][$plugin_code] . ')">' . $row['style_name'] . '</a>' : $row['style_name'], 'TEMPLATE' => $row['template_path'], 'USERS' => $row['users'], 'ACTION_LINK' => $link, 'BUGTRACKER_URL' => isset($arrExtensionListNamed[2][$plugin_code]) ? sanitize($this->pdh->get('repository', 'bugtracker_url', array(2, $arrExtensionListNamed[2][$plugin_code]))) : ''));
            $arrStyles[] = $plugin_code;
        }
        //Now bring the Extensions from the REPO to template
        if (isset($arrExtensionList[2]) && is_array($arrExtensionList[2])) {
            foreach ($arrExtensionList[2] as $id => $extension) {
                if (in_array($extension['plugin'], $arrStyles)) {
                    continue;
                }
                $row = 'grey';
                $link = '<a href="javascript:repo_install(' . $extension['plugin_id'] . ',2, \'' . sanitize($extension['plugin']) . '\');" ><i class="fa fa-toggle-off fa-lg" title="' . $this->user->lang('install') . '"></i></a>';
                $this->tpl->assign_block_vars('styles_row_' . $row, array('TT_NAME' => '<a href="javascript:repoinfo(' . $id . ')">' . $extension['name'] . '</a>', 'VERSION' => sanitize($extension['version']), 'CODE' => sanitize($extension['plugin']), 'AUTHOR' => sanitize($extension['author']), 'TEMPLATE' => sanitize($extension['plugin']), 'DESCRIPTION' => sanitize($extension['description']), 'ACTION_LINK' => $link, 'BUGTRACKER_URL' => sanitize($extension['bugtracker_url']), 'TT_CONTENT' => '<img src="http://cdn1.eqdkp-plus.eu/repository/screenshot.php?extid=' . $extension['plugin_id'] . '" style="max-width:300px;" alt="No Preview available" />'));
            }
        }
        $this->jquery->dialog('style_default_info', $this->user->lang('default_style'), array('message' => $this->user->lang('style_default_info') . '<br /><br /><label><input type="radio" name="override" value="0" onchange="change_override(1);">' . $this->user->lang('yes') . '</label>  <label><input type="radio" name="override" value="1" checked="checked" onchange="change_override(0);">' . $this->user->lang('no') . '</label>', 'custom_js' => 'submit_form();', 'height' => 200), 'confirm');
        $this->jquery->dialog('style_reset_warning', $this->user->lang('reset_style'), array('message' => $this->user->lang('style_confirm_reset'), 'height' => 200, 'url' => $this->root_path . 'admin/manage_extensions.php' . $this->SID . '&link_hash=' . $this->CSRFGetToken('mode') . "&cat=2&mode=reset&code='+ styleid+'", 'withid' => 'styleid'), 'confirm');
        $this->jquery->dialog('style_delete_warning', $this->user->lang('delete_style'), array('message' => $this->user->lang('confirm_delete_style'), 'height' => 200, 'url' => $this->root_path . 'admin/manage_extensions.php' . $this->SID . '&link_hash=' . $this->CSRFGetToken('mode') . "&cat=2&mode=uninstall&code='+ styleid+'", 'withid' => 'styleid'), 'confirm');
        $badge = '';
        if ($arrUpdateCount[2]['red']) {
            $badge = '<span class="update_available">' . (int) $arrUpdateCount[2]['red'] . '</span>';
        } elseif ($arrUpdateCount[2]['yellow']) {
            $badge = '<span class="update_available_yellow">' . (int) $arrUpdateCount[2]['yellow'] . '</span>';
        }
        $this->tpl->assign_vars(array('BADGE_2' => $badge));
        //=================================================================
        //Portal Modules
        $arrTmpModules = array();
        if (isset($arrExtensionList[3]) && is_array($arrExtensionList[3])) {
            foreach ($arrExtensionList[3] as $id => $extension) {
                $arrTmpModules[$extension['plugin']] = $extension;
            }
        }
        $arrModules = $this->pdh->aget('portal', 'portal', 0, array($this->pdh->get('portal', 'id_list')));
        if (is_array($arrModules)) {
            foreach ($arrModules as $id => $value) {
                if ((int) $value['child'] === 1) {
                    continue;
                }
                $row = 'green';
                $link = '';
                $plugin_code = $value['path'];
                $class_name = $plugin_code . '_portal';
                $del_link = "";
                //Ignore Plugin Moduls in terms of repo-updates
                if (empty($value['plugin'])) {
                    if (isset($urgendUpdates[$plugin_code])) {
                        $row = 'red';
                        $link = '<a href="javascript:repo_update(' . $urgendUpdates[$plugin_code]['plugin_id'] . ',3, \'' . $plugin_code . '\');" class="needs_update" data-id="' . $urgendUpdates[$plugin_code]['plugin_id'] . '" data-category="3" data-code="' . $plugin_code . '" title="' . $this->user->lang('uc_bttn_update') . '"><i class="fa fa-refresh fa-lg"></i></a>';
                        $arrUpdateCount[3]['red']++;
                    } elseif (isset($allUpdates[$plugin_code])) {
                        $row = 'yellow';
                        $link = '<a href="javascript:repo_update(' . $allUpdates[$plugin_code]['plugin_id'] . ',3, \'' . $plugin_code . '\');" class="needs_update" data-id="' . $allUpdates[$plugin_code]['plugin_id'] . '" data-category="3" data-code="' . $plugin_code . '"  title="' . $this->user->lang('uc_bttn_update') . '"><i class="fa fa-refresh fa-lg"></i></a>';
                        $arrUpdateCount[3]['yellow']++;
                    }
                    $del_link = '<a href="manage_extensions.php' . $this->SID . '&amp;cat=3&amp;mode=remove&amp;code=' . $plugin_code . '&amp;link_hash=' . $this->CSRFGetToken('mode') . '" title="' . $this->user->lang('delete') . '"><i class="fa fa-lg fa-trash-o"></i></a>';
                }
                //Add Reinstall Link if no update available
                $reinst_link = '<i class="fa fa-retweet fa-lg" title="' . $this->user->lang('reinstall') . '" onclick="javascript:reinstall_portal(\'' . $plugin_code . '\')" style="cursor:pointer;"></i>';
                $this->tpl->assign_block_vars('pm_row_' . $row, array('NAME' => isset($arrExtensionListNamed[3][$value['path']]) ? '<a href="javascript:repoinfo(' . $arrExtensionListNamed[3][$value['path']] . ')">' . $value['name'] . '</a>' : $value['name'], 'VERSION' => sanitize($value['version']), 'CODE' => sanitize($value['path']), 'CONTACT' => sanitize($class_name::get_data('contact')), 'ACTION_LINK' => $link, 'REINSTALL_LINK' => $row == 'green' ? $reinst_link : '', 'DELETE_LINK' => $del_link, 'DESCRIPTION' => isset($arrTmpModules[$value['path']]) ? '<a href="javascript:repoinfo(' . $arrExtensionListNamed[3][$value['path']] . ')">' . sanitize(cut_text($arrTmpModules[$value['path']]['description'], 100)) . '</a>' : '', 'BUGTRACKER_URL' => isset($arrExtensionListNamed[3][$plugin_code]) ? sanitize($this->pdh->get('repository', 'bugtracker_url', array(3, $arrExtensionListNamed[3][$plugin_code]))) : ''));
            }
            $this->confirm_delete($this->user->lang('portal_reinstall_warn'), 'manage_extensions.php' . $this->SID . '&cat=3', true, array('function' => 'reinstall_portal', 'handler' => 'mode'));
        }
        //Now bring the Extensions from the REPO to template
        if (isset($arrExtensionList[3]) && is_array($arrExtensionList[3])) {
            foreach ($arrExtensionList[3] as $id => $extension) {
                if (is_array(search_in_array($extension['plugin'], $arrModules, true, 'path'))) {
                    continue;
                }
                $row = 'grey';
                $link = '<a href="javascript:repo_install(' . $extension['plugin_id'] . ',3, \'' . sanitize($extension['plugin']) . '\');" title="' . $this->user->lang('install') . '"><i class="fa fa-toggle-off fa-lg"></i></a>';
                $this->tpl->assign_block_vars('pm_row_' . $row, array('NAME' => '<a href="javascript:repoinfo(' . $id . ')">' . $extension['name'] . '</a>', 'VERSION' => sanitize($extension['version']), 'CODE' => sanitize($extension['plugin']), 'CONTACT' => sanitize($extension['author']), 'DESCRIPTION' => '<a href="javascript:repoinfo(' . $id . ')">' . sanitize(cut_text($extension['description'])) . '</a>', 'ACTION_LINK' => $link, 'RATING' => $this->jquery->starrating('extension_' . md5($extension['plugin']), $this->env->phpself, array('score' => $extension['rating'], 'readonly' => true)), 'BUGTRACKER_URL' => sanitize($extension['bugtracker_url'])));
            }
        }
        $badge = '';
        if ($arrUpdateCount[3]['red']) {
            $badge = '<span class="update_available">' . (int) $arrUpdateCount[3]['red'] . '</span>';
        } elseif ($arrUpdateCount[3]['yellow']) {
            $badge = '<span class="update_available_yellow">' . (int) $arrUpdateCount[3]['yellow'] . '</span>';
        }
        $this->tpl->assign_vars(array('BADGE_3' => $badge));
        //=================================================================
        //Games
        $arrGames = $this->game->get_games();
        $arrGameVersions = $this->game->get_versions();
        $arrGameAuthors = $this->game->get_authors();
        $arrTmpExtension = array();
        if (isset($arrExtensionList[7]) && is_array($arrExtensionList[7])) {
            foreach ($arrExtensionList[7] as $id => $extension) {
                $arrTmpExtension[$extension['plugin']] = $extension;
            }
        }
        if (is_array($arrGames)) {
            foreach ($arrGames as $id => $value) {
                $plugin_code = $value;
                if (isset($urgendUpdates[$plugin_code])) {
                    $row = 'red';
                    $link = '<a href="javascript:repo_update(' . $urgendUpdates[$plugin_code]['plugin_id'] . ',7, \'' . $plugin_code . '\');" class="needs_update" data-id="' . $urgendUpdates[$plugin_code]['plugin_id'] . '" data-category="7" data-code="' . $plugin_code . '" title="' . $this->user->lang('uc_bttn_update') . '"><i class="fa fa-refresh fa-lg"></i></a>';
                    $arrUpdateCount[7]['red']++;
                } elseif (isset($allUpdates[$plugin_code])) {
                    $row = 'yellow';
                    $link = '<a href="javascript:repo_update(' . $allUpdates[$plugin_code]['plugin_id'] . ',7, \'' . $plugin_code . '\');" class="needs_update" data-id="' . $allUpdates[$plugin_code]['plugin_id'] . '" data-category="7" data-code="' . $plugin_code . '" title="' . $this->user->lang('uc_bttn_update') . '"><i class="fa fa-refresh fa-lg" ></i></a>';
                    $arrUpdateCount[7]['yellow']++;
                } else {
                    $row = 'green';
                    $link = '';
                }
                $this->tpl->assign_block_vars('games_row_' . $row, array('NAME' => isset($arrExtensionListNamed[7][$plugin_code]) ? '<a href="javascript:repoinfo(' . $arrExtensionListNamed[7][$plugin_code] . ')">' . $this->game->game_name($plugin_code) . '</a>' : $this->game->game_name($plugin_code), 'VERSION' => $arrGameVersions[$plugin_code], 'CODE' => sanitize($plugin_code), 'CONTACT' => isset($arrTmpExtension[$plugin_code]) ? $arrTmpExtension[$plugin_code]['author'] : $arrGameAuthors[$plugin_code], 'DESCRIPTION' => isset($arrTmpExtension[$plugin_code]) ? '<a href="javascript:repoinfo(' . $arrExtensionListNamed[7][$plugin_code] . ')">' . cut_text($arrTmpExtension[$plugin_code]['description'], 100) . '</a>' : '', 'RATING' => isset($arrTmpExtension[$plugin_code]) ? $this->jquery->starrating('extension_' . md5($arrTmpExtension[$plugin_code]['plugin']), $this->env->phpself, array('score' => $arrTmpExtension[$plugin_code]['rating'], 'readonly' => true)) : '', 'ACTION_LINK' => $link, 'DELETE_LINK' => $plugin_code != $this->config->get('default_game') ? '<a href="manage_extensions.php' . $this->SID . '&amp;cat=7&amp;mode=remove&amp;code=' . $plugin_code . '&amp;link_hash=' . $this->CSRFGetToken('mode') . '" title="' . $this->user->lang('delete') . '"><i class="fa fa-lg fa-trash-o"></i></a>' : '', 'BUGTRACKER_URL' => isset($arrExtensionListNamed[7][$plugin_code]) ? sanitize($this->pdh->get('repository', 'bugtracker_url', array(7, $arrExtensionListNamed[7][$plugin_code]))) : ''));
            }
        }
        //Now bring the Extensions from the REPO to template
        if (isset($arrExtensionList[7]) && is_array($arrExtensionList[7])) {
            foreach ($arrExtensionList[7] as $id => $extension) {
                if (in_array($extension['plugin'], $arrGames)) {
                    continue;
                }
                $row = 'grey';
                $link = '<a href="javascript:repo_install(' . $extension['plugin_id'] . ',7, \'' . sanitize($extension['plugin']) . '\');" title="' . $this->user->lang('install') . '"><i class="fa fa-toggle-off fa-lg"></i></a>';
                $this->tpl->assign_block_vars('games_row_' . $row, array('NAME' => '<a href="javascript:repoinfo(' . $id . ')">' . $extension['name'] . '</a>', 'VERSION' => sanitize($extension['version']), 'CODE' => sanitize($extension['plugin']), 'CONTACT' => sanitize($extension['author']), 'DESCRIPTION' => sanitize(cut_text($extension['description'], 100)), 'ACTION_LINK' => $link, 'RATING' => $this->jquery->starrating('extension_' . md5($extension['plugin']), $this->env->phpself, array('score' => $extension['rating'], 'readonly' => true)), 'BUGTRACKER_URL' => sanitize($extension['bugtracker_url'])));
            }
        }
        $badge = '';
        if ($arrUpdateCount[7]['red']) {
            $badge = '<span class="update_available">' . (int) $arrUpdateCount[7]['red'] . '</span>';
        } elseif ($arrUpdateCount[7]['yellow']) {
            $badge = '<span class="update_available_yellow">' . (int) $arrUpdateCount[7]['yellow'] . '</span>';
        }
        $this->tpl->assign_vars(array('BADGE_7' => $badge));
        //=================================================================
        //Languages
        $arrLanguages = $arrLanguageVersions = array();
        // Build language array
        if ($dir = @opendir($this->core->root_path . 'language/')) {
            while ($file = @readdir($dir)) {
                if (!is_file($this->root_path . 'language/' . $file) && !is_link($this->root_path . 'language/' . $file) && valid_folder($file)) {
                    include $this->root_path . 'language/' . $file . '/lang_main.php';
                    $lang_name_tp = $lang['ISO_LANG_NAME'] ? $lang['ISO_LANG_NAME'] . ' (' . $lang['ISO_LANG_SHORT'] . ')' : ucfirst($file);
                    $arrLanguages[$file] = $lang_name_tp;
                    $arrLanguageVersions[$file] = $lang['LANG_VERSION'];
                }
            }
        }
        if (is_array($arrLanguages)) {
            foreach ($arrLanguages as $id => $value) {
                $plugin_code = $id;
                if (isset($urgendUpdates[$plugin_code])) {
                    $row = 'red';
                    $link = '<a href="javascript:repo_update(' . $urgendUpdates[$plugin_code]['plugin_id'] . ',11, \'' . $plugin_code . '\');" class="needs_update" data-id="' . $urgendUpdates[$plugin_code]['plugin_id'] . '" data-category="11" data-code="' . $plugin_code . '" title="' . $this->user->lang('uc_bttn_update') . '"><i class="fa fa-refresh fa-lg"></i></a>';
                    $arrUpdateCount[11]['red']++;
                } elseif (isset($allUpdates[$plugin_code])) {
                    $row = 'yellow';
                    $link = '<a href="javascript:repo_update(' . $allUpdates[$plugin_code]['plugin_id'] . ',11, \'' . $plugin_code . '\');" class="needs_update" data-id="' . $allUpdates[$plugin_code]['plugin_id'] . '" data-category="11" data-code="' . $plugin_code . '"  title="' . $this->user->lang('uc_bttn_update') . '"><i class="fa fa-refresh fa-lg"></i></a>';
                    $arrUpdateCount[11]['yellow']++;
                } else {
                    $row = 'green';
                    $link = '';
                }
                $this->tpl->assign_block_vars('language_row_' . $row, array('NAME' => isset($arrExtensionListNamed[11][$plugin_code]) ? '<a href="javascript:repoinfo(' . $arrExtensionListNamed[11][$plugin_code] . ')">' . $value . '</a>' : $value, 'VERSION' => $arrLanguageVersions[$plugin_code], 'ACTION_LINK' => $link, 'BUGTRACKER_URL' => isset($arrExtensionListNamed[11][$plugin_code]) ? sanitize($this->pdh->get('repository', 'bugtracker_url', array(11, $arrExtensionListNamed[11][$plugin_code]))) : ''));
            }
        }
        //Now bring the Extensions from the REPO to template
        if (isset($arrExtensionList[11]) && is_array($arrExtensionList[11])) {
            foreach ($arrExtensionList[11] as $id => $extension) {
                if (isset($arrLanguages[$extension['plugin']])) {
                    continue;
                }
                $row = 'grey';
                $link = '<a href="javascript:repo_install(' . $extension['plugin_id'] . ', 11, \'' . sanitize($extension['plugin']) . '\');" title="' . $this->user->lang('install') . '"><i class="fa fa-toggle-off fa-lg"></i></a>';
                $this->tpl->assign_block_vars('language_row_' . $row, array('NAME' => '<a href="javascript:repoinfo(' . $id . ')">' . $extension['name'] . '</a>', 'VERSION' => sanitize($extension['version']), 'ACTION_LINK' => $link, 'BUGTRACKER_URL' => sanitize($extension['bugtracker_url'])));
            }
        }
        $badge = '';
        if ($arrUpdateCount[11]['red']) {
            $badge = '<span class="update_available">' . (int) $arrUpdateCount[11]['red'] . '</span>';
        } elseif ($arrUpdateCount[11]['yellow']) {
            $badge = '<span class="update_available_yellow">' . (int) $arrUpdateCount[11]['yellow'] . '</span>';
        }
        $this->tpl->assign_vars(array('BADGE_11' => $badge));
        //=================================================================
        //Common Output
        //Tabs
        $this->jquery->Tab_header('plus_plugins_tab', true);
        if ($this->in->exists('tab')) {
            $this->jquery->Tab_Select('plus_plugins_tab', $this->in->get('tab', 0));
        }
        $this->jquery->Dialog('update_confirm', '', array('custom_js' => 'repo_update_start(extid, cat, extensioncode);', 'message' => $this->user->lang('repo_updatewarning') . '<br /><br /><input type="checkbox" onclick="hide_update_warning(this.checked);" value="1" />' . $this->user->lang('repo_hide_updatewarning'), 'withid' => 'extid, cat, extensioncode', 'width' => 300, 'height' => 300), 'confirm');
        $this->jquery->Dialog('repoinfo', $this->user->lang('repo_extensioninfo'), array('url' => $this->root_path . "admin/manage_extensions.php" . $this->SID . "&info='+moduleid+'", 'width' => '700', 'height' => '600', 'withid' => 'moduleid'));
        foreach ($this->repo->DisplayCategories() as $key => $category) {
            $this->tpl->assign_vars(array('L_CATEGORY_' . $key => $category));
        }
        $this->tpl->assign_vars(array('S_HIDE_UPDATEWARNING' => (int) $this->config->get('repo_hideupdatewarning'), 'CSRF_MODE_TOKEN' => $this->CSRFGetToken('mode'), 'CSRF_UPDATEWARNING_TOKEN' => $this->CSRFGetToken('hide_update_warning'), 'AUTOUPD_ON' => $this->in->get('autoupd', 0) ? true : false, 'AUTOUPD_CURRENT' => $this->in->get('current', 0), 'AUTOUPD_TRY' => $this->in->get('try', 0)));
        $this->tpl->add_css('
			.ui-progressbar { position:relative; height:30px;}
			.nl_progressbar_label { position: absolute; width: 90%; text-align: center; line-height: 30px; left:5%; right:5%;}
		');
        $this->core->set_vars(array('page_title' => $this->user->lang('extensions'), 'template_file' => 'admin/manage_extensions.html', 'display' => true));
    }
Esempio n. 18
0
 public function getNotificationMethodsUserSettings($blnAllMethods = false)
 {
     include_once $this->root_path . 'core/notifications/generic_notification.class.php';
     $types = array();
     // Build auth array
     if ($dir = @opendir($this->root_path . 'core/notifications/')) {
         while ($file = @readdir($dir)) {
             if (is_file($this->root_path . 'core/notifications/' . $file) && valid_folder($file)) {
                 if ($file == 'generic_notification.class.php') {
                     continue;
                 }
                 include_once $this->root_path . 'core/notifications/' . $file;
                 $name = substr($file, 0, strpos($file, '.'));
                 $classname = $name . '_notification';
                 $objNotificationMethod = register($classname);
                 $blnIsAvailable = $objNotificationMethod->isAvailable();
                 if (!$blnIsAvailable && !$blnAllMethods) {
                     continue;
                 }
                 $arrUserSettings = $objNotificationMethod->getUserSettings();
                 if (count($arrUserSettings)) {
                     $types = array_merge($types, $arrUserSettings);
                 }
             }
         }
     }
     return $types;
 }
Esempio n. 19
0
    public function display()
    {
        //Get Extensions
        $arrExtensionList = $this->repo->getExtensionList();
        $arrExtensionListNamed = array();
        if (is_array($arrExtensionList)) {
            foreach ($arrExtensionList as $catid => $extensions) {
                if (is_array($extensions)) {
                    foreach ($extensions as $id => $ext) {
                        if (!isset($arrExtensionListNamed[$catid])) {
                            $arrExtensionListNamed[$catid] = array();
                        }
                        $arrExtensionListNamed[$catid][$ext['plugin']] = $id;
                    }
                }
            }
        }
        //Get Updates
        $urgendUpdates = $this->repo->BuildUpdateArray();
        $allUpdates = $this->repo->BuildUpdateArray(false);
        $arrUpdateCount = array(1 => array('red' => 0, 'yellow' => 0), 2 => array('red' => 0, 'yellow' => 0), 3 => array('red' => 0, 'yellow' => 0), 4 => array('red' => 0, 'yellow' => 0), 7 => array('red' => 0, 'yellow' => 0));
        //=================================================================
        //Plugins
        $this->pm->search();
        //search for new plugins
        $plugins_array = $this->pm->get_plugins(PLUGIN_ALL);
        //maybe plugins want to auto-install portalmodules
        $this->portal->get_all_modules();
        $plugin_count = count($plugins_array);
        $db_plugins = $this->pdh->get('plugins', 'id_list');
        foreach ($plugins_array as $plugin_code) {
            if ($plugin_code == 'pluskernel') {
                continue;
            }
            $contact = $this->pm->get_data($plugin_code, 'contact');
            $version = $this->pm->get_data($plugin_code, 'version');
            $description = $this->pm->get_data($plugin_code, 'description');
            $long_description = $this->pm->get_data($plugin_code, 'long_description');
            $manuallink = $this->pm->get_data($plugin_code, 'manuallink');
            $homepagelink = $this->pm->get_data($plugin_code, 'homepage');
            $author = $this->pm->get_data($plugin_code, 'author');
            if ($this->pm->check($plugin_code, PLUGIN_BROKEN)) {
                $this->tpl->assign_block_vars('plugins_row_broken', array('NAME' => $plugin_code, 'CODE' => $plugin_code, 'DELETE' => in_array($plugin_code, $db_plugins) ? true : false, 'DEL_LINK' => 'manage_extensions.php' . $this->SID . '&amp;cat=1&amp;mode=delete&amp;code=' . $plugin_code . '&amp;link_hash=' . $this->CSRFGetToken('mode')));
                continue;
            }
            //dependencies
            $dep['plusv'] = $this->pm->check_dependency($plugin_code, 'plus_version');
            $dep['games'] = $this->pm->check_dependency($plugin_code, 'games');
            $dep['phpf'] = $this->pm->check_dependency($plugin_code, 'php_functions');
            //show missing functions
            $deptt['phpf'] = $this->user->lang('plug_dep_phpf');
            $needed_functions = $this->pm->get_plugin($plugin_code)->get_dependency('php_functions');
            if (is_array($needed_functions) && count($needed_functions) > 0) {
                $deptt['phpf'] .= ':<br />';
                foreach ($needed_functions as $function) {
                    $deptt['phpf'] .= function_exists($function) ? '<span class="positive">' . $function . '</span><br />' : '<span class="negative">' . $function . '</span><br />';
                }
            }
            $dep_all = $dep['plusv'] && $dep['games'] && $dep['phpf'];
            if ($this->pm->check($plugin_code, PLUGIN_DISABLED)) {
                $link = $dep_all ? '<a href="manage_extensions.php' . $this->SID . '&amp;cat=1&amp;mode=enable&amp;code=' . $plugin_code . '&amp;link_hash=' . $this->CSRFGetToken('mode') . '" title="' . $this->user->lang('plug_enable_info') . '">' . $this->user->lang('enable') . '</a>' : $this->user->lang('plug_dep_broken_deps');
                $row = 'yellow';
            } elseif ($this->pm->check($plugin_code, PLUGIN_INSTALLED)) {
                if (isset($urgendUpdates[$plugin_code])) {
                    $row = 'red';
                    $link = '<a href="javascript:repo_update(1, \'' . $plugin_code . '\');">' . $this->user->lang('uc_bttn_update') . '</a>';
                    $arrUpdateCount[1]['red']++;
                } else {
                    $row = 'green';
                    $link = $dep_all ? '<a href="manage_extensions.php' . $this->SID . '&amp;cat=1&amp;mode=uninstall&amp;code=' . $plugin_code . '&amp;link_hash=' . $this->CSRFGetToken('mode') . '">' . $this->user->lang('uninstall') . '</a>' : $this->user->lang('plug_dep_broken_deps');
                }
            } elseif (isset($allUpdates[$plugin_code])) {
                $row = 'yellow';
                $link = '<a href="javascript:repo_update(1, \'' . $plugin_code . '\');">' . $this->user->lang('uc_bttn_update') . '</a>';
                $arrUpdateCount[1]['yellow']++;
            } else {
                $row = 'grey';
                $link = $dep_all ? '<a href="manage_extensions.php' . $this->SID . '&amp;cat=1&amp;mode=install&amp;code=' . $plugin_code . '&amp;link_hash=' . $this->CSRFGetToken('mode') . '">' . $this->user->lang('install') . '</a>' : $this->user->lang('plug_dep_broken_deps');
            }
            $this->tpl->assign_block_vars('plugins_row_' . $row, array('NAME' => isset($arrExtensionListNamed[1][$plugin_code]) ? '<a href="javascript:repoinfo(' . $arrExtensionListNamed[1][$plugin_code] . ')">' . $this->pm->get_data($plugin_code, 'name') . '</a>' : $this->pm->get_data($plugin_code, 'name'), 'VERSION' => !empty($version) ? $version : '&nbsp;', 'CODE' => $plugin_code, 'CONTACT' => !empty($contact) ? !empty($author) ? '<a href="mailto:' . $contact . '">' . $author . '</a>' : '<a href="mailto:' . $contact . '">' . $contact . '</a>' : $author, 'DESCRIPTION' => !empty($description) ? $description : '&nbsp;', 'LONG_DESCRIPTION' => $this->html->ToolTip($long_description, $this->html->toggleIcons($long_description, 'help.png', 'help_off.png', 'images/glyphs/', $this->user->lang('description'), false, false)), 'HOMEPAGE' => $this->html->ToolTip($this->user->lang('homepage'), $this->html->toggleIcons($homepagelink, 'browser.png', 'browser_off.png', 'images/glyphs/', $this->user->lang('homepage'), $homepagelink, false)), 'MANUAL' => $this->html->ToolTip($this->user->lang('manual'), $this->html->toggleIcons($manuallink, 'acroread.png', 'acroread_off.png', 'images/glyphs/', $this->user->lang('manual'), $manuallink, false)), 'ACTION_LINK' => $link));
            foreach ($dep as $key => $depdata) {
                $tt = isset($deptt[$key]) ? $deptt[$key] : $this->user->lang('plug_dep_' . $key);
                $this->tpl->assign_block_vars('plugins_row_' . $row . '.dep_row', array('DEPENDENCY_STATUS' => $this->html->ToolTip($tt, $this->html->toggleIcons($depdata, 'status_green.gif', 'status_red.gif', 'images/glyphs/') . ' ' . $this->user->lang('plug_dep_' . $key . '_short'))));
            }
        }
        //Now bring the Extensions from the REPO to template
        if (isset($arrExtensionList[1]) && is_array($arrExtensionList[1])) {
            foreach ($arrExtensionList[1] as $id => $extension) {
                if ($this->pm->search($extension['plugin']) || $extension['plugin'] == 'pluskernel') {
                    continue;
                }
                $row = 'grey_repo';
                $dep['plusv'] = version_compare($extension['dep_coreversion'], $this->config->get('plus_version'), '<=');
                $dep['games'] = 'skip';
                $dep['phpf'] = 'skip';
                $dl_link = '<a href="javascript:repo_install(1, \'' . sanitize($extension['plugin']) . '\');" >' . $this->user->lang('backup_action_download') . '</a>';
                $link = $dep['plusv'] ? $dl_link : '';
                $this->tpl->assign_block_vars('plugins_row_' . $row, array('NAME' => '<a href="javascript:repoinfo(' . $id . ')">' . $extension['name'] . '</a>', 'VERSION' => sanitize($extension['version']), 'CODE' => sanitize($extension['plugin']), 'CONTACT' => sanitize($extension['author']), 'DESCRIPTION' => sanitize($extension['shortdesc']), 'ACTION_LINK' => $link));
                foreach ($dep as $key => $depdata) {
                    $tt = $this->user->lang('plug_dep_' . $key);
                    $this->tpl->assign_block_vars('plugins_row_' . $row . '.dep_row', array('DEPENDENCY_STATUS' => $depdata === 'skip' ? '&nbsp;' : $this->html->ToolTip($tt, $this->html->toggleIcons($depdata, 'status_green.gif', 'status_red.gif', 'images/glyphs/') . ' ' . $this->user->lang('plug_dep_' . $key . '_short'))));
                }
            }
        }
        $badge = '';
        if ($arrUpdateCount[1]['red']) {
            $badge = '<span class="update_available">' . $arrUpdateCount[1]['red'] . '</span>';
        } elseif ($arrUpdateCount[1]['yellow']) {
            $badge = '<span class="update_available_yellow">' . $arrUpdateCount[1]['yellow'] . '</span>';
        }
        $this->tpl->assign_vars(array('DEP_COUNT' => 3, 'BADGE_1' => $badge));
        //=================================================================
        //Templates
        $default_style = $this->config->get('default_style');
        $arrTemplates = $this->pdh->get('styles', 'styles');
        $arrLocalStyleUpdates = $this->objStyles->getLocalStyleUpdates();
        $arrUninstalledStyles = $this->objStyles->getUninstalledStyles();
        $arrStyles = array();
        foreach ($arrUninstalledStyles as $key => $install_xml) {
            $plugin_code = $key;
            if (isset($allUpdates[$plugin_code])) {
                $row = 'yellow';
                $link = '<a href="javascript:repo_update(2, \'' . $plugin_code . '\');">' . $this->user->lang('uc_bttn_update') . '</a>';
                $arrUpdateCount[2]['yellow']++;
            } else {
                $row = 'grey';
                $link = '<a href="manage_extensions.php' . $this->SID . '&amp;cat=2&amp;mode=install&amp;code=' . $key . '&amp;link_hash=' . $this->CSRFGetToken('mode') . '">' . $this->user->lang('install') . '</a>';
            }
            $screenshot = '';
            if (file_exists($this->root_path . 'templates/' . $plugin_code . '/screenshot.png')) {
                $screenshot = '<img src=\'' . $this->root_path . 'templates/' . $plugin_code . '/screenshot.png\' style=\'max-width:300px;\' alt="" />';
            } elseif (file_exists($this->root_path . 'templates/' . $plugin_code . '/screenshot.jpg')) {
                $screenshot = '<img src=\'' . $this->root_path . 'templates/' . $plugin_code . '/screenshot.jpg\' style=\'max-width:300px;\' alt="" />';
            }
            $this->tpl->assign_block_vars('styles_row_' . $row, array('NAME' => $this->html->ToolTip($screenshot, $install_xml->name ? $install_xml->name : stripslashes($key)), 'VERSION' => $install_xml->version, 'AUTHOR' => $install_xml->authorEmail != "" ? '<a href="mailto:' . $install_xml->authorEmail . '">' . $install_xml->author . '</a>' : $install_xml->author, 'ACTION_LINK' => $link, 'TEMPLATE' => $key));
            $arrStyles[] = $install_xml->name ? $install_xml->name : stripslashes($key);
        }
        foreach ($arrTemplates as $row) {
            $screenshot = '';
            if (file_exists($this->root_path . 'templates/' . $row['template_path'] . '/screenshot.png')) {
                $screenshot = '<img src=\'' . $this->root_path . 'templates/' . $row['template_path'] . '/screenshot.png\' style=\'max-width:300px;\' alt="" />';
            } elseif (file_exists($this->root_path . 'templates/' . $row['template_path'] . '/screenshot.jpg')) {
                $screenshot = '<img src=\'' . $this->root_path . 'templates/' . $row['template_path'] . '/screenshot.jpg\' style=\'max-width:300px;\' alt="" />';
            }
            $plugin_code = $row['template_path'];
            if (isset($urgendUpdates[$plugin_code])) {
                if (isset($arrLocalStyleUpdates[$plugin_code])) {
                    $rowname = 'red_local';
                    $link = '<a href="manage_extensions.php' . $this->SID . '&amp;cat=2&amp;mode=update&amp;code=' . $row['style_id'] . '&amp;link_hash=' . $this->CSRFGetToken('mode') . '">' . $this->user->lang('uc_bttn_update') . '</a>';
                } else {
                    $rowname = 'red';
                    $link = '<a href="javascript:repo_update(2, \'' . $plugin_code . '\');">' . $this->user->lang('uc_bttn_update') . '</a>';
                }
                $arrUpdateCount[2]['red']++;
            } elseif (isset($allUpdates[$plugin_code])) {
                $rowname = 'yellow';
                $link = '<a href="javascript:repo_update(2, \'' . $plugin_code . '\');">' . $this->user->lang('uc_bttn_update') . '</a>';
                $arrUpdateCount[2]['yellow']++;
            } else {
                $rowname = 'green';
                $link = $row['style_id'] == $default_style ? '' : '<a href="javascript:style_delete_warning(' . $row['style_id'] . ');">' . $this->user->lang('uninstall') . '</a>';
            }
            $this->jquery->Dialog('style_preview', $this->user->lang('template_preview'), array('url' => $this->root_path . "viewnews.php" . $this->SID . "&style='+ styleid+'", 'width' => '750', 'height' => '520', 'modal' => true, 'withid' => 'styleid'));
            $this->tpl->assign_block_vars('styles_row_' . $rowname, array('ID' => $row['style_id'], 'U_EDIT_STYLE' => 'manage_styles.php' . $this->SID . '&amp;edit=true&amp;styleid=' . $row['style_id'], 'U_DOWNLOAD_STYLE' => 'manage_extensions.php' . $this->SID . '&amp;cat=2&amp;mode=export&amp;code=' . $row['style_id'] . '&amp;link_hash=' . $this->CSRFGetToken('mode'), 'ENABLE_ICON' => $row['enabled'] == '1' ? 'green' : 'red', 'ENABLE_ICON_INFO' => $row['enabled'] == '1' ? $this->user->lang('style_enabled_info') : $this->user->lang('style_disabled_info'), 'L_ENABLE' => $row['enabled'] == '1' ? $this->user->lang('deactivate') : $this->user->lang('activate'), 'ENABLE' => $row['enabled'] == '1' ? 'disable' : 'enable', 'U_ENABLE' => $row['enabled'] == '1' ? 'manage_extensions.php' . $this->SID . '&amp;cat=2&amp;mode=disable&amp;code=' . $row['style_id'] . '&amp;link_hash=' . $this->CSRFGetToken('mode') : 'manage_extensions.php' . $this->SID . '&amp;mode=enable&amp;cat=2&amp;code=' . $row['style_id'] . '&amp;link_hash=' . $this->CSRFGetToken('mode'), 'S_DEFAULT' => $row['style_id'] == $default_style ? true : false, 'S_DEACTIVATED' => $row['enabled'] != '1' ? true : false, 'STANDARD' => $row['style_id'] == $default_style ? 'checked="checked"' : '', 'VERSION' => $row['style_version'], 'AUTHOR' => $row['style_contact'] != "" ? '<a href="mailto:' . $row['style_contact'] . '">' . $row['style_author'] . '</a>' : $row['style_author'], 'NAME' => $this->html->ToolTip($screenshot, isset($arrExtensionListNamed[2][$plugin_code]) ? '<a href="javascript:repoinfo(' . $arrExtensionListNamed[2][$plugin_code] . ')">' . $row['style_name'] . '</a>' : $row['style_name']), 'TEMPLATE' => $row['template_path'], 'USERS' => $row['users'], 'ACTION_LINK' => $link));
            $arrStyles[] = $plugin_code;
        }
        //Now bring the Extensions from the REPO to template
        if (isset($arrExtensionList[2]) && is_array($arrExtensionList[2])) {
            foreach ($arrExtensionList[2] as $id => $extension) {
                if (in_array($extension['plugin'], $arrStyles)) {
                    continue;
                }
                $row = 'grey';
                $link = '<a href="javascript:repo_install(2, \'' . sanitize($extension['plugin']) . '\');" >' . $this->user->lang('backup_action_download') . '</a>';
                $this->tpl->assign_block_vars('styles_row_' . $row, array('NAME' => '<a href="javascript:repoinfo(' . $id . ')">' . $extension['name'] . '</a>', 'VERSION' => sanitize($extension['version']), 'CODE' => sanitize($extension['plugin']), 'AUTHOR' => sanitize($extension['author']), 'TEMPLATE' => sanitize($extension['plugin']), 'DESCRIPTION' => sanitize($extension['shortdesc']), 'ACTION_LINK' => $link));
            }
        }
        $this->jquery->dialog('style_default_info', $this->user->lang('default_style'), array('message' => $this->user->lang('style_default_info') . '<br /><br /><label><input type="radio" name="override" value="0" onchange="change_override(1);">' . $this->user->lang('yes') . '</label>  <label><input type="radio" name="override" value="1" checked="checked" onchange="change_override(0);">' . $this->user->lang('no') . '</label>', 'custom_js' => 'submit_form();', 'height' => 200), 'confirm');
        $this->jquery->dialog('style_reset_warning', $this->user->lang('reset_style'), array('message' => $this->user->lang('style_confirm_reset'), 'height' => 200, 'url' => $this->root_path . 'admin/manage_extensions.php' . $this->SID . '&link_hash=' . $this->CSRFGetToken('mode') . "&cat=2&mode=reset&code='+ styleid+'", 'withid' => 'styleid'), 'confirm');
        $this->jquery->dialog('style_delete_warning', $this->user->lang('delete_style'), array('message' => $this->user->lang('confirm_delete_style'), 'height' => 200, 'url' => $this->root_path . 'admin/manage_extensions.php' . $this->SID . '&link_hash=' . $this->CSRFGetToken('mode') . "&cat=2&mode=uninstall&code='+ styleid+'", 'withid' => 'styleid'), 'confirm');
        $badge = '';
        if ($arrUpdateCount[2]['red']) {
            $badge = '<span class="update_available">' . $arrUpdateCount[2]['red'] . '</span>';
        } elseif ($arrUpdateCount[2]['yellow']) {
            $badge = '<span class="update_available_yellow">' . $arrUpdateCount[2]['yellow'] . '</span>';
        }
        $this->tpl->assign_vars(array('BADGE_2' => $badge));
        //=================================================================
        //Portal Modules
        $arrTmpModules = array();
        if (isset($arrExtensionList[3]) && is_array($arrExtensionList[3])) {
            foreach ($arrExtensionList[3] as $id => $extension) {
                $arrTmpModules[$extension['plugin']] = $extension;
            }
        }
        $arrModules = $this->pdh->aget('portal', 'portal', 0, array($this->pdh->get('portal', 'id_list')));
        if (is_array($arrModules)) {
            foreach ($arrModules as $id => $value) {
                $row = 'green';
                $link = '';
                $plugin_code = $value['path'];
                //Ignore Plugin Moduls in terms of repo-updates
                if (empty($value['plugin'])) {
                    if (isset($urgendUpdates[$plugin_code])) {
                        $row = 'red';
                        $link = '<a href="javascript:repo_update(3, \'' . $plugin_code . '\');">' . $this->user->lang('uc_bttn_update') . '</a>';
                        $arrUpdateCount[3]['red']++;
                    } elseif (isset($allUpdates[$plugin_code])) {
                        $row = 'yellow';
                        $link = '<a href="javascript:repo_update(3, \'' . $plugin_code . '\');">' . $this->user->lang('uc_bttn_update') . '</a>';
                        $arrUpdateCount[3]['yellow']++;
                    }
                }
                //Add Reinstall Link if no update available
                if ($row == 'green') {
                    $link = '<img src="' . $this->root_path . 'images/global/update.png" alt="' . $this->user->lang('reinstall') . '" title="' . $this->user->lang('reinstall') . '" onclick="javascript:reinstall_portal(\'' . $plugin_code . '\')" style="cursor:pointer;" />';
                }
                $this->tpl->assign_block_vars('pm_row_' . $row, array('NAME' => isset($arrExtensionListNamed[3][$value['path']]) ? '<a href="javascript:repoinfo(' . $arrExtensionListNamed[3][$value['path']] . ')">' . $value['name'] . '</a>' : $value['name'], 'VERSION' => sanitize($value['version']), 'CODE' => sanitize($value['path']), 'CONTACT' => sanitize($value['autor']), 'ACTION_LINK' => $link, 'DESCRIPTION' => isset($arrTmpModules[$value['path']]) ? '<a href="javascript:repoinfo(' . $arrExtensionListNamed[3][$value['path']] . ')">' . sanitize(cut_text($arrTmpModules[$value['path']]['shortdesc'], 100)) . '</a>' : ''));
            }
            $this->confirm_delete($this->user->lang('portal_reinstall_warn'), 'manage_extensions.php' . $this->SID . '&cat=3', true, array('function' => 'reinstall_portal', 'handler' => 'mode'));
        }
        //Now bring the Extensions from the REPO to template
        if (isset($arrExtensionList[3]) && is_array($arrExtensionList[3])) {
            foreach ($arrExtensionList[3] as $id => $extension) {
                if (is_array(search_in_array($extension['plugin'], $arrModules, true, 'path'))) {
                    continue;
                }
                $row = 'grey';
                $link = '<a href="javascript:repo_install(3, \'' . sanitize($extension['plugin']) . '\');" >' . $this->user->lang('backup_action_download') . '</a>';
                $this->tpl->assign_block_vars('pm_row_' . $row, array('NAME' => '<a href="javascript:repoinfo(' . $id . ')">' . $extension['name'] . '</a>', 'VERSION' => sanitize($extension['version']), 'CODE' => sanitize($extension['plugin']), 'CONTACT' => sanitize($extension['author']), 'DESCRIPTION' => '<a href="javascript:repoinfo(' . $id . ')">' . sanitize(cut_text($extension['shortdesc'])) . '</a>', 'ACTION_LINK' => $link, 'RATING' => $this->jquery->StarRating('extension_' . md5($extension['plugin']), array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5), '', $extension['rating'], true)));
            }
        }
        $badge = '';
        if ($arrUpdateCount[3]['red']) {
            $badge = '<span class="update_available">' . count($arrUpdateCount[3]['red']) . '</span>';
        } elseif ($arrUpdateCount[3]['yellow']) {
            $badge = '<span class="update_available_yellow">' . count($arrUpdateCount[3]['yellow']) . '</span>';
        }
        $this->tpl->assign_vars(array('BADGE_3' => $badge));
        //=================================================================
        //Games
        $arrGames = $this->game->get_games();
        $arrGameVersions = $this->game->get_versions();
        $arrTmpExtension = array();
        if (isset($arrExtensionList[7]) && is_array($arrExtensionList[7])) {
            foreach ($arrExtensionList[7] as $id => $extension) {
                $arrTmpExtension[$extension['plugin']] = $extension;
            }
        }
        if (is_array($arrGames)) {
            foreach ($arrGames as $id => $value) {
                $plugin_code = $value;
                if (isset($urgendUpdates[$plugin_code])) {
                    $row = 'red';
                    $link = '<a href="javascript:repo_update(7, \'' . $plugin_code . '\');">' . $this->user->lang('uc_bttn_update') . '</a>';
                    $arrUpdateCount[7]['red']++;
                } elseif (isset($allUpdates[$plugin_code])) {
                    $row = 'yellow';
                    $link = '<a href="javascript:repo_update(7, \'' . $plugin_code . '\');">' . $this->user->lang('uc_bttn_update') . '</a>';
                    $arrUpdateCount[7]['yellow']++;
                } else {
                    $row = 'green';
                    $link = '';
                }
                $this->tpl->assign_block_vars('games_row_' . $row, array('NAME' => isset($arrExtensionListNamed[7][$plugin_code]) ? '<a href="javascript:repoinfo(' . $arrExtensionListNamed[7][$plugin_code] . ')">' . $this->game->game_name($plugin_code) . '</a>' : $this->game->game_name($plugin_code), 'VERSION' => $arrGameVersions[$plugin_code], 'CODE' => sanitize($plugin_code), 'CONTACT' => isset($arrTmpExtension[$plugin_code]) ? $arrTmpExtension[$plugin_code]['author'] : '', 'DESCRIPTION' => isset($arrTmpExtension[$plugin_code]) ? '<a href="javascript:repoinfo(' . $arrExtensionListNamed[7][$plugin_code] . ')">' . cut_text($arrTmpExtension[$plugin_code]['shortdesc'], 100) . '</a>' : '', 'RATING' => isset($arrTmpExtension[$plugin_code]) ? $this->jquery->StarRating('extension_' . md5($arrTmpExtension[$plugin_code]['plugin']), array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5), '', $arrTmpExtension[$plugin_code]['rating'], true) : '', 'ACTION_LINK' => $link));
            }
        }
        //Now bring the Extensions from the REPO to template
        if (isset($arrExtensionList[7]) && is_array($arrExtensionList[7])) {
            foreach ($arrExtensionList[7] as $id => $extension) {
                if (in_array($extension['plugin'], $arrGames)) {
                    continue;
                }
                $row = 'grey';
                $link = '<a href="javascript:repo_install(7, \'' . sanitize($extension['plugin']) . '\');" >' . $this->user->lang('backup_action_download') . '</a>';
                $this->tpl->assign_block_vars('games_row_' . $row, array('NAME' => '<a href="javascript:repoinfo(' . $id . ')">' . $extension['name'] . '</a>', 'VERSION' => sanitize($extension['version']), 'CODE' => sanitize($extension['plugin']), 'CONTACT' => sanitize($extension['author']), 'DESCRIPTION' => sanitize(cut_text($extension['shortdesc'], 100)), 'ACTION_LINK' => $link, 'RATING' => $this->jquery->StarRating('extension_' . md5($extension['plugin']), array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5), '', $extension['rating'], true)));
            }
        }
        $badge = '';
        if ($arrUpdateCount[7]['red']) {
            $badge = '<span class="update_available">' . $arrUpdateCount[7]['red'] . '</span>';
        } elseif ($arrUpdateCount[7]['yellow']) {
            $badge = '<span class="update_available_yellow">' . $arrUpdateCount[7]['yellow'] . '</span>';
        }
        $this->tpl->assign_vars(array('BADGE_7' => $badge));
        //=================================================================
        //Languages
        $arrLanguages = $arrLanguageVersions = array();
        // Build language array
        if ($dir = @opendir($this->core->root_path . 'language/')) {
            while ($file = @readdir($dir)) {
                if (!is_file($this->root_path . 'language/' . $file) && !is_link($this->root_path . 'language/' . $file) && valid_folder($file)) {
                    include $this->root_path . 'language/' . $file . '/lang_main.php';
                    $lang_name_tp = $lang['ISO_LANG_NAME'] ? $lang['ISO_LANG_NAME'] . ' (' . $lang['ISO_LANG_SHORT'] . ')' : ucfirst($file);
                    $arrLanguages[$file] = $lang_name_tp;
                    $arrLanguageVersions[$file] = $lang['LANG_VERSION'];
                }
            }
        }
        if (is_array($arrLanguages)) {
            foreach ($arrLanguages as $id => $value) {
                $plugin_code = $id;
                if (isset($urgendUpdates[$plugin_code])) {
                    $row = 'red';
                    $link = '<a href="javascript:repo_update(11, \'' . $plugin_code . '\');">' . $this->user->lang('uc_bttn_update') . '</a>';
                    $arrUpdateCount[11]['red']++;
                } elseif (isset($allUpdates[$plugin_code])) {
                    $row = 'yellow';
                    $link = '<a href="javascript:repo_update(11, \'' . $plugin_code . '\');">' . $this->user->lang('uc_bttn_update') . '</a>';
                    $arrUpdateCount[11]['yellow']++;
                } else {
                    $row = 'green';
                    $link = '';
                }
                $this->tpl->assign_block_vars('language_row_' . $row, array('NAME' => isset($arrExtensionListNamed[11][$plugin_code]) ? '<a href="javascript:repoinfo(' . $arrExtensionListNamed[11][$plugin_code] . ')">' . $value . '</a>' : $value, 'VERSION' => $arrLanguageVersions[$plugin_code], 'ACTION_LINK' => $link));
            }
        }
        //Now bring the Extensions from the REPO to template
        if (isset($arrExtensionList[11]) && is_array($arrExtensionList[11])) {
            foreach ($arrExtensionList[11] as $id => $extension) {
                if (isset($arrLanguages[$extension['plugin']])) {
                    continue;
                }
                $row = 'grey';
                $link = '<a href="javascript:repo_install(11, \'' . sanitize($extension['plugin']) . '\');" >' . $this->user->lang('backup_action_download') . '</a>';
                $this->tpl->assign_block_vars('language_row_' . $row, array('NAME' => '<a href="javascript:repoinfo(' . $id . ')">' . $extension['name'] . '</a>', 'VERSION' => sanitize($extension['version']), 'ACTION_LINK' => $link));
            }
        }
        $badge = '';
        if ($arrUpdateCount[11]['red']) {
            $badge = '<span class="update_available">' . $arrUpdateCount[11]['red'] . '</span>';
        } elseif ($arrUpdateCount[11]['yellow']) {
            $badge = '<span class="update_available_yellow">' . $arrUpdateCount[11]['yellow'] . '</span>';
        }
        $this->tpl->assign_vars(array('BADGE_11' => $badge));
        //=================================================================
        //Common Output
        //Tabs
        $this->jquery->Tab_header('plus_plugins_tab', true);
        if ($this->in->exists('tab')) {
            $this->jquery->Tab_Select('plus_plugins_tab', $this->in->get('tab', 0));
        }
        $this->jquery->Dialog('update_confirm', '', array('custom_js' => 'repo_update_start(cat, extensioncode);', 'message' => $this->user->lang('repo_updatewarning') . '<br /><br /><input type="checkbox" onclick="hide_update_warning(this.checked);" value="1" />' . $this->user->lang('repo_hide_updatewarning'), 'withid' => 'cat, extensioncode', 'width' => 300, 'height' => 300), 'confirm');
        $this->jquery->Dialog('repoinfo', $this->user->lang('repo_extensioninfo'), array('url' => $this->root_path . "admin/manage_extensions.php" . $this->SID . "&info='+moduleid+'", 'width' => '700', 'height' => '600', 'withid' => 'moduleid'));
        foreach ($this->repo->DisplayCategories() as $key => $category) {
            $this->tpl->assign_vars(array('L_CATEGORY_' . $key => $category));
        }
        $this->tpl->assign_vars(array('S_HIDE_UPDATEWARNING' => (int) $this->config->get('repo_hideupdatewarning'), 'CSRF_MODE_TOKEN' => $this->CSRFGetToken('mode'), 'CSRF_UPDATEWARNING_TOKEN' => $this->CSRFGetToken('hide_update_warning')));
        $this->tpl->add_css('
			.ui-progressbar { position:relative; height:30px;}
			.nl_progressbar_label { position: absolute; width: 90%; text-align: center; line-height: 30px; left:5%; right:5%;}
		');
        $this->core->set_vars(array('page_title' => $this->user->lang('extensions'), 'template_file' => 'admin/manage_extensions.html', 'display' => true));
    }
Esempio n. 20
0
 /**
  * Returns array will all available Bridges
  * 
  * @return array
  */
 public function get_available_bridges()
 {
     include_once $this->root_path . 'core/bridges/bridge_generic.class.php';
     $bridges = array();
     // Build auth array
     if ($dir = @opendir($this->root_path . 'core/bridges/')) {
         while ($file = @readdir($dir)) {
             if (is_file($this->root_path . 'core/bridges/' . $file) && valid_folder($file)) {
                 if ($file == 'bridge_generic.class.php') {
                     continue;
                 }
                 include_once $this->root_path . 'core/bridges/' . $file;
                 $name = substr($file, 0, strpos($file, '.'));
                 $classname = $name . '_bridge';
                 $static_name = $classname::$name;
                 $bridges[$name] = strlen($static_name) ? $static_name : $name;
             }
         }
     }
     return $bridges;
 }
Esempio n. 21
0
 public function BuildUpdateArray($only_installed = true)
 {
     $pluginscheck = array();
     if (!$only_installed) {
         $arrUninstalledStyles = $this->objStyles->getUninstalledStyles();
     }
     $arrExtensions = $this->getExtensionList();
     if (is_array($arrExtensions)) {
         foreach ($arrExtensions as $categoryid => $categorycontent) {
             if (is_array($categorycontent)) {
                 foreach ($categorycontent as $id => $value) {
                     $blnUpdateAvailable = false;
                     switch ((int) $value['category']) {
                         //Plugins
                         case 1:
                             $status = $only_installed ? PLUGIN_INSTALLED : PLUGIN_REGISTERED;
                             $blnUpdateAvailable = $this->pm->check($value['plugin'], $status) && !$this->pm->check($value['plugin'], PLUGIN_DISABLED) && compareVersion(trim($value['version']), $this->pm->get_data($value['plugin'], 'version')) == 1 || $value['plugin'] == 'pluskernel' && compareVersion(trim($value['version']), $this->plusversion) == 1;
                             if ($blnUpdateAvailable) {
                                 $recent_version = $value['plugin'] != 'pluskernel' ? $this->pm->get_data($value['plugin'], 'version') : $this->plusversion;
                             }
                             break;
                             //Templates
                         //Templates
                         case 2:
                             $arrStylesList = $this->pdh->aget('styles', 'templatepath', 0, array($this->pdh->get('styles', 'id_list')), false);
                             if (in_array($value['plugin'], $arrStylesList)) {
                                 $styleid = array_search($value['plugin'], $arrStylesList);
                                 $blnUpdateAvailable = compareVersion(trim($value['version']), $this->pdh->get('styles', 'version', array($styleid))) == 1;
                                 if ($blnUpdateAvailable) {
                                     $recent_version = $this->pdh->get('styles', 'version', array($styleid));
                                 }
                             }
                             if (!$only_installed) {
                                 if (isset($arrUninstalledStyles[$value['plugin']])) {
                                     $blnUpdateAvailable = compareVersion(trim($value['version']), $arrUninstalledStyles[$value['plugin']]->version) == 1;
                                     if ($blnUpdateAvailable) {
                                         $recent_version = $arrUninstalledStyles[$value['plugin']]->version;
                                     }
                                 }
                             }
                             break;
                             //Portal modules
                         //Portal modules
                         case 3:
                             $arrPortalList = $this->pdh->aget('portal', 'path', 0, array($this->pdh->get('portal', 'id_list')), false);
                             if (in_array($value['plugin'], $arrPortalList)) {
                                 //Module belongs to an plugin
                                 $moduleid = array_search($value['plugin'], $arrPortalList);
                                 if (strlen($this->pdh->get('portal', 'plugin', array($moduleid)))) {
                                     break;
                                 }
                                 if ($only_installed) {
                                     $status = (int) $this->pdh->get('portal', 'enabled', array($moduleid));
                                     if ($status != 1) {
                                         break;
                                     }
                                 }
                                 if ($blnUpdateAvailable) {
                                     $recent_version = $this->pdh->get('portal', 'version', array($moduleid));
                                 }
                             }
                             break;
                             //Games
                         //Games
                         case 7:
                             if ($only_installed) {
                                 if ($value['plugin'] == $this->config->get('default_game')) {
                                     $blnUpdateAvailable = compareVersion(trim($value['version']), $this->game->gameVersion()) == 1;
                                     if ($blnUpdateAvailable) {
                                         $recent_version = $this->game->gameVersion();
                                     }
                                 }
                             } else {
                                 $arrGames = $this->game->get_versions();
                                 if (isset($arrGames[$value['plugin']])) {
                                     $blnUpdateAvailable = compareVersion(trim($value['version']), $arrGames[$value['plugin']]) == 1;
                                     if ($blnUpdateAvailable) {
                                         $recent_version = $arrGames[$value['plugin']];
                                     }
                                 }
                             }
                             break;
                             //Languages
                         //Languages
                         case 11:
                             $arrLanguages = $arrLanguageVersions = array();
                             // Build language array
                             if ($dir = @opendir($this->root_path . 'language/')) {
                                 while ($file = @readdir($dir)) {
                                     if (!is_file($this->root_path . 'language/' . $file) && !is_link($this->root_path . 'language/' . $file) && valid_folder($file)) {
                                         include $this->root_path . 'language/' . $file . '/lang_main.php';
                                         $lang_name_tp = $lang['ISO_LANG_NAME'] ? $lang['ISO_LANG_NAME'] . ' (' . $lang['ISO_LANG_SHORT'] . ')' : ucfirst($file);
                                         $arrLanguages[$file] = $lang_name_tp;
                                         $arrLanguageVersions[$file] = $lang['LANG_VERSION'];
                                     }
                                 }
                             }
                             if (isset($arrLanguages[$value['plugin']])) {
                                 $blnUpdateAvailable = compareVersion(trim($value['version']), $arrLanguageVersions[$value['plugin']]) == 1;
                                 if ($blnUpdateAvailable) {
                                     $recent_version = $arrLanguageVersions[$value['plugin']];
                                 }
                             }
                             break;
                     }
                     if ($blnUpdateAvailable) {
                         $pluginscheck[$value['plugin']] = array('plugin' => $value['plugin'], 'name' => $value['name'], 'version' => $value['version_ext'], 'version_int' => $value['version'], 'recent_version' => $recent_version, 'changelog' => $value['changelog'], 'level' => $value['level'], 'release' => $this->time->user_date($value['date']), 'dep_php' => $value['dep_php']);
                         $this->update_count++;
                     }
                 }
             }
         }
     }
     //local Style Updates
     $arrStyleUpdates = $this->objStyles->getLocalStyleUpdates();
     if (count($arrStyleUpdates) > 0) {
         $pluginscheck = array_merge($pluginscheck, $this->objStyles->getLocalStyleUpdates());
         $this->update_count += count($arrStyleUpdates);
     }
     return $pluginscheck;
 }
Esempio n. 22
0
 public function getMethodsUserSettings($blnAllMethods = false)
 {
     include_once $this->root_path . 'core/messenger/generic_messenger.class.php';
     $types = array();
     // Build auth array
     if ($dir = @opendir($this->root_path . 'core/messenger/')) {
         while ($file = @readdir($dir)) {
             if (is_file($this->root_path . 'core/messenger/' . $file) && valid_folder($file)) {
                 if ($file == 'generic_messenger.class.php') {
                     continue;
                 }
                 $name = substr($file, 0, strpos($file, '.'));
                 $settings = $this->getMethodUserSettings($name);
                 if (is_array($settings)) {
                     $types = array_merge($types, $settings);
                 }
             }
         }
     }
     return $types;
 }
 public function display()
 {
     $this->tpl->add_js("\n\t\t\t\$(\"#article_categories-table tbody\").sortable({\n\t\t\t\tcancel: '.not-sortable, input, tr th.footer, th',\n\t\t\t\tcursor: 'pointer',\n\t\t\t});\n\t\t", "docready");
     $view_list = $this->pdh->get('mediacenter_categories', 'id_list', array());
     $hptt_page_settings = array('name' => 'hptt_mc_admin_manage_categories_categorylist', 'table_main_sub' => '%intCategoryID%', 'table_subs' => array('%intCategoryID%', '%intArticleID%'), 'page_ref' => 'manage_media.php', 'show_numbers' => false, 'show_select_boxes' => true, 'selectboxes_checkall' => true, 'show_detail_twink' => false, 'table_sort_dir' => 'asc', 'table_sort_col' => 0, 'table_presets' => array(array('name' => 'mediacenter_categories_sort_id', 'sort' => true, 'th_add' => 'width="20"', 'td_add' => ''), array('name' => 'mediacenter_categories_editicon', 'sort' => false, 'th_add' => 'width="20"', 'td_add' => ''), array('name' => 'mediacenter_categories_published', 'sort' => true, 'th_add' => 'width="20"', 'td_add' => ''), array('name' => 'mediacenter_categories_name', 'sort' => true, 'th_add' => '', 'td_add' => ''), array('name' => 'mediacenter_categories_alias', 'sort' => true, 'th_add' => '', 'td_add' => ''), array('name' => 'mediacenter_categories_album_count', 'sort' => true, 'th_add' => 'width="20"', 'td_add' => ''), array('name' => 'mediacenter_categories_media_count', 'sort' => true, 'th_add' => 'width="20"', 'td_add' => '')));
     $hptt = $this->get_hptt($hptt_page_settings, $view_list, $view_list, array('%link_url%' => $this->root_path . 'plugins/mediacenter/admin/manage_media.php', '%link_url_suffix%' => ''));
     $page_suffix = '&amp;start=' . $this->in->get('start', 0);
     $sort_suffix = '?sort=' . $this->in->get('sort');
     $item_count = count($view_list);
     $this->confirm_delete($this->user->lang('mc_confirm_delete_category'));
     $intMediaCount = $this->pdh->get('mediacenter_media', 'id_list', array());
     if (!$intMediaCount || $intMediaCount === 0) {
         $strFolder = $this->pfh->FolderPath('files', 'mediacenter');
         $arrFiles = scandir($strFolder);
         $blnOldFiles = false;
         foreach ($arrFiles as $strFile) {
             if (valid_folder($strFile)) {
                 $blnOldFiles = true;
                 break;
             }
         }
         if ($blnOldFiles) {
             $this->tpl->assign_vars(array('S_SHOW_OLD_INFO' => true));
         }
     }
     $this->tpl->assign_vars(array('CATEGORY_LIST' => $hptt->get_html_table($this->in->get('sort'), $page_suffix, null, 1, null, false, array('mediacenter_categories', 'checkbox_check')), 'HPTT_COLUMN_COUNT' => $hptt->get_column_count()));
     $this->core->set_vars(array('page_title' => $this->user->lang('mc_manage_categories'), 'template_path' => $this->pm->get_data('mediacenter', 'template_path'), 'template_file' => 'admin/manage_categories.html', 'display' => true));
 }
Esempio n. 24
0
 public function get_settingsdata()
 {
     $settingsdata = array();
     //Privacy - Phone numbers
     $priv_phone_array = array('0' => 'user_priv_all', '1' => 'user_priv_user', '2' => 'user_priv_admin', '3' => 'user_priv_no');
     $priv_set_array = array('0' => 'user_priv_all', '1' => 'user_priv_user', '2' => 'user_priv_admin');
     $gender_array = array('0' => "---", '1' => 'adduser_gender_m', '2' => 'adduser_gender_f');
     $cfile = $this->root_path . 'core/country_states.php';
     if (file_exists($cfile)) {
         include $cfile;
     }
     // Build language array
     if ($dir = @opendir($this->core->root_path . 'language/')) {
         while ($file = @readdir($dir)) {
             if (!is_file($this->core->root_path . 'language/' . $file) && !is_link($this->core->root_path . 'language/' . $file) && valid_folder($file)) {
                 include $this->core->root_path . 'language/' . $file . '/lang_main.php';
                 $lang_name_tp = $lang['ISO_LANG_NAME'] ? $lang['ISO_LANG_NAME'] . ' (' . $lang['ISO_LANG_SHORT'] . ')' : ucfirst($file);
                 $language_array[$file] = $lang_name_tp;
                 $locale_array[$lang['ISO_LANG_SHORT']] = $lang_name_tp;
             }
         }
     }
     $style_array = array();
     foreach ($this->pdh->get('styles', 'styles', array(0, false)) as $styleid => $row) {
         $style_array[$styleid] = $row['style_name'];
     }
     $auth_options = $this->user->get_loginmethod_options();
     // hack the birthday format, to be sure there is a 4 digit year in it
     $birthday_format = $this->user->style['date_notime_short'];
     if (stripos($birthday_format, 'y') === false) {
         $birthday_format .= 'Y';
     }
     $birthday_format = str_replace('y', 'Y', $birthday_format);
     $settingsdata = array('registration_information' => array('adduser_tab_registration_information' => array('username' => array('fieldtype' => 'text', 'name' => 'username', 'help' => $this->config->get('pk_disable_username_change') == 1 ? $this->user->lang('register_help_disabled_username') : '', 'readonly' => $this->config->get('pk_disable_username_change') == 1 ? true : false, 'text' => '<img id="tick_username" src="' . $this->root_path . 'images/register/tick.png" style="display:none;" width="16" height="16" alt="" />', 'size' => 40, 'required' => true, 'id' => 'username'), 'user_email' => array('fieldtype' => 'text', 'name' => 'email_address', 'size' => 40, 'required' => true, 'id' => 'useremail'), 'user_password' => array('fieldtype' => 'password', 'name' => 'current_password', 'size' => 40, 'help' => 'current_password_note', 'no_value' => true, 'id' => 'oldpassword', 'required' => true), 'new_user_password1' => array('fieldtype' => 'password', 'name' => 'new_password', 'size' => 40, 'id' => 'password1'), 'new_user_password2' => array('fieldtype' => 'password', 'name' => 'confirm_password', 'size' => 40, 'help' => 'confirm_password_note', 'id' => 'password2'))), 'profile' => array('adduser_tab_profile' => array('first_name' => array('fieldtype' => 'text', 'name' => 'adduser_first_name', 'size' => 40, 'id' => 'first_name'), 'last_name' => array('fieldtype' => 'text', 'name' => 'adduser_last_name', 'size' => 40), 'gender' => array('fieldtype' => 'dropdown', 'name' => 'adduser_gender', 'options' => $gender_array, 'id' => 'gender'), 'country' => array('fieldtype' => 'dropdown', 'name' => 'adduser_country', 'options' => $country_array, 'no_lang' => true, 'id' => 'country'), 'state' => array('fieldtype' => 'text', 'name' => 'adduser_state', 'options' => $country_array, 'no_lang' => true), 'ZIP_code' => array('fieldtype' => 'int', 'size' => 5, 'name' => 'adduser_ZIP_code'), 'town' => array('fieldtype' => 'text', 'name' => 'adduser_town', 'size' => 40), 'phone' => array('fieldtype' => 'text', 'name' => 'adduser_phone', 'size' => 40, 'help' => 'adduser_foneinfo'), 'cellphone' => array('fieldtype' => 'text', 'name' => 'adduser_cellphone', 'size' => 40, 'help' => 'adduser_cellinfo'), 'icq' => array('fieldtype' => 'text', 'name' => 'adduser_icq', 'size' => 40), 'skype' => array('fieldtype' => 'text', 'name' => 'adduser_skype', 'size' => 40), 'msn' => array('fieldtype' => 'text', 'name' => 'adduser_msn', 'size' => 40), 'irq' => array('fieldtype' => 'text', 'name' => 'adduser_irq', 'size' => 40, 'help' => 'register_help_irc'), 'twitter' => array('fieldtype' => 'text', 'name' => 'adduser_twitter', 'size' => 40), 'facebook' => array('fieldtype' => 'text', 'name' => 'adduser_facebook', 'size' => 40), 'birthday' => array('fieldtype' => 'datepicker', 'name' => 'adduser_birthday', 'allow_empty' => true, 'options' => array('year_range' => '-80:+0', 'change_fields' => true, 'format' => $birthday_format)), 'user_avatar' => array('fieldtype' => 'imageuploader', 'name' => 'user_image', 'imgpath' => $this->pfh->FolderPath('user_avatars', 'eqdkp'), 'options' => array('deletelink' => 'settings.php' . $this->SID . '&mode=deleteavatar&link_hash=' . $this->CSRFGetToken('mode'))), 'work' => array('fieldtype' => 'text', 'name' => 'user_work', 'size' => 40), 'interests' => array('fieldtype' => 'text', 'name' => 'user_interests', 'size' => 40), 'hardware' => array('fieldtype' => 'text', 'name' => 'user_hardware', 'size' => 40)), 'user_priv' => array('priv_no_boardemails' => array('fieldtype' => 'checkbox', 'default' => 0, 'name' => 'user_priv_no_boardemails'), 'priv_set' => array('fieldtype' => 'dropdown', 'name' => 'user_priv_set_global', 'options' => $priv_set_array, 'value' => '1'), 'priv_phone' => array('fieldtype' => 'dropdown', 'name' => 'user_priv_tel_all', 'options' => $priv_phone_array, 'value' => '1'), 'priv_nosms' => array('fieldtype' => 'checkbox', 'default' => 0, 'name' => 'user_priv_tel_sms'), 'priv_bday' => array('fieldtype' => 'checkbox', 'default' => 0, 'name' => 'user_priv_bday'), 'exchange_key' => array('fieldtype' => 'plaintext', 'text' => $this->user->data['exchange_key'] . '<br /><input type="submit" value="' . $this->user->lang('user_create_new appkey') . '" name="newexchangekey" class="bi_reload" />', 'name' => 'user_app_key'))), 'view_options' => array('adduser_tab_view_options' => array('user_alimit' => array('fieldtype' => 'spinner', 'name' => 'adjustments_per_page', 'size' => 5, 'step' => 10, 'id' => 'user_alimit'), 'user_climit' => array('fieldtype' => 'spinner', 'name' => 'characters_per_page', 'size' => 5, 'step' => 10, 'id' => 'user_climit'), 'user_elimit' => array('fieldtype' => 'spinner', 'name' => 'events_per_page', 'size' => 5, 'step' => 10, 'id' => 'user_elimit'), 'user_ilimit' => array('fieldtype' => 'spinner', 'name' => 'items_per_page', 'size' => 5, 'step' => 10, 'id' => 'user_ilimit'), 'user_rlimit' => array('fieldtype' => 'spinner', 'name' => 'raids_per_page', 'size' => 5, 'step' => 10, 'id' => 'user_rlimit'), 'user_nlimit' => array('fieldtype' => 'spinner', 'name' => 'news_per_page', 'size' => 5, 'id' => 'user_nlimit'), 'user_lang' => array('fieldtype' => 'dropdown', 'name' => 'language', 'options' => $language_array, 'no_lang' => true), 'user_timezone' => array('fieldtype' => 'dropdown', 'name' => 'user_timezones', 'options' => $this->time->timezones, 'value' => $this->config->get('timezone')), 'user_style' => array('fieldtype' => 'dropdown', 'name' => 'style', 'options' => $style_array, 'text' => ' (<a href="javascript:template_preview()">' . $this->user->lang('preview') . '</a>)', 'no_lang' => true), 'user_date_time' => array('fieldtype' => 'text', 'name' => 'adduser_date_time', 'size' => 40, 'help' => 'adduser_date_note'), 'user_date_short' => array('fieldtype' => 'text', 'name' => 'adduser_date_short', 'size' => 40, 'help' => 'adduser_date_note'), 'user_date_long' => array('fieldtype' => 'text', 'name' => 'adduser_date_long', 'size' => 40, 'help' => 'adduser_date_note'))));
     //Merge auth-accounts
     foreach ($auth_options as $method => $options) {
         if (isset($options['connect_accounts']) && $options['connect_accounts']) {
             if (isset($this->user->data['auth_account'][$method]) && strlen($this->user->data['auth_account'][$method])) {
                 $auth_array['registration_information']['auth_accounts'] = array('auth_account_' . $method => array('name' => $this->user->lang('login_' . $method) ? $this->user->lang('login_' . $method) : ucfirst($method), 'text' => $this->user->data['auth_account'][$method] . ' <a href="settings.php' . $this->SID . '&amp;mode=delauthacc&amp;lmethod=' . $method . '&amp;link_hash=' . $this->CSRFGetToken('mode') . '"><img src="' . $this->root_path . 'images/global/delete.png" alt="Delete" /></a>', 'help' => 'auth_accounts_help'));
             } else {
                 $auth_array['registration_information']['auth_accounts'] = array('auth_account_' . $method => array('name' => $this->user->lang('login_' . $method) ? $this->user->lang('login_' . $method) : ucfirst($method), 'text' => $this->user->handle_login_functions('account_button', $method), 'help' => 'auth_accounts_help'));
             }
             $settingsdata = array_merge_recursive($settingsdata, $auth_array);
         }
     }
     return $settingsdata;
 }
Esempio n. 25
0
 * Link:		http://creativecommons.org/licenses/by-nc-sa/3.0/
 * -----------------------------------------------------------------------
 * Began:		2011
 * Date:		$Date: 2011-07-12 09:54:15 +0200 (Di, 12. Jul 2011) $
 * -----------------------------------------------------------------------
 * @author		$Author: Godmod $
 * @copyright	2006-2011 EQdkp-Plus Developer Team
 * @link		http://eqdkp-plus.com
 * @package		eqdkp-plus
 * @version		$Rev: 10611 $
 * 
 * $Id: install.class.php 10611 2011-07-12 07:54:15Z Godmod $
 */
define('INSTALL_ROOT', dirname(__FILE__));
define('SETUP_PACKAGE', 'eqdkpplus_100b1.zip');
define('INSTALL_DIR', strlen($_POST['install_dir']) && valid_folder($_POST['install_dir']) ? $_POST['install_dir'] . '/' : '/');
define('INSTALL_PATH', INSTALL_ROOT . INSTALL_DIR);
if (!isset($_GET['step'])) {
    $content = step1();
} else {
    if (function_exists($_GET['step'])) {
        $function = $_GET['step'];
        $content = $function();
    }
}
//Step1: check requirements for unpacking EQdkp Plus
function step1()
{
    $phpcheckdata = getCheckParams();
    if (!do_match_absreq()) {
        $content .= '<div style="margin-top: 10px; padding: 0pt 0.7em;" class="ui-state-error ui-corner-all"> 
Esempio n. 26
0
 /**
  * returns all available games
  *
  * @return array
  */
 public function get_games()
 {
     if (empty($this->games)) {
         if ($dir = opendir($this->root_path . 'games/')) {
             while ($game_name = @readdir($dir)) {
                 if (!valid_folder($game_name)) {
                     continue;
                 }
                 $cwd = $this->root_path . 'games/' . $game_name . '/' . $game_name . '.class.php';
                 // regenerate the link to the game
                 if (valid_folder($game_name) && @is_file($cwd)) {
                     // check if valid
                     $this->games[] = $game_name;
                     // add to array
                 }
             }
         }
     }
     return $this->games;
 }
Esempio n. 27
0
 public function file_tree($directory, $return_link = '', $extensions = array(), $first_call = true, $only_dir = false, $dd = false, $checkboxes = false, $radiobox = false, $selected = array())
 {
     if (!is_array($selected)) {
         $selected = array($selected);
     }
     // Get and sort directories/files
     $file = scandir($directory);
     natcasesort($file);
     // Make directories first
     $files = $dirs = array();
     foreach ($file as $this_file) {
         if (is_dir("{$directory}/{$this_file}")) {
             $dirs[] = $this_file;
         } elseif (!$only_dir && valid_folder($this_file)) {
             $files[] = $this_file;
         }
     }
     $file = array_merge($dirs, $files);
     // Filter unwanted extensions
     if (!empty($extensions)) {
         foreach (array_keys($file) as $key) {
             if (!is_dir("{$directory}/{$file[$key]}")) {
                 $ext = substr($file[$key], strrpos($file[$key], ".") + 1);
                 if (!in_array($ext, $extensions)) {
                     unset($file[$key]);
                 }
             }
         }
     }
     $dd_data = array();
     if (count($file) > 2) {
         // Use 2 instead of 0 to account for . and .. "directories"
         $php_file_tree = "<ul";
         if ($first_call) {
             $php_file_tree .= " class=\"php-file-tree\"";
             $first_call = false;
         }
         $php_file_tree .= ">";
         foreach ($file as $this_file) {
             if ($this_file != "." && $this_file != "..") {
                 if (is_dir("{$directory}/{$this_file}")) {
                     // Directory
                     $php_file_tree .= "<li class=\"pft-directory\">" . ($checkboxes ? "<input type=\"checkbox\" name=\"files[]\" value=\"" . str_replace("//", "/", $directory . "/" . $this_file) . "\"> " : '') . "<a href=\"javascript:void();\">" . sanitize($this_file) . "</a>";
                     $php_file_tree .= $this->file_tree("{$directory}/{$this_file}", $return_link, $extensions, false, $only_dir, $dd, $checkboxes, $radiobox, $selected);
                     $php_file_tree .= "</li>";
                     $dd_data["{$directory}/{$this_file}"] = $this_file;
                     $bla = $this->file_tree(str_replace("//", "/", $directory . "/" . $this_file), $return_link, $extensions, false, $only_dir, $dd, $checkboxes, $radiobox, $selected);
                     if (is_array($bla)) {
                         foreach ($bla as $key => $value) {
                             $dd_data[$key] = '&nbsp;&nbsp;&nbsp;' . $value;
                         }
                     }
                     $i++;
                 } else {
                     // File
                     // Get extension (prepend 'ext-' to prevent invalid classes from extensions that begin with numbers)
                     $ext = "ext-" . substr($this_file, strrpos($this_file, ".") + 1);
                     $link = str_replace("[link]", "{$directory}/" . urlencode($this_file), $return_link);
                     $php_file_tree .= "<li class=\"pft-file " . strtolower($ext) . "\">" . ($checkboxes ? '<input type="checkbox" name="files[]" value="' . str_replace("//", "/", $directory . "/" . $this_file) . '"> ' : '') . ($radiobox ? "<input type=\"radio\" name=\"" . $radiobox . "\" value=\"" . str_replace("//", "/", $directory . "/" . $this_file) . "\"" . (in_array(str_replace("//", "/", $directory . "/" . $this_file), $selected) ? ' checked="checked"' : '') . "> " : '') . "<a href=\"{$link}\">" . sanitize($this_file) . "</a></li>";
                 }
             }
         }
         $php_file_tree .= "</ul>";
     }
     if (!$this->added_js) {
         $this->tpl->add_js($this->add_js());
         $this->tpl->add_css($this->add_css());
         $this->added_js = true;
     }
     if ($dd) {
         return $dd_data;
     }
     return $php_file_tree;
 }
Esempio n. 28
0
 public function getAvailableLanguages($blnWithIsoShort = true, $blnWithIcon = false, $blnIsoAsKey = false)
 {
     $root_path = registry::get_const('root_path');
     $language_array = array();
     $icon = "";
     // Build language array
     if ($dir = @opendir($root_path . 'language/')) {
         while ($file = @readdir($dir)) {
             if (!is_file($root_path . 'language/' . $file) && !is_link($root_path . 'language/' . $file) && valid_folder($file)) {
                 include $root_path . 'language/' . $file . '/lang_main.php';
                 if (isset($lang['ISO_LANG_SHORT'])) {
                     list($pre, $post) = explode('_', $lang['ISO_LANG_SHORT']);
                     if ($pre != "" && is_file($root_path . 'images/flags/' . $pre . '.svg')) {
                         $icon = '<img src="' . registry::get_const('server_path') . 'images/flags/' . $pre . '.svg" class="icon icon-language absmiddle" title="' . ($lang['ISO_LANG_NAME'] ? $lang['ISO_LANG_NAME'] : ucfirst($file)) . '"/> <span>';
                     }
                 }
                 $lang_name_tp = $lang['ISO_LANG_NAME'] ? $lang['ISO_LANG_NAME'] . ($blnWithIsoShort ? ' (' . $lang['ISO_LANG_SHORT'] . ')' : '') : ucfirst($file);
                 $key = $blnIsoAsKey ? $lang['ISO_LANG_SHORT'] : $file;
                 $language_array[$key] = ($blnWithIcon ? $icon : '') . $lang_name_tp . ($blnWithIcon ? '</span>' : '');
             }
         }
     }
     return $language_array;
 }
Esempio n. 29
0
 public function display()
 {
     // Build the default game array
     $games = array();
     foreach ($this->game->get_games() as $sgame) {
         $games[$sgame] = $this->game->game_name($sgame);
     }
     // ---------------------------------------------------------
     // Build the Dropdown Arrays
     // ---------------------------------------------------------
     $a_startday = array('sunday' => $this->user->lang(array('time_daynames', 6)), 'monday' => $this->user->lang(array('time_daynames', 0)));
     $a_calraid_status = array(0 => $this->user->lang(array('raidevent_raid_status', 0)), 1 => $this->user->lang(array('raidevent_raid_status', 1)), 2 => $this->user->lang(array('raidevent_raid_status', 2)), 3 => $this->user->lang(array('raidevent_raid_status', 3)), 4 => $this->user->lang(array('raidevent_raid_status', 4)));
     $a_calraid_status2 = array(0 => $this->user->lang(array('raidevent_raid_status', 0)), 1 => $this->user->lang(array('raidevent_raid_status', 1)));
     $a_calraid_nsfilter = array('twinks' => 'raidevent_raid_nsf_twink', 'inactive' => 'raidevent_raid_nsf_inctv', 'hidden' => 'raidevent_raid_nsf_hiddn', 'special' => 'raidevent_raid_nsf_special');
     $a_debug_mode = array('0' => 'core_sett_f_debug_type0', '1' => 'core_sett_f_debug_type1', '2' => 'core_sett_f_debug_type2', '3' => 'core_sett_f_debug_type3');
     $a_modelviewer = array('0' => 'WoWHead', '1' => 'Thottbot', '2' => 'SpeedyDragon');
     $accact_array = array('0' => 'none', '1' => 'user', '2' => 'admin');
     $portal_positions = array('right' => 'portalplugin_right', 'middle' => 'portalplugin_middle', 'bottom' => 'portalplugin_bottom');
     $mail_array = array('mail' => 'lib_email_mail', 'sendmail' => 'lib_email_sendmail', 'smtp' => 'lib_email_smtp');
     $smtp_connection_methods = array('' => 'none', 'ssl' => 'SSL/TLS', 'tls' => 'STARTTLS');
     $a_calendar_addevmode = array('event' => 'calendar_mode_event', 'raid' => 'calendar_mode_raid');
     $mobile_template_array = array("" => $this->user->lang('default_setting'));
     foreach ($this->pdh->get('styles', 'styles', array(0, false)) as $styleid => $row) {
         $mobile_template_array[$styleid] = $row['style_name'];
     }
     $mobile_portallayout_array = array("" => $this->user->lang('default_setting'));
     foreach ($this->pdh->get('portal_layouts', 'id_list') as $layoutid) {
         $mobile_portallayout_array[$layoutid] = $this->pdh->get('portal_layouts', 'name', array($layoutid));
     }
     $mobile_pagelayout_array = array("" => $this->user->lang('default_setting'));
     foreach ($this->pdh->get_layout_list() as $key => $val) {
         $mobile_pagelayout_array[$val] = $val;
     }
     $a_groups = $this->pdh->aget('user_groups', 'name', 0, array($this->pdh->get('user_groups', 'id_list')));
     // Startpage
     $arrMenuItems = $this->core->build_menu_array(true, true);
     foreach ($arrMenuItems as $page) {
         $link = $this->user->removeSIDfromString($page['link']);
         if ($link != "" && $link != "#" && $link != "index.php") {
             if (isset($page['category'])) {
                 $strAlias = $this->pdh->get('article_categories', 'alias', array($page['id']));
                 if (!isset($startpage_array[$strAlias])) {
                     $startpage_array[$this->pdh->get('article_categories', 'alias', array($page['id']))] = $this->pdh->get('article_categories', 'name_prefix', array($page['id'])) . $this->pdh->get('article_categories', 'name', array($page['id']));
                 }
             } elseif (isset($page['article'])) {
                 $catid = $this->pdh->get('articles', 'category', array($page['id']));
                 $startpage_array[$this->pdh->get('articles', 'alias', array($page['id']))] = $this->pdh->get('article_categories', 'name_prefix', array($catid)) . ' -> ' . $this->pdh->get('articles', 'title', array($page['id']));
             } elseif (!isset($page['pluslink'])) {
                 $startpage_array[$link] = $page['text'] . ' (' . $link . ')';
             }
         }
     }
     // Build language array
     if ($dir = @opendir($this->core->root_path . 'language/')) {
         while ($file = @readdir($dir)) {
             if (!is_file($this->core->root_path . 'language/' . $file) && !is_link($this->core->root_path . 'language/' . $file) && valid_folder($file)) {
                 include $this->core->root_path . 'language/' . $file . '/lang_main.php';
                 $lang_name_tp = $lang['ISO_LANG_NAME'] ? $lang['ISO_LANG_NAME'] . ' (' . $lang['ISO_LANG_SHORT'] . ')' : ucfirst($file);
                 $language_array[$file] = $lang_name_tp;
                 $locale_array[$lang['ISO_LANG_SHORT']] = $lang_name_tp;
             }
         }
     }
     //Social Plugins
     $arrSocialPlugins = $this->social->getSocialPlugins();
     $arrSocialFields = array();
     foreach ($arrSocialPlugins as $key) {
         $arrSocialFields['sp_' . $key] = array('type' => 'radio');
     }
     $arrSocialButtons = $this->social->getSocialButtons();
     foreach ($arrSocialButtons as $key) {
         $arrSocialFields['sp_' . $key] = array('type' => 'radio');
     }
     // ---------------------------------------------------------
     // Member Array
     // ---------------------------------------------------------
     $members = $this->pdh->aget('member', 'name', 0, array($this->pdh->get('member', 'id_list', array(false, false, false))));
     asort($members);
     // ---------------------------------------------------------
     // Default email signature
     // ---------------------------------------------------------
     $signature = "--\n";
     $signature .= $this->user->lang('lib_signature_defaultval');
     $signature .= ' ' . $this->config->get('guildtag');
     $signature .= "\nEQdkp Plus: ";
     $signature .= $this->env->link;
     // Bit of jQuery..
     if ($this->game->get_importAuth('a_members_man', 'char_mupdate')) {
         $this->jquery->Dialog('MassUpdateChars', $this->user->lang('uc_import_adm_update'), array('url' => $this->game->get_importers('char_mupdate', true), 'width' => '600', 'height' => '450', 'onclose' => $this->env->link . 'admin/manage_settings.php'));
     }
     if ($this->game->get_importAuth('a_members_man', 'guild_import')) {
         $this->jquery->Dialog('GuildImport', $this->user->lang('uc_import_guild_wh'), array('url' => $this->game->get_importers('guild_import', true), 'width' => '600', 'height' => '450', 'onclose' => $this->env->link . 'admin/manage_settings.php'));
     }
     if (($this->game->get_importAuth('a_members_man', 'char_mupdate') || $this->game->get_importAuth('a_members_man', 'guild_import')) && $this->game->get_importers('import_data_cache')) {
         $this->jquery->Dialog('ClearImportCache', $this->user->lang('uc_importer_cache'), array('url' => $this->game->get_importers('import_reseturl', true), 'width' => '400', 'height' => '250', 'onclose' => $this->env->link . 'admin/manage_settings.php'));
     }
     // ---------------------------------------------------------
     // Output to the page
     // ---------------------------------------------------------
     $this->jquery->Dialog('template_preview', $this->user->lang('template_preview'), array('url' => $this->root_path . "viewnews.php" . $this->SID . "&amp;style='+ \$(\"select[name='user_style'] option:selected\").val()+'", 'width' => '750', 'height' => '520', 'modal' => true));
     // initialize form class
     $this->form->lang_prefix = 'core_sett_';
     $this->form->use_tabs = true;
     $this->form->use_fieldsets = true;
     // define standard data for settings
     $settingsdata = array('global' => array('global' => array('main_title' => array('type' => 'text', 'size' => 40), 'sub_title' => array('type' => 'text', 'size' => 40), 'enable_points' => array('type' => 'radio'), 'dkp_name' => array('type' => 'text', 'size' => 5), 'round_activate' => array('type' => 'radio', 'default' => 0, 'dependency' => array(1 => array('round_precision'))), 'round_precision' => array('type' => 'text', 'size' => 2, 'default' => 0), 'enable_leaderboard' => array('type' => 'radio'), 'color_items' => array('type' => 'slider', 'label' => $this->user->lang('core_sett_f_color_items'), 'min' => 0, 'max' => 100, 'width' => '300px'), 'enable_comments' => array('type' => 'radio'), 'debug' => array('type' => 'dropdown', 'tolang' => true, 'options' => $a_debug_mode)), 'meta' => array('meta_keywords' => array('type' => 'text', 'size' => 40), 'meta_description' => array('type' => 'text', 'size' => 40)), 'js' => array('global_js' => array('type' => 'textarea', 'cols' => 80, 'rows' => 5, 'codeinput' => true), 'global_css' => array('type' => 'textarea', 'cols' => 80, 'rows' => 5, 'codeinput' => true))), 'system' => array('globalsettings' => array('default_locale' => array('type' => 'dropdown', 'options' => $locale_array), 'server_path' => array('type' => 'text', 'size' => 50), 'enable_gzip' => array('type' => 'radio', 'default' => 0)), 'auth' => array('auth_method' => array('type' => 'dropdown', 'options' => $this->user->get_available_authmethods(), 'default' => 'db')), 'login' => array('login_method' => array('type' => 'multiselect', 'options' => $this->user->get_available_loginmethods(), 'tolang' => true)), 'cookie' => array('cookie_domain' => array('type' => 'text', 'size' => 25), 'cookie_name' => array('type' => 'text', 'size' => 25), 'cookie_path' => array('type' => 'text', 'size' => 25), 'cookie_euhint_show' => array('type' => 'radio')), 'email' => array('lib_email_method' => array('type' => 'dropdown', 'tolang' => true, 'options' => $mail_array, 'dependency' => array('sendmail' => array('lib_email_sendmail_path'), 'smtp' => array('lib_email_smtp_host', 'lib_email_smtp_port', 'lib_email_smtp_connmethod', 'lib_email_smtp_auth', 'lib_email_smtp_user', 'lib_email_smtp_pw'))), 'admin_email' => array('type' => 'text', 'size' => 30, 'encrypt' => true), 'lib_email_sender_name' => array('type' => 'text', 'size' => 30), 'lib_email_sendmail_path' => array('type' => 'text', 'size' => 30), 'lib_email_smtp_host' => array('type' => 'text', 'size' => 30), 'lib_email_smtp_port' => array('type' => 'text', 'size' => 5, 'default' => 25), 'lib_email_smtp_connmethod' => array('type' => 'dropdown', 'options' => $smtp_connection_methods), 'lib_email_smtp_auth' => array('type' => 'radio'), 'lib_email_smtp_user' => array('type' => 'text', 'size' => 30), 'lib_email_smtp_pw' => array('type' => 'password', 'required' => false, 'pattern' => '', 'size' => 30, 'set_value' => true), 'lib_email_signature' => array('type' => 'radio', 'dependency' => array(1 => array('lib_email_signature_value'))), 'lib_email_signature_value' => array('type' => 'textarea', 'default' => $signature, 'cols' => 80, 'rows' => 5)), 'recaptcha' => array('enable_captcha' => array('type' => 'radio'), 'lib_recaptcha_okey' => array('type' => 'text', 'size' => 30), 'lib_recaptcha_pkey' => array('type' => 'text', 'size' => 30)), 'date' => array('timezone' => array('type' => 'dropdown', 'options' => $this->time->timezones), 'date_startday' => array('type' => 'dropdown', 'options' => $a_startday), 'default_date_time' => array('type' => 'text', 'size' => 10, 'default' => $this->user->lang('style_time')), 'default_date_short' => array('type' => 'text', 'size' => 20, 'default' => $this->user->lang('style_date_short')), 'default_date_long' => array('type' => 'text', 'size' => 20, 'default' => $this->user->lang('style_date_long')), 'default_jsdate_time' => array('type' => 'text', 'size' => 20, 'default' => $this->user->lang('style_jstime')), 'default_jsdate_nrml' => array('type' => 'text', 'size' => 20, 'default' => $this->user->lang('style_jsdate_nrml')), 'default_jsdate_short' => array('type' => 'text', 'size' => 20, 'default' => $this->user->lang('style_jsdate_short')))), 'user' => array('user' => array('default_lang' => array('type' => 'dropdown', 'options' => $language_array), 'account_activation' => array('type' => 'radio', 'tolang' => true, 'options' => $accact_array, 'default' => 0), 'failed_logins_inactivity' => array('type' => 'text', 'size' => 5, 'default' => 5), 'enable_registration' => array('type' => 'radio'), 'enable_username_change' => array('type' => 'radio'), 'default_style_overwrite' => array('type' => 'radio'), 'special_user' => array('type' => 'multiselect', 'options' => $this->pdh->aget('user', 'name', 0, array($this->pdh->get('user', 'id_list', array(false)))), 'datatype' => 'int'), 'gravatar_defaultavatar' => array('type' => 'radio'))), 'chars' => array('chars' => array('class_color' => array('type' => 'radio'), 'special_members' => array('type' => 'multiselect', 'options' => $members), 'show_twinks' => array('type' => 'radio'), 'detail_twink' => array('type' => 'radio'), 'hide_inactive' => array('type' => 'radio'), 'inactive_period' => array('type' => 'text', 'size' => 5, 'default' => 0))), 'calendar' => array('calendar' => array('calendar_addevent_mode' => array('type' => 'dropdown', 'options' => $a_calendar_addevmode, 'tolang' => true), 'calendar_show_birthday' => array('type' => 'radio')), 'raids' => array('calendar_raid_guests' => array('type' => 'radio'), 'calendar_raid_random' => array('type' => 'radio'), 'calendar_raid_classbreak' => array('type' => 'spinner', 'size' => 4), 'calendar_raid_status' => array('type' => 'multiselect', 'options' => $a_calraid_status, 'datatype' => 'int'), 'calendar_raid_nsfilter' => array('type' => 'multiselect', 'options' => $a_calraid_nsfilter, 'tolang' => true), 'calendar_addraid_deadline' => array('type' => 'spinner', 'size' => 5, 'default' => 1), 'calendar_addraid_duration' => array('type' => 'spinner', 'size' => 5, 'min' => 10, 'step' => 10, 'default' => 120), 'calendar_addraid_use_def_start' => array('type' => 'radio', 'dependency' => array(1 => array('calendar_addraid_def_starttime'))), 'calendar_addraid_def_starttime' => array('type' => 'timepicker', 'default' => '20:00'), 'calendar_repeat_crondays' => array('type' => 'spinner', 'size' => 5, 'min' => 5, 'step' => 5, 'default' => 40), 'calendar_raid_autoconfirm' => array('type' => 'multiselect', 'options' => $a_groups, 'datatype' => 'int'), 'calendar_raid_autocaddchars' => array('type' => 'multiselect', 'options' => $a_groups, 'datatype' => 'int'), 'calendar_raidleader_autoinvite' => array('type' => 'radio'), 'calendar_raid_notsigned_classsort' => array('type' => 'radio'), 'calendar_raid_coloredclassnames' => array('type' => 'radio'), 'calendar_raid_shownotsigned' => array('type' => 'radio'), 'calendar_raid_allowstatuschange' => array('type' => 'radio'), 'calendar_raid_statuschange_status' => array('type' => 'dropdown', 'options' => $a_calraid_status2, 'datatype' => 'int'))), 'game' => array('game' => array('default_game' => array('type' => 'dropdown', 'options' => $games, 'ajax_reload' => array('game_language', 'manage_settings.php' . $this->SID . '&ajax=games')), 'game_language' => array('type' => 'dropdown', 'options' => array('--------')), 'guildtag' => array('type' => 'text', 'size' => 35))), 'portal' => array('portal' => array('start_page' => array('type' => 'dropdown', 'options' => $startpage_array), 'disable_xframe_header' => array('type' => 'radio'), 'access_control_header' => array('type' => 'textarea', 'cols' => 80, 'rows' => 5)), 'mobile' => array('mobile_template' => array('type' => 'dropdown', 'options' => $mobile_template_array, 'default' => ""), 'mobile_portallayout' => array('type' => 'dropdown', 'options' => $mobile_portallayout_array, 'default' => ""), 'mobile_pagelayout' => array('type' => 'dropdown', 'options' => $mobile_pagelayout_array, 'default' => -1)), 'article' => array('enable_embedly' => array('type' => 'radio'), 'embedly_key' => array('type' => 'text', 'size' => 35), 'thumbnail_defaultsize' => array('type' => 'spinner', 'size' => 3, 'default' => 500, 'step' => 25, 'min' => 25)), 'seo' => array('seo_remove_index' => array('type' => 'radio'), 'seo_extension' => array('type' => 'dropdown', 'options' => array("/", ".html", ".php"))), 'social_sharing' => $arrSocialFields), 'layout' => array('layout' => array('custom_logo' => array('type' => 'imageuploader', 'imgpath' => $this->pfh->FolderPath('', 'files'), 'returnFormat' => 'in_data', 'deletelink' => $this->root_path . 'admin/manage_settings.php' . $this->SID . '&dellogo=true'), 'itemhistory_dia' => array('type' => 'radio')), 'default' => array('default_alimit' => array('type' => 'spinner', 'min' => 10, 'step' => 10), 'default_elimit' => array('type' => 'spinner', 'min' => 10, 'step' => 10), 'default_ilimit' => array('type' => 'spinner', 'min' => 10, 'step' => 10), 'default_nlimit' => array('type' => 'spinner', 'min' => 0), 'default_rlimit' => array('type' => 'spinner', 'min' => 10, 'step' => 10))), 'itemtooltip' => array());
     $this->form->add_tabs($settingsdata);
     // add some additional fields
     // ItemTooltip Inject
     $fields = array('infotooltip_use' => array('type' => 'radio'));
     $this->form->add_fields($fields, 'itemtooltip', 'itemtooltip');
     if (count($this->itt->get_parserlist())) {
         $fields = array('itt_debug' => array('type' => 'radio'), 'itt_trash' => array('type' => 'direct', 'text' => '<input type="submit" name="itt_reset" value="' . $this->user->lang('itt_reset') . '" class="mainoption bi_reset" />'));
         $this->form->add_fields($fields, 'itemtooltip', 'itemtooltip');
         $itt_parserlist = $this->itt->get_parserlist();
         $fields = array('itt_prio1' => array('type' => 'dropdown', 'name' => 'itt_prio1', 'options' => $itt_parserlist), 'itt_prio2' => array('type' => 'dropdown', 'name' => 'itt_prio2', 'options' => $itt_parserlist));
         $this->form->add_fields($fields, 'priorities', 'itemtooltip');
         // TODO: rework this, it overwrites settings of previous parsers (in ittsettdata), mb use ajax-dd
         $ittsettdata = $this->itt->get_extra_settings();
         if (is_array($ittsettdata)) {
             $this->form->add_fields($ittsettdata, 'ittdbsettings', 'itemtooltip');
             //add button to reload defaults
             $this->form->add_field('itt_force_default', array('type' => 'direct', 'text' => '<input type="submit" name="itt_force_default" value="' . $this->user->lang('core_sett_f_itt_force_default') . '" class="mainoption bi_reset" />'), 'ittdbsettings', 'itemtooltip');
         }
         $itt_langlist = $this->itt->get_supported_languages();
         $fields = array();
         for ($i = 1; $i <= 3; $i++) {
             $fields['itt_langprio' . $i] = array('type' => 'dropdown', 'options' => $itt_langlist);
         }
         $this->form->add_fields($fields, 'ittlanguages', 'itemtooltip');
         //check if user wanted to reset itt-cache
         if ($this->in->get('itt_reset', false)) {
             $this->itt->reset_cache();
             $this->core->message($this->user->lang('itt_reset_success'), $this->user->lang('success'), 'green');
         }
         //check if user wanted to reload defaults$
         if ($this->in->get('itt_force_default', '') != '') {
             $this->config->set($this->itt->changed_prio1($this->in->get('default_game'), $this->in->get('itt_prio1')));
             $this->core->message($this->user->lang('itt_default_success'), $this->user->lang('success'), 'green');
         }
     }
     //Own Tooltips
     $fields = array('infotooltip_own_enabled' => array('type' => 'radio', 'dependency' => array(1 => array('infotooltip_own_script', 'infotooltip_own_link'))), 'infotooltip_own_script' => array('type' => 'textarea', 'cols' => 80, 'rows' => 5, 'codeinput' => true), 'infotooltip_own_link' => array('type' => 'textarea', 'cols' => 80, 'rows' => 2, 'codeinput' => true));
     $this->form->add_fields($fields, 'ittownscripts', 'itemtooltip');
     // Importer API Key Wizzard
     $apikey_config = $this->game->get_importers('apikey');
     $setting_apikey = $this->config->get('game_importer_apikey');
     if (($this->game->get_importAuth('a_members_man', 'guild_import') || $this->game->get_importAuth('a_members_man', 'char_mupdate')) && $apikey_config && !defined('GAME_IMPORT_APIKEY')) {
         if ($apikey_config['status'] == 'required' || $apikey_config['status'] == 'optional') {
             if (isset($apikey_config['steps']) && is_array($apikey_config['steps']) && count($apikey_config['steps']) > 0) {
                 $appisetts = array();
                 foreach ($apikey_config['steps'] as $title => $val) {
                     $appisetts[$this->game->glang($title)] = $this->game->glang($val);
                 }
                 // now, let us add the API-Key-Field to the last element of the array
                 $apikeyform = new htext('game_importer_apikey', array('value' => $setting_apikey, 'size' => '30'));
                 end($appisetts);
                 $key = key($appisetts);
                 reset($appisetts);
                 $appisetts[$key] = str_replace('{APIKEY_FORM}', $apikeyform, $appisetts[$key]);
                 $this->form->add_field('settings_apikey', array('type' => 'accordion', 'options' => $appisetts, 'active' => $setting_apikey != '' ? count($appisetts) - 1 : 0), 'importer', 'game');
             }
         }
     }
     // The importer settings
     if ($this->game->get_importAuth('a_members_man', 'guild_import')) {
         if ($this->game->get_importers('guild_imp_rsn') && $this->config->get('servername') == '' || $this->game->get_require_apikey()) {
             $gimport_out = '<input type="button" name="add" value="' . $this->user->lang('uc_bttn_import') . '" disabled="disabled" />';
         } else {
             $gimport_out = '<input type="button" name="add" value="' . $this->user->lang('uc_bttn_import') . '" class="mainoption" onclick="javascript:GuildImport()" />';
         }
         $this->form->add_field('uc_import_guild', array('lang' => 'uc_import_guild', 'type' => 'direct', 'text' => $gimport_out), 'importer', 'game');
     }
     if ($this->game->get_importAuth('a_members_man', 'char_mupdate')) {
         if ($this->game->get_importers('guild_imp_rsn') && $this->config->get('servername') == '' || $this->game->get_require_apikey()) {
             $cupdate_out = '<input type="button" name="add" value="' . $this->user->lang('uc_bttn_update') . '" disabled="disabled" />';
         } else {
             $cupdate_out = '<input type="button" name="add" value="' . $this->user->lang('uc_bttn_update') . '" class="mainoption" onclick="javascript:MassUpdateChars()" />';
         }
         $cupdate_out .= ' [' . ($this->config->get('uc_profileimported') ? $this->user->lang('uc_last_updated') . ': ' . date($this->user->style['date_time'], $this->config->get('uc_profileimported')) : $this->user->lang('uc_never_updated')) . ']';
         $this->form->add_field('uc_update_all', array('lang' => 'uc_update_all', 'type' => 'direct', 'text' => $cupdate_out), 'importer', 'game');
     }
     // Importer cache reset button
     if (($this->game->get_importAuth('a_members_man', 'guild_import') || $this->game->get_importAuth('a_members_man', 'char_mupdate')) && $this->game->get_importers('import_data_cache')) {
         $this->form->add_field('uc_importer_cache', array('lang' => 'uc_importer_cache', 'type' => 'direct', 'text' => '<input type="button" name="add" value="' . $this->user->lang('uc_bttn_resetcache') . '" class="mainoption" onclick="javascript:ClearImportCache()" />'), 'importer', 'game');
     }
     // merge the game admin array to the existing one
     $settingsdata_admin = $this->game->admin_settings();
     if (is_array($settingsdata_admin) && !empty($settingsdata_admin)) {
         $this->form->add_fields($settingsdata_admin, 'gamesettings', 'game');
     }
     //Merge authmethod-settings
     if ($authmethodSettings = $this->user->get_authmethod_settings()) {
         $this->form->add_fields($authmethodSettings, 'auth', 'system');
     }
     //Merge loginmethod-settings
     if ($arrLoginmethodSettings = $this->user->get_loginmethod_settings()) {
         $this->form->add_fields($arrLoginmethodSettings, 'login', 'system');
     }
     //Notifications
     $this->form->add_fields($this->ntfy->getNotificationMethodsAdminSettings(), 'notifications', 'user');
     // Inject Plugin Settings
     // PLACEHOLDER.. maybe we will do that one day...
     // save the setting
     if ($this->in->exists('save_plus') && $this->checkCSRF('display') && !$this->settings_saved) {
         $save_array = $this->form->return_values();
         //check for changed game
         $game_changed = false;
         // add the API key save code
         $save_array['game_importer_apikey'] = $this->in->get('game_importer_apikey', '');
         if ($this->in->get('default_game') != $this->config->get('default_game') || $this->in->get('game_language') != $this->config->get('game_language')) {
             $game_changed = true;
         }
         //check for changed itt 1.prio and load defaults if so
         if ($this->config->get('itt_prio1') != $this->in->get('itt_prio1', '')) {
             $save_array = array_merge($save_array, $this->itt->changed_prio1($this->in->get('default_game'), $this->in->get('itt_prio1')));
         }
         //check for changed disable points
         if ((int) $this->config->get('enable_points') != $this->in->get('enable_points', 1)) {
             if ($this->in->get('enable_points', 1) == 0) {
                 $this->config->set('eqdkp_layout', "nopoints");
             } else {
                 $this->config->set('eqdkp_layout', "normal");
             }
         }
         // Save the settings array
         $this->config->set($save_array);
         // Since ChangeGame alters Config it has to be executed after config-save
         if ($game_changed) {
             $this->game->installGame($this->in->get('default_game'), $this->in->get('game_language'));
             $this->pdc->flush();
             $this->form->reset_fields();
             $this->settings_saved = true;
             $this->display();
             #redirect('admin/manage_settings.php'.$this->SID);		// we need to reload cause of the per-game settings
         }
         //clear cache now
         $this->pdc->flush();
         // The Saved-Message
         $this->core->message($this->user->lang('pk_succ_saved'), $this->user->lang('pk_save_title'), 'green');
     }
     //Hint for ReCaptcha
     if ($this->config->get('enable_captcha') == 1 && !strlen($this->config->get('lib_recaptcha_pkey'))) {
         $this->core->message($this->user->lang('recaptcha_nokeys_hint'), "ReCaptcha", 'red');
     }
     // Output the form, pass values in
     $this->form->output($this->config->get_config());
     $this->core->set_vars(array('page_title' => $this->user->lang('config_title'), 'template_file' => 'admin/manage_settings.html', 'display' => true));
 }
Esempio n. 30
0
 private function get_settingsdata($user_id = -1)
 {
     //Privacy - Phone numbers
     $priv_phone_array = array('0' => $this->user->lang('user_priv_all'), '1' => $this->user->lang('user_priv_user'), '2' => $this->user->lang('user_priv_admin'), '3' => $this->user->lang('user_priv_no'));
     $priv_set_array = array('0' => $this->user->lang('user_priv_all'), '1' => $this->user->lang('user_priv_user'), '2' => $this->user->lang('user_priv_admin'));
     $gender_array = array('0' => "---", '1' => $this->user->lang('adduser_gender_m'), '2' => $this->user->lang('adduser_gender_f'));
     $cfile = $this->root_path . 'core/country_states.php';
     if (file_exists($cfile)) {
         include $cfile;
     }
     // Build language array
     $language_array = array();
     if ($dir = @opendir($this->core->root_path . 'language/')) {
         while ($file = @readdir($dir)) {
             if (!is_file($this->core->root_path . 'language/' . $file) && !is_link($this->core->root_path . 'language/' . $file) && valid_folder($file)) {
                 include $this->core->root_path . 'language/' . $file . '/lang_main.php';
                 $lang_name_tp = $lang['ISO_LANG_NAME'] ? $lang['ISO_LANG_NAME'] . ' (' . $lang['ISO_LANG_SHORT'] . ')' : ucfirst($file);
                 $language_array[$file] = $lang_name_tp;
                 $locale_array[$lang['ISO_LANG_SHORT']] = $lang_name_tp;
             }
         }
     }
     $style_array = array();
     foreach ($this->pdh->get('styles', 'styles', array(0, false)) as $styleid => $row) {
         $style_array[$styleid] = $row['style_name'];
     }
     // hack the birthday format, to be sure there is a 4 digit year in it
     $birthday_format = $this->user->style['date_notime_short'];
     if (stripos($birthday_format, 'y') === false) {
         $birthday_format .= 'Y';
     }
     $birthday_format = str_replace('y', 'Y', $birthday_format);
     $settingsdata = array('registration_information' => array('adduser_tab_registration_information' => array('username' => array('fieldtype' => 'text', 'name' => 'username', 'text' => '<img id="tick_username" src="' . $this->root_path . 'images/register/tick.png" style="display:none;" width="16" height="16" alt="" />', 'size' => 40, 'required' => true, 'id' => 'username'), 'user_email' => array('fieldtype' => 'text', 'name' => 'email_address', 'size' => 40, 'required' => true, 'id' => 'useremail'), 'new_user_password1' => array('fieldtype' => 'password', 'name' => $user_id ? 'new_password' : 'password', 'size' => 40, 'id' => 'password1', 'help' => $user_id ? 'new_password_note' : 'user_creation_password_note'), 'new_user_password2' => array('fieldtype' => 'password', 'name' => 'confirm_password', 'size' => 40, 'help' => $user_id ? 'confirm_password_note' : 'user_creation_password_note', 'id' => 'password2'))), 'profile' => array('adduser_tab_profile' => array('first_name' => array('fieldtype' => 'text', 'name' => 'adduser_first_name', 'size' => 40, 'id' => 'first_name'), 'last_name' => array('fieldtype' => 'text', 'name' => 'adduser_last_name', 'size' => 40), 'gender' => array('fieldtype' => 'dropdown', 'name' => 'adduser_gender', 'options' => $gender_array, 'id' => 'gender'), 'country' => array('fieldtype' => 'dropdown', 'name' => 'adduser_country', 'options' => $country_array, 'no_lang' => true, 'id' => 'country'), 'state' => array('fieldtype' => 'text', 'name' => 'adduser_state', 'options' => $country_array, 'no_lang' => true), 'ZIP_code' => array('fieldtype' => 'int', 'size' => 5, 'name' => 'adduser_ZIP_code'), 'town' => array('fieldtype' => 'text', 'name' => 'adduser_town', 'size' => 40), 'phone' => array('fieldtype' => 'text', 'name' => 'adduser_phone', 'size' => 40, 'help' => 'adduser_foneinfo'), 'cellphone' => array('fieldtype' => 'text', 'name' => 'adduser_cellphone', 'size' => 40, 'help' => 'adduser_cellinfo'), 'icq' => array('fieldtype' => 'text', 'name' => 'adduser_icq', 'size' => 40), 'skype' => array('fieldtype' => 'text', 'name' => 'adduser_skype', 'size' => 40), 'msn' => array('fieldtype' => 'text', 'name' => 'adduser_msn', 'size' => 40), 'irq' => array('fieldtype' => 'text', 'name' => 'adduser_irq', 'size' => 40, 'help' => 'register_help_irc'), 'twitter' => array('fieldtype' => 'text', 'name' => 'adduser_twitter', 'size' => 40), 'facebook' => array('fieldtype' => 'text', 'name' => 'adduser_facebook', 'size' => 40), 'birthday' => array('fieldtype' => 'datepicker', 'name' => 'adduser_birthday', 'allow_empty' => true, 'options' => array('year_range' => '-80:+0', 'change_fields' => true, 'format' => $birthday_format)), 'user_avatar' => array('fieldtype' => 'imageuploader', 'name' => 'user_image', 'imgpath' => $this->pfh->FolderPath('user_avatars', 'eqdkp'), 'options' => array('deletelink' => 'manage_users.php' . $this->SID . '&u=' . $user_id . '&mode=deleteavatar')), 'work' => array('fieldtype' => 'text', 'name' => 'user_work', 'size' => 40), 'interests' => array('fieldtype' => 'text', 'name' => 'user_interests', 'size' => 40), 'hardware' => array('fieldtype' => 'text', 'name' => 'user_hardware', 'size' => 40)), 'user_priv' => array('priv_no_boardemails' => array('fieldtype' => 'checkbox', 'default' => 0, 'name' => 'user_priv_no_boardemails'), 'priv_set' => array('fieldtype' => 'dropdown', 'name' => 'user_priv_set_global', 'options' => $priv_set_array), 'priv_phone' => array('fieldtype' => 'dropdown', 'name' => 'user_priv_tel_all', 'options' => $priv_phone_array), 'priv_nosms' => array('fieldtype' => 'checkbox', 'default' => 0, 'name' => 'user_priv_tel_sms'), 'priv_bday' => array('fieldtype' => 'checkbox', 'default' => 0, 'name' => 'user_priv_bday'))), 'view_options' => array('adduser_tab_view_options' => array('user_alimit' => array('fieldtype' => 'spinner', 'name' => 'adjustments_per_page', 'size' => 5, 'step' => 10, 'id' => 'user_alimit'), 'user_climit' => array('fieldtype' => 'spinner', 'name' => 'characters_per_page', 'size' => 5, 'step' => 10, 'id' => 'user_climit'), 'user_elimit' => array('fieldtype' => 'spinner', 'name' => 'events_per_page', 'size' => 5, 'step' => 10, 'id' => 'user_elimit'), 'user_ilimit' => array('fieldtype' => 'spinner', 'name' => 'items_per_page', 'size' => 5, 'step' => 10, 'id' => 'user_ilimit'), 'user_rlimit' => array('fieldtype' => 'spinner', 'name' => 'raids_per_page', 'size' => 5, 'step' => 10, 'id' => 'user_rlimit'), 'user_nlimit' => array('fieldtype' => 'spinner', 'name' => 'news_per_page', 'size' => 5, 'id' => 'user_nlimit'), 'user_lang' => array('fieldtype' => 'dropdown', 'name' => 'language', 'options' => $language_array), 'user_timezone' => array('fieldtype' => 'dropdown', 'name' => 'user_timezones', 'options' => $this->time->timezones), 'user_style' => array('fieldtype' => 'dropdown', 'name' => 'style', 'options' => $style_array, 'text' => ' (<a href="javascript:template_preview()">' . $this->user->lang('preview') . '</a>)', 'no_lang' => true), 'user_date_time' => array('fieldtype' => 'text', 'name' => 'adduser_date_time', 'size' => 40, 'help' => 'adduser_date_note'), 'user_date_short' => array('fieldtype' => 'text', 'name' => 'adduser_date_short', 'size' => 40, 'help' => 'adduser_date_note'), 'user_date_long' => array('fieldtype' => 'text', 'name' => 'adduser_date_long', 'size' => 40, 'help' => 'adduser_date_note'))));
     return $settingsdata;
 }