Skip to content

Commit

Permalink
issue #287
Browse files Browse the repository at this point in the history
  • Loading branch information
butschster committed Oct 19, 2014
1 parent dfc201e commit 039ddd5
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 15 deletions.
6 changes: 5 additions & 1 deletion cms/modules/installer/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@

if (PHP_SAPI != 'cli')
{
if (!URL::match('install', Request::detect_uri()))
if (
!URL::match('install', Request::detect_uri())
AND
!URL::match('cms/media/', Request::detect_uri())
)
{
$uri = Route::get('install')->uri();
}
Expand Down
11 changes: 2 additions & 9 deletions cms/modules/installer/classes/controller/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,8 @@ public function action_error()

public function action_index()
{
Assets::js('steps', ADMIN_RESOURCES . 'libs/steps/jquery.steps.min.js', 'jquery');
Assets::js('validate', ADMIN_RESOURCES . 'libs/validation/jquery.validate.min.js', 'jquery');
Assets::js('validate.localization', ADMIN_RESOURCES . 'libs/validation/localization/messages_' . I18n::lang_short() . '.min.js', 'validate');

Assets::package('select2');

Assets::js('install', ADMIN_RESOURCES . 'js/install.js', 'global');
Assets::css('install', ADMIN_RESOURCES . 'css/install.css', 'global');

Assets::package(array('select2', 'validate', 'install', 'steps'));

$this->template->title = __(':cms_name › installation', array(':cms_name' => CMS_NAME));

$data = array(
Expand Down
5 changes: 5 additions & 0 deletions cms/modules/installer/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@

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');
2 changes: 1 addition & 1 deletion cms/modules/installer/media/js/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cms.addTranslation({

$(function() {
$('#wizard').on('change', '#current-lang', function() {
window.location = '/install/index?lang=' + $(this).val();
window.location = '?lang=' + $(this).val();
})

var password_generator_status = function() {
Expand Down
7 changes: 7 additions & 0 deletions cms/modules/kodicms/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,18 @@
->js('ace-library', ADMIN_RESOURCES . 'libs/ace/src-min/ace.js', 'global')
->js(NULL, ADMIN_RESOURCES . 'js/ace.js', 'global');

Assets_Package::add('steps')
->js(NULL, ADMIN_RESOURCES . 'libs/steps/jquery.steps.min.js', 'jquery');

WYSIWYG::add('ace');

// Подключение пакета после загрузки модулей, чтобы определить текущий язык
Observer::observe('modules::after_load', function() {
Assets_Package::add('select2')
->js(NULL, ADMIN_RESOURCES . 'libs/select2/select2.min.js', 'jquery')
->js(NULL . I18n::lang_short(), ADMIN_RESOURCES . 'libs/select2/select2_locale_'.I18n::lang_short().'.js', 'select2');

Assets_Package::add('validate')
->js(NULL, ADMIN_RESOURCES . 'libs/validation/jquery.validate.min.js', 'jquery')
->js(NULL . I18n::lang_short(), ADMIN_RESOURCES . 'libs/validation/localization/messages_' . I18n::lang_short() . '.min.js', 'validate');
});
6 changes: 3 additions & 3 deletions cms/modules/kodicms/views/system/layout/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ul class="navigation">
<?php foreach ($navigation->get_pages() as $item): ?>
<li <?php if($item->is_active()): ?>class="active"<?php endif; ?>>
<a href="/<?php echo $item->url(); ?>">
<a href="<?php echo $item->url(); ?>">
<?php if($item->icon): ?><?php echo UI::icon($item->icon . ' menu-icon'); ?> <?php endif; ?>
<span class="mm-text"><?php echo $item->name(); ?></span>
</a>
Expand All @@ -20,7 +20,7 @@
<ul>
<?php foreach ($section as $item): ?>
<li <?php if($item->is_active()): ?>class="active"<?php endif; ?>>
<a href="/<?php echo $item->url(); ?>">
<a href="<?php echo $item->url(); ?>">
<?php if($item->icon): ?><?php echo UI::icon($item->icon . ' menu-icon'); ?> <?php endif; ?>
<span class="mm-text"><?php echo $item->name(); ?></span>
</a>
Expand All @@ -38,7 +38,7 @@
<ul>
<?php foreach ($sub_section as $sub_item): ?>
<li <?php if($sub_item->is_active()): ?>class="active"<?php endif; ?>>
<a href="/<?php echo $sub_item->url(); ?>">
<a href="<?php echo $sub_item->url(); ?>">
<?php if($sub_item->icon): ?><?php echo UI::icon($sub_item->icon . ' menu-icon'); ?> <?php endif; ?>
<span class="mm-text"><?php echo $sub_item->name(); ?></span>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function name()
*/
public function url()
{
return Arr::get($this->_params, 'url');
return URL::site(Arr::get($this->_params, 'url'));
}

/**
Expand Down

0 comments on commit 039ddd5

Please sign in to comment.