diff --git a/application/controllers/system/phrases/CLI_Manager.php b/application/controllers/system/phrases/CLI_Manager.php index 560fb9eaf..0038bead1 100644 --- a/application/controllers/system/phrases/CLI_Manager.php +++ b/application/controllers/system/phrases/CLI_Manager.php @@ -16,7 +16,7 @@ class CLI_Manager extends CLI_Controller } /** - * + * */ public function installFrom($phrasesDirectoryPath) { diff --git a/application/controllers/system/phrases/Manager.php b/application/controllers/system/phrases/Manager.php index 357867827..ccbd13a83 100644 --- a/application/controllers/system/phrases/Manager.php +++ b/application/controllers/system/phrases/Manager.php @@ -20,7 +20,7 @@ class Manager extends Auth_Controller } /** - * + * */ public function installFromCore() { diff --git a/application/helpers/hlp_header_helper.php b/application/helpers/hlp_header_helper.php index 92138e9b7..ffa364e4a 100644 --- a/application/helpers/hlp_header_helper.php +++ b/application/helpers/hlp_header_helper.php @@ -5,16 +5,8 @@ * * @package FHC-Helper * @author FHC-Team - * @copyright Copyright (c) 2016 fhcomplete.org + * @copyright Copyright (c) 2022 fhcomplete.org * @license GPLv3 - * @since Version 1.0.0 - */ - -/** - * FHC Helper - * - * @subpackage Helpers - * @category Helpers */ if (! defined('BASEPATH')) exit('No direct script access allowed'); @@ -69,8 +61,6 @@ function generateCSSsInclude($CSSs) */ function generateJSDataStorageObject($indexPage, $calledPath, $calledMethod) { - $user_language = getUserLanguage(); - $toPrint = "\n"; $toPrint .= ''."\n"; echo "\n"; } + diff --git a/application/libraries/ExtensionsLib.php b/application/libraries/ExtensionsLib.php index 1ae238255..df9a1c29a 100644 --- a/application/libraries/ExtensionsLib.php +++ b/application/libraries/ExtensionsLib.php @@ -2,6 +2,9 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); +use \stdClass as stdClass; +use \PharData as PharData; + /** * Library to manage core extensions */ @@ -194,8 +197,7 @@ class ExtensionsLib $result = $this->_ci->ExtensionsModel->loadWhere(array('name' => $extensionName)); if (hasData($result)) // if something was found { - $extsArray = array(); - foreach ($result->retval as $key => $extension) // loops on them + foreach ($result->retval as $extension) // loops on them { // Remove them all $result = $this->_ci->ExtensionsModel->delete($extension->extension_id); @@ -397,6 +399,7 @@ class ExtensionsLib */ private function _chkExtensionJson($extensionName, $extensionDB) { + $fhcomplete_version = 0; $this->_printStart('Parsing and checking extension.json'); // Decodes extension.json @@ -597,19 +600,23 @@ class ExtensionsLib // Loops through the versions for ($sqlDir = $startVersion; $sqlDir <= $extensionJson->version; $sqlDir++) { - // If a directory with the same value of the version is present in the sql scripts directory - if (($files = glob($pkgSQLsPath.'/'.$sqlDir.'/*'.ExtensionsLib::SQL_FILE_EXTENSION)) != false) - { + // Search for a directory with the same value of the version in the sql scripts directory + $files = glob($pkgSQLsPath.'/'.$sqlDir.'/*'.ExtensionsLib::SQL_FILE_EXTENSION); + + // If found + if ($files != false) + { // Loads every sql files - foreach ($files as $file) - { - $sql = file_get_contents($file); // gets the entire content of the file + foreach ($files as $file) + { + $sql = file_get_contents($file); // gets the entire content of the file $this->_printMessage('Executing query:'); $this->_printMessage($sql); // Try to execute that - if (!isSuccess($result = @$this->_ci->ExtensionsModel->executeQuery($sql))) + $result = @$this->_ci->ExtensionsModel->executeQuery($sql); + if (!isSuccess($result)) { $this->_errorOccurred = true; $this->_printFailure(' error occurred while executing the query'); @@ -622,8 +629,8 @@ class ExtensionsLib var_dump($result->retval); // KEEP IT!!! $this->_ci->eprintflib->printEOL(); } - } - } + } + } } $this->_printSuccess(!$this->_errorOccurred); @@ -684,7 +691,7 @@ class ExtensionsLib foreach ($this->SOFTLINK_TARGET_DIRECTORIES as $rootPath => $targetDirectories) { - foreach ($targetDirectories as $key => $targetDirectory) + foreach ($targetDirectories as $targetDirectory) { if (file_exists($rootPath.$targetDirectory.'/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$extensionName)) { @@ -738,7 +745,7 @@ class ExtensionsLib // For every target directory foreach ($this->SOFTLINK_TARGET_DIRECTORIES as $rootPath => $targetDirectories) { - foreach ($targetDirectories as $key => $targetDirectory) + foreach ($targetDirectories as $targetDirectory) { // If destination of the symlink does not exist if (!file_exists($rootPath.$targetDirectory.'/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$extensionName)) diff --git a/application/libraries/PhrasesLib.php b/application/libraries/PhrasesLib.php index f713fd4a8..20df48ce8 100644 --- a/application/libraries/PhrasesLib.php +++ b/application/libraries/PhrasesLib.php @@ -2,6 +2,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); +use \Netcarver\Textile\Parser as NTParser; + class PhrasesLib { // Directory name where all the category files are @@ -41,7 +43,7 @@ class PhrasesLib $this->_ci->load->model('system/Phrasentext_model', 'PhrasentextModel'); // Workaround to use more parameters in the construct since PHP doesn't support many constructors - $this->_extend_construct(func_get_args()); + $this->_extendConstruct(func_get_args()); } // ----------------------------------------------------------------------------------------------------------------- @@ -78,7 +80,7 @@ class PhrasesLib if (hasData($result)) { // Textile parser - $textileParser = new \Netcarver\Textile\Parser(); + $textileParser = new NTParser(); for ($i = 0; $i < count($result->retval); $i++) { @@ -182,13 +184,12 @@ class PhrasesLib * - could be an array of categories, and for each category there is an array of phrases * language: optional parameter must be a string. It's used to load phrases */ - private function _extend_construct($params) + private function _extendConstruct($params) { // Checks if the $params is an array with at least one element if (!isEmptyArray($params)) { $parameters = $params[0]; // temporary variable - $isIndexArray = false; //flag for indexed array // If there are parameters if (!isEmptyArray($parameters)) @@ -325,6 +326,8 @@ class PhrasesLib && $phrasesCategoryFile != '..' && $pathInfo['extension'] == 'php') { + $phrases = null; // define the variable + // Include the php file that contains phrases for that category require_once($phrasesDirectory.$phrasesCategoryFile); @@ -415,7 +418,6 @@ class PhrasesLib $phrase[self::PHRASE] ) ); - } else // otherwise if the phrase already exists in the database { diff --git a/application/views/system/phrases/phrasesViewerData.php b/application/views/system/phrases/phrasesViewerData.php index 0cac864ed..54df5095d 100644 --- a/application/views/system/phrases/phrasesViewerData.php +++ b/application/views/system/phrases/phrasesViewerData.php @@ -28,7 +28,7 @@ 'Organisation unit', 'Organizational form' ), - 'formatRow' => function($datasetRaw) { + 'formatRow' => function ($datasetRaw) { if (isEmptyString($datasetRaw->Description)) $datasetRaw->Description = 'NA'; if (isEmptyString($datasetRaw->OrganisationUnit)) $datasetRaw->OrganisationUnit = 'NA'; @@ -43,5 +43,4 @@ $filterWidgetArray['filter_id'] = $this->input->get('filter_id'); echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray); -?> diff --git a/application/widgets/FilterWidget.php b/application/widgets/FilterWidget.php index 7d2d01517..aaa961241 100644 --- a/application/widgets/FilterWidget.php +++ b/application/widgets/FilterWidget.php @@ -493,7 +493,8 @@ class FilterWidget extends Widget FilterWidgetLib::DATASET_NAME => $this->_datasetName, // the carrent dataset name FilterWidgetLib::SESSION_FILTER_NAME => $filterName, // the current filter name FilterWidgetLib::SESSION_FIELDS => $this->FiltersModel->getExecutedQueryListFields(), // all the fields of the dataset - FilterWidgetLib::SESSION_SELECTED_FIELDS => $this->_getColumnsNames($parsedFilterJson->columns), // all the selected fields + // All the selected fields + FilterWidgetLib::SESSION_SELECTED_FIELDS => $this->_getColumnsNames($parsedFilterJson->columns), FilterWidgetLib::SESSION_COLUMNS_ALIASES => $this->_columnsAliases, // all the fields aliases FilterWidgetLib::SESSION_ADDITIONAL_COLUMNS => $this->_additionalColumns, // additional columns FilterWidgetLib::SESSION_CHECKBOXES => $this->_checkboxes, // the name of the field used to build the checkboxes column @@ -502,9 +503,12 @@ class FilterWidget extends Widget FilterWidgetLib::SESSION_ROW_NUMBER => count($dataset->retval), // the number of loaded rows by this filter FilterWidgetLib::SESSION_DATASET => $dataset->retval, // the entire dataset FilterWidgetLib::SESSION_DATASET_RELOAD => false, // if the dataset must be reloaded, not needed the first time - FilterWidgetLib::SESSION_DATASET_REPRESENTATION => $this->_datasetRepresentation, // the choosen dataset representation - FilterWidgetLib::SESSION_DATASET_REP_OPTIONS => $this->_datasetRepresentationOptions, // the choosen dataset representation options - FilterWidgetLib::SESSION_DATASET_REP_FIELDS_DEFS => $this->_datasetRepFieldsDefs // the choosen dataset representation record fields definition + // The choosen dataset representation + FilterWidgetLib::SESSION_DATASET_REPRESENTATION => $this->_datasetRepresentation, + // The choosen dataset representation options + FilterWidgetLib::SESSION_DATASET_REP_OPTIONS => $this->_datasetRepresentationOptions, + // The choosen dataset representation record fields definition + FilterWidgetLib::SESSION_DATASET_REP_FIELDS_DEFS => $this->_datasetRepFieldsDefs ) ); } @@ -528,7 +532,7 @@ class FilterWidget extends Widget private function _setFilterMenu() { // Generates the filters structure array - $filterMenu = $this->filterwidgetlib->generateFilterMenu( + $this->filterwidgetlib->generateFilterMenu( $this->router->directory.$this->router->class.'/'.$this->router->method ); } @@ -607,7 +611,7 @@ class FilterWidget extends Widget { $columnsNames = array(); - foreach ($columns as $key => $obj) + foreach ($columns as $obj) { if (isset($obj->name)) {