- Added new FilterWidget in the Administration menu for the phrases

- Extension installer is visible only for system/extensions
- Removed the old phrases editor from Vilesci
- system/checksystem.php does not call anymore system/phrasesupdate.php
- system/phrasesupdate.php has been removed
- Added new directory application/phrases
- application/phrases contains one file for each phrases category, and one file contains all the phrases for that category
- Added new controller system/phrases/Manager to install phrases in the core
- Added new constants CORE_PHRASES_DIRECTORY, INSERT_BY, APP, CATEGORY, PHRASE, SPRACHE, TEXT and DESCRIPTION to libraries/PhrasesLib
- libraries/PhrasesLib now loads EPrintfLib
- Removed public methods getPhraseByApp, getPhraseInhalt, delPhrasentext, savePhrase, getPhrasentextById, insertPhraseinhalt, getVorlagetextById and updatePhraseInhalt from libraries/PhrasesLib
- Renamed public method getJSON to toJSON in libraries/PhrasesLib
- Added new public methods installFromCore and installFrom to libraries/PhrasesLib
- Added new private methods _installPhrases and _addPhrases to libraries/PhrasesLib
This commit is contained in:
Paolo
2021-11-16 17:22:24 +01:00
parent 63105951a0
commit d7b700f781
38 changed files with 12498 additions and 14401 deletions
+21 -1
View File
@@ -15,6 +15,8 @@ class ExtensionsLib
const EXTENSION_JSON_NAME = 'extension.json'; // file that contains extension data
const EXTENSIONS_DIR_NAME = 'extensions'; // name of the directories where will be created the symlinks
const PHRASES_DIRECTORY = 'phrases/'; // directory name where phrases files are
private $_ci;
private $ARCHIVE_EXTENSIONS = array('.tgz', '.tbz2'); // accepted file extensions for an uploaded extension
@@ -37,6 +39,7 @@ class ExtensionsLib
{
$this->UPLOAD_PATH = APPPATH.'tmp/';
$this->EXTENSIONS_PATH = APPPATH.'extensions/';
// Get code igniter instance
$this->_ci =& get_instance();
@@ -45,6 +48,8 @@ class ExtensionsLib
// Loads EPrintfLib
$this->_ci->load->library('EPrintfLib');
// Loads PhrasesLib
$this->_ci->load->library('PhrasesLib');
// Loading models
$this->_ci->load->model('system/Extensions_model', 'ExtensionsModel');
@@ -116,7 +121,7 @@ class ExtensionsLib
if (!$this->_errorOccurred) // if no error occurred
{
// Loads and executes neede SQL scripts
// Loads and executes the needed SQL scripts
$this->_loadSQLs(
$this->UPLOAD_PATH.$extensionJson->name.'/'.ExtensionsLib::SQL_DIRECTORY,
$extensionJson
@@ -134,6 +139,12 @@ class ExtensionsLib
// Create the symlinks to the installed extension
$this->_createSymLinks($extensionJson->name);
}
if (!$this->_errorOccurred) // if no error occurred
{
// Create the symlinks to the installed extension
$this->_installPhrases($extensionJson->name);
}
}
else
{
@@ -907,4 +918,13 @@ class ExtensionsLib
{
$this->_printInfo('------------------------------------------------------------------------------------------');
}
/**
* Install the phrases from the given extension
*/
private function _installPhrases($extensionName)
{
$this->_ci->phraseslib->installFrom($this->EXTENSIONS_PATH.$extensionName.'/'.self::PHRASES_DIRECTORY);
}
}