Skip to content

Commit

Permalink
Merge pull request #101 from intelliants/develop
Browse files Browse the repository at this point in the history
Minor breadcrumb fix.
  • Loading branch information
vbezruchkin committed Feb 1, 2016
2 parents 3feb7aa + e44e032 commit 3c03bc7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
12 changes: 10 additions & 2 deletions admin/configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected function _indexPage(&$iaView)
}

$groupName = isset($this->_iaCore->requestPath[0]) ? $this->_iaCore->requestPath[0] : 'general';
$groupData = $this->_iaDb->row_bind(iaDb::ALL_COLUMNS_SELECTION, '`name` = :name', array('name' => $groupName), iaCore::getConfigGroupsTable());
$groupData = $this->_getGroupByName($groupName);

if (empty($groupData))
{
Expand Down Expand Up @@ -186,7 +186,7 @@ private function _setGroup(&$iaView, array $groupData)
}
else
{
$title = iaLanguage::get('config_group_' . $groupData['name']);
$title = $groupData['title'];
}

$iaView->title($title);
Expand Down Expand Up @@ -416,6 +416,14 @@ private function _getUsersSpecificConfig()
return ($rows = $this->_iaDb->getKeyValue($sql)) ? $rows : array();
}

protected function _getGroupByName($groupName)
{
$result = $this->_iaDb->row_bind(iaDb::ALL_COLUMNS_SELECTION, '`name` = :name', array('name' => $groupName), iaCore::getConfigGroupsTable());
empty($result) || $result['title'] = iaLanguage::get('config_group_' . $result['name']);

return $result;
}

protected function _updateParam($key, $value)
{
if (in_array($key, $this->_customConfigParams))
Expand Down
11 changes: 5 additions & 6 deletions includes/classes/ia.core.language.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,12 @@ public static function load($languageCode)
{
$iaCore = iaCore::instance();

$stmt = "`code` = :language AND `category` != 'tooltip' AND `category` != :exclusion ORDER BY `extras`";
$iaCore->iaDb->bind($stmt, array(
'language' => $languageCode,
'exclusion' => (iaCore::ACCESS_FRONT == $iaCore->getAccessType()) ? 'admin' : 'frontend'
));
$where = (iaCore::ACCESS_FRONT == $iaCore->getAccessType())
? "`code` = '%s' AND `category` NOT IN('tooltip', 'admin') ORDER BY `extras`"
: "`code` = '%s' AND `category` NOT IN('tooltip', 'frontend', 'page')";
$where = sprintf($where, $languageCode);

self::$_phrases = $iaCore->iaDb->keyvalue(array('key', 'value'), $stmt, self::getTable());
self::$_phrases = $iaCore->iaDb->keyvalue(array('key', 'value'), $where, self::getTable());
}

public static function getPhrases()
Expand Down
6 changes: 2 additions & 4 deletions includes/classes/ia.core.view.php
Original file line number Diff line number Diff line change
Expand Up @@ -861,10 +861,8 @@ public function definePage()
return self::errorPage(self::ERROR_NOT_FOUND);
}

if (!isset($pageParams['title'])) // frontend page
{
$pageParams['title'] = iaLanguage::get(sprintf('page_title_%s', $pageParams['name']));
}
$pageParams['title'] = iaLanguage::get(sprintf('page_title_%s', $pageParams['name']));

if (!isset($pageParams['body']))
{
$pageParams['body'] = isset($pageParams['name']) ? $pageParams['name'] : self::DEFAULT_HOMEPAGE;
Expand Down
1 change: 1 addition & 0 deletions install/dump/install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2229,6 +2229,7 @@ INSERT INTO `{install:prefix}language` (`key`,`value`,`category`) VALUES
('page_title_fields','Fields','admin'),
('page_title_fieldgroups','Field Groups','admin'),
('page_title_hooks','Hooks','admin'),
('page_title_index','Dashboard','admin'),
('page_title_invoices','Invoices','admin'),
('page_title_languages','Languages','admin'),
('page_title_members','Members','admin'),
Expand Down

0 comments on commit 3c03bc7

Please sign in to comment.