Technik
ON-OFF
25.12.2013 19:54:28
Poland
|
|
Link: http://poligon.ricoroco.com/fora/smf/index.php?topic=25.msg878#msg878
Post #12 |
|
Żeby nie zaśmiecać forum dopisze się do tego wątku jako że też chodzi o nowy przycisk tylko w stylu DS Natural. A mianowicie, chce dodać na belce menu możliwość wyboru języka: angielskiego i polskiego. Jako, że w index.template.php od DS nie ma możliwości konfiguracji tych buttonów wyczytałem u nich, że ten styl korzysta z Subs.php z pliku default. No i rzeczywiście znalazłem tam funkcje od buttonów tylko teraz nie wiem jak się do tego zabrać. Co lepsze skomplikowałem sobie sprawę bo chciałbym aby zamiast tekstu pojawiały się ikony czyl flaga ENG i flaga PL po naciśnięciu na którą dokonywał by się wybór języka. To jest ta część z Subs.php od buttonów: // All the buttons we can possible want and then some, try pulling the final list of buttons from cache first. if (($buttonData = cache_get_data ('menu_buttons-' . implode('_', $user_info['groups']) . '-' . $user_info['language'], $cacheTime)) === null || time() - $cacheTime <= $modSettings['settings_updated']) { $buttons = array( 'home' => array( 'title' => $txt['home'], 'href' => $scripturl, 'show' => true, 'sub_buttons' => array( ), ), 'custom' => array( 'title' => !empty($modSettings['custom_tab_label']) ? $modSettings['custom_tab_label'] : $txt['custom_tab_label_default'], 'href' => !empty($modSettings['custom_tab_execute_url']) ? $modSettings['custom_tab_execute_url'] : $scripturl, 'show' => $user_info['is_guest'] ? !empty($modSettings['custom_tab_enable_guest_access']) : !empty($modSettings['custom_tab_enable_member_access']), 'sub_buttons' => array( ), ), 'admin' => array( 'title' => $txt['admin'], 'href' => $scripturl . '?action=admin', 'show' => $context['allow_admin'], 'sub_buttons' => array( 'featuresettings' => array( 'title' => $txt['modSettings_title'], 'href' => $scripturl . '?action=admin;area=featuresettings', 'show' => allowedTo ('admin_forum'), ), 'packages' => array( 'title' => $txt['package'], 'href' => $scripturl . '?action=admin;area=packages', 'show' => allowedTo ('admin_forum'), ), 'errorlog' => array( 'title' => $txt['errlog'], 'href' => $scripturl . '?action=admin;area=logs;sa=errorlog;desc', 'show' => allowedTo ('admin_forum') && !empty($modSettings['enableErrorLogging']), ), 'permissions' => array( 'title' => $txt['edit_permissions'], 'href' => $scripturl . '?action=admin;area=permissions', 'show' => allowedTo ('manage_permissions'), ), ), ), 'moderate' => array( 'title' => $txt['moderate'], 'href' => $scripturl . '?action=moderate', 'show' => $context['allow_moderation_center'], 'sub_buttons' => array( 'modlog' => array( 'title' => $txt['modlog_view'], 'href' => $scripturl . '?action=moderate;area=modlog', 'show' => !empty($modSettings['modlog_enabled']), ), 'poststopics' => array( 'title' => $txt['mc_unapproved_poststopics'], 'href' => $scripturl . '?action=moderate;area=postmod;sa=posts', 'show' => $modSettings['postmod_active'], ), 'attachments' => array( 'title' => $txt['mc_unapproved_attachments'], 'href' => $scripturl . '?action=moderate;area=attachmod;sa=attachments', 'show' => $modSettings['postmod_active'], ), 'reports' => array( 'title' => $txt['mc_reported_posts'], 'href' => $scripturl . '?action=moderate;area=reports', 'show' => true, ), ), ), 'profile' => array( 'title' => $txt['profile'], 'href' => $scripturl . '?action=profile', 'show' => $context['allow_edit_profile'], 'sub_buttons' => array( 'summary' => array( 'title' => $txt['summary'], 'href' => $scripturl . '?action=profile', 'show' => true, ), 'account' => array( 'title' => $txt['account'], 'href' => $scripturl . '?action=profile;area=account', 'show' => allowedTo (array('profile_identity_any', 'profile_identity_own', 'manage_membergroups')), ), 'profile' => array( 'title' => $txt['forumprofile'], 'href' => $scripturl . '?action=profile;area=forumprofile', 'show' => allowedTo (array('profile_extra_any', 'profile_extra_own')), ), ), ), 'mlist' => array( 'title' => $txt['members_title'], 'href' => $scripturl . '?action=mlist', 'show' => $context['allow_memberlist'], 'sub_buttons' => array( 'mlist_view' => array( 'title' => $txt['mlist_menu_view'], 'href' => $scripturl . '?action=mlist', 'show' => true, ), 'mlist_search' => array( 'title' => $txt['mlist_search'], 'href' => $scripturl . '?action=mlist;sa=search', 'show' => true, ), ), ), 'login' => array( 'title' => $txt['login'], 'href' => $scripturl . '?action=login', 'show' => $user_info['is_guest'], 'sub_buttons' => array( ), ), 'register' => array( 'title' => $txt['register'], 'href' => $scripturl . '?action=register', 'show' => $user_info['is_guest'], 'sub_buttons' => array( ), 'is_last' => true, ), 'logout' => array( 'title' => $txt['logout'], 'href' => $scripturl . '?action=logout;%1$s=%2$s', 'show' => !$user_info['is_guest'], 'sub_buttons' => array( ), 'is_last' => true, ), ); $load_menu_js = false; // Now we put the buttons in the context so the theme can use them. $menu_buttons = array(); foreach ($buttons as $act => $button) if (!empty($button['show'])) { $button['active_button'] = false; // Make sure the last button truely is the last button. if (!empty($button['is_last'])) { if (isset($last_button)) unset($menu_buttons[$last_button]['is_last']); $last_button = $act; } // Go through the sub buttons if there are any. if (!empty($button['sub_buttons'])) foreach ($button['sub_buttons'] as $key => $subbutton) { if (empty($subbutton['show'])) unset($button['sub_buttons'][$key]); } // If this still has some sub buttons then we need to tell the template to load the menu javascript file. if (!empty($button['sub_buttons'])) $load_menu_js = true; $menu_buttons[$act] = $button; } $buttonData = array($menu_buttons, $load_menu_js); if (!empty($modSettings['cache_enable']) && $modSettings['cache_enable'] >= 2) cache_put_data ('menu_buttons-' . implode('_', $user_info['groups']) . '-' . $user_info['language'], $buttonData, $cacheTime); } list($context['menu_buttons'], $context['load_menu_js']) = $buttonData; // Created by GeSHi 1.0.8.10 | code: -› [code=PHP] | load:0.060s | speed:97.73 KB/s No więc akcja odnosiła by się ?language=english i ?language=polish. I teraz nie wiem jak się do tego zabrać zwłaszcza, że chodzi mi o pokazywanie się tych flag a nie tekst. Będę wdzięczny za jakieś wskazówki Pozdro
Attention! Testing modifications - Steam Profile
|