Beispiel #1
0
 public function get_available_langs()
 {
     $langs = I18n::available_langs();
     $system_default = Arr::get($langs, Config::get('site', 'default_locale'));
     $langs[Model_User::DEFAULT_LOCALE] = __('System default (:locale)', array(':locale' => $system_default));
     return $langs;
 }
Beispiel #2
0
 protected function _execute(array $params)
 {
     if ($params['db_driver'] === NULL) {
         $params['db_driver'] = Minion_CLI::read(__('Please enter database driver (:types)', array(':types' => implode(', ', array_keys($this->_installer->database_drivers())))));
     }
     if ($params['locale'] === NULL) {
         $params['locale'] = Minion_CLI::read(__('Please enter locale (:types)', array(':types' => implode(', ', array_keys(I18n::available_langs())))));
     }
     if ($params['db_name'] === NULL) {
         $params['db_name'] = Minion_CLI::read(__('Please enter database name'));
     }
     if ($params['timezone'] === NULL) {
         $answer = Minion_CLI::read(__('Select current timezone automaticly (:current)', array(':current' => date_default_timezone_get())), array('y', 'n'));
         if ($answer == 'y') {
             $params['timezone'] = date_default_timezone_get();
         } else {
             $params['timezone'] = Minion_CLI::read(__('Please enter current timezone (:site)', array(':site' => 'http://www.php.net/manual/en/timezones.php')), DateTimeZone::listIdentifiers());
         }
     }
     if ($params['cache_type'] === NULL) {
         $params['cache_type'] = Minion_CLI::read(__('Please enter cache type (:types)', array(':types' => implode(', ', array_keys($this->_installer->cache_types())))));
     }
     if ($params['session_type'] === NULL) {
         $session_types = Kohana::$config->load('installer')->get('session_types', array());
         $params['session_type'] = Minion_CLI::read(__('Please enter session type (:types)', array(':types' => implode(', ', array_keys($this->_installer->session_types())))));
     }
     if ($params['password'] !== NULL) {
         unset($params['password_generate']);
         $params['password_field'] = $params['password_confirm'] = $params['password'];
     }
     try {
         $this->_installer->install($params);
         Observer::notify('after_install', $params);
         Cache::clear_file();
         Minion_CLI::write('==============================================');
         Minion_CLI::write(__('KodiCMS installed successfully'));
         Minion_CLI::write('==============================================');
         $install_data = Session::instance()->get_once('install_data');
         Minion_CLI::write(__('Login: :login', array(':login' => Arr::get($install_data, 'username'))));
         Minion_CLI::write(__('Password: :password', array(':password' => Arr::get($install_data, 'password_field'))));
     } catch (Exception $e) {
         Minion_CLI::write(__(':text | :file [:line]', array(':text' => $e->getMessage(), ':file' => $e->getFile(), ':line' => $e->getLine())));
     }
 }
Beispiel #3
0
	</div>

	<div class="panel-heading" data-icon="globe">
		<span class="panel-title"><?php 
echo __('Regional settings');
?>
</span>
	</div>
	<div class="panel-body">
		<div class="form-group">
			<?php 
echo Form::label('setting_default_locale', __('Default interface language'), array('class' => 'control-label col-md-4'));
?>
			<div class="col-md-3">
				<?php 
echo Form::select('setting[site][default_locale]', I18n::available_langs(), Config::get('site', 'default_locale'), array('id' => 'setting_default_locale', 'class' => 'form-control'));
?>
			</div>
		</div>

		<div class="form-group">
			<?php 
echo Form::label('setting_date_format', __('Date format'), array('class' => 'control-label col-md-4'));
?>
			<div class="col-md-3">
				<?php 
echo Form::select('setting[site][date_format]', $dates, Config::get('site', 'date_format'), array('id' => 'setting_date_format'));
?>
			</div>
		</div>
	</div>
Beispiel #4
0
<?php

defined('SYSPATH') or die('No direct script access.');
define('INSTALL_DATA', MODPATH . 'installer' . DIRECTORY_SEPARATOR . 'install' . DIRECTORY_SEPARATOR);
if (array_key_exists(Arr::get($_GET, 'lang'), I18n::available_langs())) {
    I18n::lang(Arr::get($_GET, 'lang'));
} else {
    I18n::lang(I18n::detect_lang());
}
try {
    date_default_timezone_get();
} catch (Exception $e) {
    date_default_timezone_set('UTC');
}
Database::$default = 'install';
Route::set('install', 'install(/<action>(/<id>))')->defaults(array('controller' => 'install', 'action' => 'error'));
Assets_Package::add('install')->js(NULL, ADMIN_RESOURCES . 'js/install.js', 'global')->css(NULL, ADMIN_RESOURCES . 'css/install.css', 'global');
Beispiel #5
0
			<div class="panel-heading" data-icon="globe">
				<span class="panel-title"><?php 
echo __('Regional settings');
?>
</span>
			</div>
			<div class="panel-body">
				
				<div class="form-group">
					<label class="control-label col-md-3"><?php 
echo __('Interface language');
?>
</label>
					<div class="col-md-3">
						<?php 
echo Form::select('install[locale]', I18n::available_langs(), Arr::get($data, 'locale'));
?>
					</div>
				</div>
				
				<div class="form-group">
					<label class="control-label col-md-3"><?php 
echo __('Timezone');
?>
</label>
					<div class="col-md-3">
						<?php 
echo Form::select('install[timezone]', Date::timezones(), Arr::get($data, 'timezone'));
?>
					</div>
				</div>