/** * System front end theme function * * @author Vee W. * @license http://opensource.org/licenses/MIT * */ function languageSwitchDropdown() { $languages = \Config::get('locales'); // no languages, language is empty, there is only just one language if (empty($languages) || !is_array($languages) || count($languages) <= 1) { return null; } ksort($languages); $current_lang = \Lang::get_lang(); $output = "\n" . '<div class="dropdown">' . "\n"; $output .= "\t" . '<button class="btn btn-default dropdown-toggle" type="button" id="language-switch-dropdown" data-toggle="dropdown">'; $output .= $languages[$current_lang]['name']; $output .= '<span class="caret"></span>'; $output .= '</button>' . "\n"; if (is_array($languages) && !empty($languages) && count($languages) > 1) { $output .= '<ul class="dropdown-menu" role="menu" aria-labelledby="language-switch-dropdown">' . "\n"; foreach ($languages as $language => $item) { if ($language != $current_lang) { $output .= "\t" . '<li>' . \Html::anchor(\Uri::createNL($language), $item['name']) . '</li>' . "\n"; } } $output .= '</ul>' . "\n"; } $output .= '</div>' . "\n"; return $output; }
echo $theme->asset->render('fuelstart'); ?> <script type="text/javascript"> // required js variables for use in .js file. var base_url = '<?php echo \Uri::base(false); ?> '; var site_url = '<?php echo getRootSiteURL(); ?> '; var theme_assets = '<?php echo Uri::createNL(\Theme::instance()->asset_path('')); ?> '; var csrf_name = '<?php echo \Config::get('security.csrf_token_key'); ?> '; var nocsrf_val = '<?php echo \Extension\NoCsrf::generate('', true); ?> '; </script> </head> <body class="html-body<?php echo $pc_class . ' ' . $page_class; ?>
/** * language switch for admin page. display as select box. * * @return string */ function languageSwitchAdminSelectBox() { $languages = \Config::get('locales'); ksort($languages); $current_lang = \Lang::get_lang(); $output = "\n" . '<select name="admin_language" onchange="change_redirect($(this));" class="form-control chosen-select">' . "\n"; if (is_array($languages) && !empty($languages)) { foreach ($languages as $language => $item) { $output .= "\t" . '<option value="' . \Uri::createNL($language . '/admin') . '"'; if ($language == $current_lang) { $output .= ' selected="selected"'; } $output .= '>' . $item['name'] . '</option>' . "\n"; } } else { $output .= "\t" . '<option></option>' . "\n"; } $output .= '</select>' . "\n"; unset($current_lang, $languages); return $output; }
echo __('account_avatar'); ?> :</label> <div class="col-sm-7"> <?php if (isset($account_avatar) && $account_avatar != null) { ?> <div class="current-avatar"> <a href="#" class="btn btn-danger btn-xs" onclick="return ajaxDeleteAvatar();"><span class="glyphicon glyphicon-remove"></span> <?php echo __('account_delete_avatar'); ?> </a> <span class="remove-avatar-status"></span> <img src="<?php echo \Uri::createNL($account_avatar); ?> " alt="" class="img-responsive" /> </div> <?php } // endif $account_avatar; ?> <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $avatar_size * 1024; // KB to Bytes ?> " /> <?php echo \Form::file('account_avatar', array('id' => 'account_avatar'));