Subrion - open source content management system
Copyright (C) 2016 Intelliants, LLC
This file is part of Subrion.
Subrion is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Subrion is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Subrion. If not, see .
public function getTitles() { if (is_null(self::$_pageTitles)) { $stmt = '`key` LIKE :key AND `category` = :category AND `code` = :code'; $this->iaDb->bind($stmt, array('key' => 'page_title_%', 'category' => iaLanguage::CATEGORY_PAGE, 'code' => $this->iaView->language)); self::$_pageTitles = $this->iaDb->keyvalue("REPLACE(`key`, 'page_title_', '') `key`, `value`", $stmt, iaLanguage::getTable()); } return self::$_pageTitles; }
private function _setGroup(&$iaView, array $groupData) { $iaItem = $this->_iaCore->factory('item'); if ($this->_type) { $entity = 'user' == $this->_type ? $this->_iaCore->factory('users')->getInfo($this->_typeId) : $this->_iaDb->row(array('name'), iaDb::convertIds($this->_typeId), iaUsers::getUsergroupsTable()); if (!$entity) { return iaView::errorPage(iaView::ERROR_NOT_FOUND); } $title = 'user' == $this->_type ? $entity['fullname'] : iaLanguage::get('usergroup_' . $entity['name']); $title = iaLanguage::getf('custom_configuration_title', array('settings' => $groupData['title'], 'title' => $title, 'type' => strtolower(iaLanguage::get('user' == $this->_type ? 'member' : 'usergroup')))); } else { $title = $groupData['title']; } $iaView->title($title); if ($groupData['extras']) { $iaPage = $this->_iaCore->factory('page', iaCore::ADMIN); $activeMenu = $groupData['name']; if ($groupData['extras'] == $this->_iaCore->get('tmpl')) { // template configuration options $page = $iaPage->getByName('templates'); $iaView->set('group', $page['group']); $iaView->set('active_config', $groupData['name']); iaBreadcrumb::add($page['title'], IA_ADMIN_URL . $page['alias']); } elseif ($pluginPage = $this->_iaDb->row(array('alias', 'group'), iaDb::printf("`name` = ':name' OR `name` = ':name_stats'", array('name' => $groupData['extras'])), iaPage::getAdminTable())) { // it is a package $iaView->set('group', $pluginPage['group']); $iaView->set('active_config', $groupData['name']); $activeMenu = null; iaBreadcrumb::insert($groupData['title'], IA_ADMIN_URL . $pluginPage['alias'], iaBreadcrumb::POSITION_FIRST); } elseif ($iaItem->isExtrasExist($groupData['extras'], iaItem::TYPE_PLUGIN)) { // plugin with no admin pages $iaView->set('group', 5); $iaView->set('active_config', $groupData['extras']); } } else { $activeMenu = 'configuration_' . $groupData['name']; iaBreadcrumb::toEnd($groupData['title'], IA_SELF); } $iaView->set('active_menu', $activeMenu); }
private function _getJsonPlugins() { $sql = 'SELECT ' . "IF(p.`extras` = '', 'core', p.`extras`) `value`, " . "IF(p.`extras` = '', 'Core', g.`title`) `title` " . 'FROM `:prefix:pages` p ' . 'LEFT JOIN `:prefixextras` g ON (g.`name` = p.`extras`) ' . 'GROUP BY p.`extras`'; $sql = iaDb::printf($sql, array('prefix' => $this->_iaDb->prefix, 'pages' => iaPage::getTable())); return array('data' => $this->_iaDb->getAll($sql)); }
private function _setGroup(&$iaView, &$iaItem, array $groupData) { $iaView->title($groupData['title']); if ($groupData['extras']) { $iaPage = $this->_iaCore->factory('page', iaCore::ADMIN); $activeMenu = $groupData['name']; if ($groupData['extras'] == $this->_iaCore->get('tmpl')) { // template configuration options $page = $iaPage->getByName('templates'); $iaView->set('group', $page['group']); $iaView->set('active_config', $groupData['name']); iaBreadcrumb::add($page['title'], IA_ADMIN_URL . $page['alias']); } elseif ($pluginPage = $this->_iaDb->row(array('alias', 'group'), iaDb::printf("`name` = ':name' OR `name` = ':name_stats'", array('name' => $groupData['extras'])), iaPage::getAdminTable())) { // it is a package $iaView->set('group', $pluginPage['group']); $iaView->set('active_config', $groupData['name']); $activeMenu = null; iaBreadcrumb::insert($groupData['title'], IA_ADMIN_URL . $pluginPage['alias'], iaBreadcrumb::POSITION_FIRST); } elseif ($iaItem->isExtrasExist($groupData['extras'], iaItem::TYPE_PLUGIN)) { // plugin with no admin pages $iaView->set('group', 5); $iaView->set('active_config', $groupData['extras']); } } else { $activeMenu = 'configuration_' . $groupData['name']; iaBreadcrumb::toEnd($groupData['title'], IA_SELF); } $iaView->set('active_menu', $activeMenu); }