diff --git a/admin/configuration.php b/admin/configuration.php index 08582108..ffc236df 100644 --- a/admin/configuration.php +++ b/admin/configuration.php @@ -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)) { @@ -186,7 +186,7 @@ private function _setGroup(&$iaView, array $groupData) } else { - $title = iaLanguage::get('config_group_' . $groupData['name']); + $title = $groupData['title']; } $iaView->title($title); @@ -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)) diff --git a/includes/classes/ia.core.language.php b/includes/classes/ia.core.language.php index 2b563712..28d2f95a 100644 --- a/includes/classes/ia.core.language.php +++ b/includes/classes/ia.core.language.php @@ -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() diff --git a/includes/classes/ia.core.view.php b/includes/classes/ia.core.view.php index cd5f0ab3..a415da97 100644 --- a/includes/classes/ia.core.view.php +++ b/includes/classes/ia.core.view.php @@ -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; diff --git a/install/dump/install.sql b/install/dump/install.sql index 761bda80..7cb81995 100644 --- a/install/dump/install.sql +++ b/install/dump/install.sql @@ -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'),