Maintenance - Mise à jour mensuelle Lundi 1 Juin 2020 entre 7h00 et 9h00

Commit 26b00dfc authored by Romain Therville's avatar Romain Therville 🐭

Fix for the issue #151

A function was missing from the last commit + merge,
get_available_space_ids() from tx.nG6_utils.php.

issue #151
parent d6928bee
......@@ -287,7 +287,7 @@ please have a look at our storage fees (<a href="###URL_PRICE###">###URL_PRICE##
}
static function get_retention_policy_from_space_id($space_id = "default"){
$config_file_content = tx_nG6_utils::get_config_content("default");
$config_file_content = tx_nG6_utils::get_config_content();
//To explode the file content by line, we use PHP_EOL
$array_config_content = explode(PHP_EOL, $config_file_content);
......@@ -352,6 +352,29 @@ please have a look at our storage fees (<a href="###URL_PRICE###">###URL_PRICE##
return($return_text);
}
//Return a php array with array[space_name]=space_name, containing all available space_ids
static function get_available_space_ids (){
$config_file_content = tx_nG6_utils::get_config_content();
//To explode the file content by line, we use PHP_EOL
$array_config_content = explode(PHP_EOL, $config_file_content);
$ret = array();
foreach($array_config_content as $line => $line_content){
//If the current line starts with "[space_"
if( strpos($line_content,'[space_') === 0 ){
$space_id = str_replace('[space_','',$line_content);
$space_id = str_replace(']','',$space_id);
$space_id = trim($space_id);
$ret[$space_id]=$space_id;
}
}
return($ret);
}
static function convert_epoch_timestamp_to_nice_date( $epoch_date ){
//return(gmdate('D, d M Y', $epoch_date));
return(gmdate('l jS \of F Y', $epoch_date));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment