Skip to content
This repository has been archived by the owner on Jun 4, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2 from nixsolutions/master
Browse files Browse the repository at this point in the history
Pull requests
  • Loading branch information
naxel committed Oct 21, 2013
2 parents 958f3e7 + 5c50cab commit 9eada79
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 65 deletions.
1 change: 1 addition & 0 deletions application/configs/application.yaml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ production:
disableNotices: on
logUntranslated: off
logMessage: Undefined message '%message%' in '%locale%'
content: APPLICATION_PATH/../data/languages
locale: on
modules: on
layout:
Expand Down
12 changes: 9 additions & 3 deletions application/helpers/DataTables.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,14 @@ public function direct(Zend_Db_Table_Select $select, $columns = null)
} else {
$select->from($tableName, $expr);
}
$iFilteredTotal = $table->fetchRow($select)->total;


/* Data no result */
if($iFilteredTotal = $table->fetchRow($select)){
$iFilteredTotal = $iFilteredTotal->total;
}else{
$iFilteredTotal = 0;
}

$query->limit(
$request->getParam('iDisplayLength'),
$request->getParam('iDisplayStart')
Expand All @@ -95,4 +101,4 @@ public function direct(Zend_Db_Table_Select $select, $columns = null)
"iTotalDisplayRecords" => $iFilteredTotal
);
}
}
}
2 changes: 1 addition & 1 deletion application/helpers/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function getNamespace($namespace)
*/
public function setNamespace($namespace, array $options)
{
Options_Model_Options_Manager::getNamespace($namespace, $options);
Options_Model_Options_Manager::setNamespace($namespace, $options);
}

/**
Expand Down
2 changes: 0 additions & 2 deletions application/layouts/scripts/dashboard/partial/head.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
<link rel="shortcut icon" type="image/x-icon" href="<?=$this->baseUrl('favicon.ico')?>" />
<link rel="stylesheet" href="<?=$this->baseUrl('/css/dashboard/styles.css')?>" />
<link rel="stylesheet" href="<?=$this->baseUrl('/css/bootstrap.css')?>" />
<!-- <link rel="stylesheet" href="--><?//=$this->baseUrl('/css/jquery-ui.css')?><!--" />-->
<script src="<?=$this->baseUrl('/js/jquery/jquery.js')?>" ></script>
<script src="<?=$this->baseUrl('/js/bootstrap.js')?>" ></script>
<!-- <script src="--><?//=$this->baseUrl('/js/jquery/jquery-ui.js')?><!--" ></script>-->
<script src="<?=$this->baseUrl('/js/ready.js')?>" ></script>
<script src="<?=$this->baseUrl('/js/messages.js')?>" ></script>
<!--[if lt IE 9]>
Expand Down
2 changes: 0 additions & 2 deletions application/layouts/scripts/install/partial/head.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
<link rel="profile" href="http://gmpg.org/xfn/11"/>
<link rel="stylesheet" href="<?=$this->baseUrl('/css/install/styles.css')?>" />
<link rel="stylesheet" href="<?=$this->baseUrl('/css/bootstrap.css')?>" />
<!-- <link rel="stylesheet" href="--><?//=$this->baseUrl('/css/jquery-ui.css')?><!--" />-->
<link rel="shortcut icon" type="image/x-icon" href="<?=$this->baseUrl('favicon.ico')?>" />
<script src="<?=$this->baseUrl('/js/jquery/jquery.js')?>" ></script>
<script src="<?=$this->baseUrl('/js/bootstrap.js')?>" ></script>
<!-- <script src="--><?//=$this->baseUrl('/js/jquery/jquery-ui.js')?><!--" ></script>-->
<script src="<?=$this->baseUrl('/js/ready.js')?>" ></script>
<script src="<?=$this->baseUrl('/js/messages.js')?>" ></script>
<!--[if lt IE 9]>
Expand Down
22 changes: 17 additions & 5 deletions application/modules/install/controllers/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -445,11 +445,17 @@ public function modulesAction()

}
$this->view->modules = $modules;
$this->view->isDisabled = !$isWritableModulesDir;

if ($this->_request->isPost()) {
if ($this->_request->isPost() && !$this->_request->getParam('refresh')) {

if ($this->_request->getParam('modules')) {
$installModules = array_merge($installModules, $this->_request->getParam('modules'));
} elseif ($this->_request->getParam('isDisabled')) {
// In case if the selection of modules has been locked
foreach ($modules as $module => $value) {
$installModules[$module] = true;
}
}

$this->_store->modules = $installModules;
Expand Down Expand Up @@ -509,11 +515,17 @@ public function finishAction()
$writer->write($filename);
$this->_store->unsetAll();

//TODO remove install module
//remove install module

$this->_helper->flashMessenger(
"Installization complete <br /> " . $this->view->__('And remove module Install')
);
$pathToModules = APPLICATION_PATH . '/modules/';
$module = 'install';
$pathToModule = $pathToModules . $module;
if (is_dir($pathToModules) && is_writable($pathToModules) && is_dir($pathToModule)) {
rename($pathToModule, APPLICATION_PATH . '/modules/.' . $module);
$this->_helper->flashMessenger($this->view->__('Remove module Install'));
}

$this->_helper->flashMessenger("Installation complete");
$this->_helper->redirector(false, false, false);
} else {
$this->view->filename = $filename;
Expand Down
4 changes: 4 additions & 0 deletions application/modules/install/views/scripts/index/finish.phtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<h2><?php echo $this->__('Can not create config file')?></h2>
<hr/>
<article>
<p class="alert alert-info">
<?php echo $this->__('To create a configuration file, the directory in which it is located, should have the right to write')?>
<code><?php echo 'chmod 777 ' . APPLICATION_PATH . '/configs/';?></code>
</p>
<p class="alert">
<?php echo $this->__('Paste following code into configuration file')?>:
<br/>
Expand Down
10 changes: 7 additions & 3 deletions application/modules/install/views/scripts/index/modules.phtml
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
<h2><?php echo $this->__('Install modules')?>:</h2>
<form action="" method="post">
<article>

<?php if($this->isDisabled):?>
<input type="hidden" name="isDisabled" value="<?=$this->isDisabled?>">
<p class="alert alert-info">
To be able to disable some modules directory in which it is located shall have the right to write
<?php echo $this->__('To be able to disable some modules directory in which it is located shall have the right to write')?>
<code><?php echo 'chmod 777 ' . APPLICATION_PATH . '/modules/';?></code>
</p>
<?php endif;?>


<ul>
<?php foreach ($this->modules as $module => $options): ?>
<li>
<input type="checkbox" <?php echo $options['checked'] ? 'checked="checked"' : ''; ?> <?php echo $options['required'] ? 'disabled="disabled"' : ''; ?> name="modules[<?php echo $module; ?>]" value="1" />
<?php echo $options['title'];?>
<?php echo $options['required'];?>
<?php echo " - "; ?>
<em><?php echo $options['description'];?></em>
</li>
<?php endforeach;?>
</ul>
</article>

<input type="submit" name="refresh" id="refresh" class="btn btn-primary" value="Reload page &raquo;">
<input type="submit" name="submit" id="submit" class="btn btn-primary pull-right" value="Next &raquo;">
</form>
2 changes: 0 additions & 2 deletions application/modules/translate/models/Translate.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
*/
class Translate_Model_Translate extends Core_Db_Table_Row_Abstract
{
const ADAPTER = 'Core_Translate_ModularAdapter_Array';


public static function getTranslation($locale)
{
Expand Down
9 changes: 5 additions & 4 deletions library/Core/Application/Resource/Translate.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,20 @@
class Core_Application_Resource_Translate
extends Zend_Application_Resource_Translate
{
const DEFAULT_ADAPTER = 'Core_Translate_ModularAdapter_Array';

/**
* Init Resource
* @return \Zend_Translate
*/
public function init()
{
//return;
if (!isset($this->_options['content'], $this->_options['data'])) {

if (!isset($this->_options['data'])) {

$this->getBootstrap()->bootstrap('Modules');

$this->_options['content'] = Translate_Model_Translate::getTranslationPath();
$this->_options['adapter'] = Translate_Model_Translate::ADAPTER;
$this->_options['adapter'] = self::DEFAULT_ADAPTER;
}

$log = $this->getBootstrap()->bootstrap('frontController')->getResource('log');
Expand Down
4 changes: 4 additions & 0 deletions public/css/install/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ article {
padding: 0;
margin:0
}
article ul.errors li {
color: #FF0000;
font-size: 80%;
}
article blockquote {
margin: 8px 0;
}
Expand Down
43 changes: 0 additions & 43 deletions public/modules/menu/scripts/management/index.js

This file was deleted.

0 comments on commit 9eada79

Please sign in to comment.