Commit 3a04f8d7 authored by Gerald Salin's avatar Gerald Salin
Browse files

make nG6 typo3 plugin compatible with typo3 V8

parent 2c1823f6
This diff is collapsed.
......@@ -2,59 +2,59 @@
if (!defined ('TYPO3_MODE')) die ('Access denied.');
## Chmod the smarty cache and template_c directories
exec('chmod 777 '.t3lib_extMgm::extPath('nG6').'res/smarty/cache');
exec('chmod 777 '.t3lib_extMgm::extPath('nG6').'res/smarty/templates_c');
exec('chmod 777 '.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('nG6').'res/smarty/cache');
exec('chmod 777 '.\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('nG6').'res/smarty/templates_c');
## Extending TypoScript from static template uid=43 to set up userdefined tag:
t3lib_extMgm::addTypoScript($_EXTKEY,'editorcfg','
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript($_EXTKEY,'editorcfg','
tt_content.CSS_editor.ch.tx_nG6_pi1 = < plugin.tx_nG6_pi1.CSS_editor
',43);
t3lib_extMgm::addPItoST43($_EXTKEY,'pi1/class.tx_nG6_pi1.php','_pi1','list_type',1);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY,'pi1/class.tx_nG6_pi1.php','_pi1','list_type',1);
## Extending TypoScript from static template uid=43 to set up userdefined tag:
t3lib_extMgm::addTypoScript($_EXTKEY,'editorcfg','
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript($_EXTKEY,'editorcfg','
tt_content.CSS_editor.ch.tx_nG6_pi2 = < plugin.tx_nG6_pi2.CSS_editor
',43);
t3lib_extMgm::addPItoST43($_EXTKEY,'pi2/class.tx_nG6_pi2.php','_pi2','list_type',1);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY,'pi2/class.tx_nG6_pi2.php','_pi2','list_type',1);
## Extending TypoScript from static template uid=43 to set up userdefined tag:
t3lib_extMgm::addTypoScript($_EXTKEY,'editorcfg','
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript($_EXTKEY,'editorcfg','
tt_content.CSS_editor.ch.tx_nG6_pi3 = < plugin.tx_nG6_pi3.CSS_editor
',43);
t3lib_extMgm::addPItoST43($_EXTKEY,'pi3/class.tx_nG6_pi3.php','_pi3','list_type',1);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY,'pi3/class.tx_nG6_pi3.php','_pi3','list_type',1);
## Extending TypoScript from static template uid=43 to set up userdefined tag:
t3lib_extMgm::addTypoScript($_EXTKEY,'editorcfg','
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript($_EXTKEY,'editorcfg','
tt_content.CSS_editor.ch.tx_nG6_pi4 = < plugin.tx_nG6_pi4.CSS_editor
',43);
t3lib_extMgm::addPItoST43($_EXTKEY,'pi4/class.tx_nG6_pi4.php','_pi4','list_type',1);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY,'pi4/class.tx_nG6_pi4.php','_pi4','list_type',1);
## Extending TypoScript from static template uid=43 to set up userdefined tag:
t3lib_extMgm::addTypoScript($_EXTKEY,'editorcfg','
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript($_EXTKEY,'editorcfg','
tt_content.CSS_editor.ch.tx_nG6_pi5 = < plugin.tx_nG6_pi5.CSS_editor
',43);
t3lib_extMgm::addPItoST43($_EXTKEY,'pi5/class.tx_nG6_pi5.php','_pi5','list_type',1);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY,'pi5/class.tx_nG6_pi5.php','_pi5','list_type',1);
## Extending TypoScript from static template uid=43 to set up userdefined tag:
t3lib_extMgm::addTypoScript($_EXTKEY,'editorcfg','
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript($_EXTKEY,'editorcfg','
tt_content.CSS_editor.ch.tx_nG6_pi6 = < plugin.tx_nG6_pi6.CSS_editor
',43);
t3lib_extMgm::addPItoST43($_EXTKEY,'pi6/class.tx_nG6_pi6.php','_pi6','list_type',1);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY,'pi6/class.tx_nG6_pi6.php','_pi6','list_type',1);
## Added to do some ajax
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_nG6'] = 'EXT:nG6/class.tx_nG6_eid.php';
?>
\ No newline at end of file
?>
......@@ -7,7 +7,7 @@ $TCA["fe_rights_levels"] = Array(
'label' => 'right_level_id',
"default_sortby" => "ORDER BY right_level_id",
"dynamicConfigFile" => t3lib_extMgm::extPath($_EXTKEY)."tca.php"
"dynamicConfigFile" => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY)."tca.php"
),
"feInterface" => Array (
"fe_admin_fieldList" => "right_level_id, right_level_label",
......@@ -20,37 +20,19 @@ $TCA["fe_rights"] = Array(
'label' => 'right_id, project_id, fe_user_id',
"default_sortby" => "ORDER BY right_id",
"dynamicConfigFile" => t3lib_extMgm::extPath($_EXTKEY)."tca.php"
"dynamicConfigFile" => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY)."tca.php"
),
"feInterface" => Array (
"fe_admin_fieldList" => "fe_user_id, right_id, project_id",
)
);
t3lib_extMgm::allowTableOnStandardPages("tx_nG6_project");
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages("tx_nG6_project");
$TCA["tx_nG6_project"] = Array (
"ctrl" => Array (
'title' => 'LLL:EXT:nG6/locallang_db.xml:tx_nG6_project',
'label' => 'uid',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
"default_sortby" => "ORDER BY crdate",
"delete" => "deleted",
"enablecolumns" => Array (
"disabled" => "hidden",
),
"dynamicConfigFile" => t3lib_extMgm::extPath($_EXTKEY)."tca.php",
"iconfile" => t3lib_extMgm::extRelPath($_EXTKEY)."icon_tx_nG6_project.gif",
),
"feInterface" => Array (
"fe_admin_fieldList" => "hidden, public, name, description",
)
);
t3lib_extMgm::allowTableOnStandardPages("tx_nG6_run");
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages("tx_nG6_run");
$TCA["tx_nG6_run"] = Array (
"ctrl" => Array (
......@@ -64,8 +46,8 @@ $TCA["tx_nG6_run"] = Array (
"enablecolumns" => Array (
"disabled" => "hidden",
),
"dynamicConfigFile" => t3lib_extMgm::extPath($_EXTKEY)."tca.php",
"iconfile" => t3lib_extMgm::extRelPath($_EXTKEY)."icon_tx_nG6_run.gif",
"dynamicConfigFile" => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY)."tca.php",
"iconfile" => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY)."icon_tx_nG6_run.gif",
),
"feInterface" => Array (
"fe_admin_fieldList" => "hidden, name, date, directory, species, data_nature, type, nb_sequences, full_seq_size, description, sequencer",
......@@ -73,7 +55,7 @@ $TCA["tx_nG6_run"] = Array (
);
t3lib_extMgm::allowTableOnStandardPages("tx_nG6_analyze");
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages("tx_nG6_analyze");
$TCA["tx_nG6_analyze"] = Array (
"ctrl" => Array (
......@@ -87,8 +69,8 @@ $TCA["tx_nG6_analyze"] = Array (
"enablecolumns" => Array (
"disabled" => "hidden",
),
"dynamicConfigFile" => t3lib_extMgm::extPath($_EXTKEY)."tca.php",
"iconfile" => t3lib_extMgm::extRelPath($_EXTKEY)."icon_tx_nG6_analyze.gif",
"dynamicConfigFile" => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY)."tca.php",
"iconfile" => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY)."icon_tx_nG6_analyze.gif",
),
"feInterface" => Array (
"fe_admin_fieldList" => "hidden, parent_uid, class, name, description, date, directory, software, version, params",
......@@ -96,7 +78,7 @@ $TCA["tx_nG6_analyze"] = Array (
);
t3lib_extMgm::allowTableOnStandardPages("tx_nG6_sample");
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages("tx_nG6_sample");
$TCA["tx_nG6_sample"] = Array (
"ctrl" => Array (
......@@ -110,8 +92,8 @@ $TCA["tx_nG6_sample"] = Array (
"enablecolumns" => Array (
"disabled" => "hidden",
),
"dynamicConfigFile" => t3lib_extMgm::extPath($_EXTKEY)."tca.php",
"iconfile" => t3lib_extMgm::extRelPath($_EXTKEY)."icon_tx_nG6_sample.gif",
"dynamicConfigFile" => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY)."tca.php",
"iconfile" => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY)."icon_tx_nG6_sample.gif",
),
"feInterface" => Array (
"fe_admin_fieldList" => "hidden, run_id, mid, description",
......@@ -119,7 +101,7 @@ $TCA["tx_nG6_sample"] = Array (
);
t3lib_extMgm::allowTableOnStandardPages("tx_nG6_result");
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages("tx_nG6_result");
$TCA["tx_nG6_result"] = Array (
"ctrl" => Array (
......@@ -133,8 +115,8 @@ $TCA["tx_nG6_result"] = Array (
"enablecolumns" => Array (
"disabled" => "hidden",
),
"dynamicConfigFile" => t3lib_extMgm::extPath($_EXTKEY)."tca.php",
"iconfile" => t3lib_extMgm::extRelPath($_EXTKEY)."icon_tx_nG6_result.gif",
"dynamicConfigFile" => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY)."tca.php",
"iconfile" => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY)."icon_tx_nG6_result.gif",
),
"feInterface" => Array (
"fe_admin_fieldList" => "analyze_id, file, rkey, rvalue, rgroup",
......@@ -142,7 +124,7 @@ $TCA["tx_nG6_result"] = Array (
);
t3lib_extMgm::allowTableOnStandardPages("tx_nG6_project_run");
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages("tx_nG6_project_run");
$TCA["tx_nG6_project_run"] = Array (
"ctrl" => Array (
......@@ -156,8 +138,8 @@ $TCA["tx_nG6_project_run"] = Array (
"enablecolumns" => Array (
"disabled" => "hidden",
),
"dynamicConfigFile" => t3lib_extMgm::extPath($_EXTKEY)."tca.php",
"iconfile" => t3lib_extMgm::extRelPath($_EXTKEY)."icon_tx_nG6_project_run.gif",
"dynamicConfigFile" => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY)."tca.php",
"iconfile" => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY)."icon_tx_nG6_project_run.gif",
),
"feInterface" => Array (
"fe_admin_fieldList" => "hidden, project_id, run_id",
......@@ -165,7 +147,7 @@ $TCA["tx_nG6_project_run"] = Array (
);
t3lib_extMgm::allowTableOnStandardPages("tx_nG6_project_analyze");
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages("tx_nG6_project_analyze");
$TCA["tx_nG6_project_analyze"] = Array (
"ctrl" => Array (
......@@ -179,8 +161,8 @@ $TCA["tx_nG6_project_analyze"] = Array (
"enablecolumns" => Array (
"disabled" => "hidden",
),
"dynamicConfigFile" => t3lib_extMgm::extPath($_EXTKEY)."tca.php",
"iconfile" => t3lib_extMgm::extRelPath($_EXTKEY)."icon_tx_nG6_project_analyze.gif",
"dynamicConfigFile" => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY)."tca.php",
"iconfile" => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY)."icon_tx_nG6_project_analyze.gif",
),
"feInterface" => Array (
"fe_admin_fieldList" => "hidden, project_id, analyze_id",
......@@ -188,7 +170,7 @@ $TCA["tx_nG6_project_analyze"] = Array (
);
t3lib_extMgm::allowTableOnStandardPages("tx_nG6_run_analyze");
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages("tx_nG6_run_analyze");
$TCA["tx_nG6_run_analyze"] = Array (
"ctrl" => Array (
......@@ -202,8 +184,8 @@ $TCA["tx_nG6_run_analyze"] = Array (
"enablecolumns" => Array (
"disabled" => "hidden",
),
"dynamicConfigFile" => t3lib_extMgm::extPath($_EXTKEY)."tca.php",
"iconfile" => t3lib_extMgm::extRelPath($_EXTKEY)."icon_tx_nG6_run_analyze.gif",
"dynamicConfigFile" => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY)."tca.php",
"iconfile" => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($_EXTKEY)."icon_tx_nG6_run_analyze.gif",
),
"feInterface" => Array (
"fe_admin_fieldList" => "hidden, run_id, analyze_id",
......@@ -212,33 +194,33 @@ $TCA["tx_nG6_run_analyze"] = Array (
t3lib_div::loadTCA('tt_content');
//\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_content');
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY.'_pi1']='layout,select_key';
t3lib_extMgm::addPlugin(Array('LLL:EXT:nG6/locallang_db.xml:tt_content.list_type_pi1', $_EXTKEY.'_pi1'),'list_type');
if (TYPO3_MODE=="BE") $TBE_MODULES_EXT["xMOD_db_new_content_el"]["addElClasses"]["tx_nG6_pi1_wizicon"] = t3lib_extMgm::extPath($_EXTKEY).'pi1/class.tx_nG6_pi1_wizicon.php';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(Array('LLL:EXT:nG6/locallang_db.xml:tt_content.list_type_pi1', $_EXTKEY.'_pi1'),'list_type');
if (TYPO3_MODE=="BE") $TBE_MODULES_EXT["xMOD_db_new_content_el"]["addElClasses"]["tx_nG6_pi1_wizicon"] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY).'pi1/class.tx_nG6_pi1_wizicon.php';
t3lib_div::loadTCA('tt_content');
//\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_content');
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY.'_pi2']='layout,select_key';
t3lib_extMgm::addPlugin(Array('LLL:EXT:nG6/locallang_db.xml:tt_content.list_type_pi2', $_EXTKEY.'_pi2'),'list_type');
if (TYPO3_MODE=="BE") $TBE_MODULES_EXT["xMOD_db_new_content_el"]["addElClasses"]["tx_nG6_pi2_wizicon"] = t3lib_extMgm::extPath($_EXTKEY).'pi2/class.tx_nG6_pi2_wizicon.php';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(Array('LLL:EXT:nG6/locallang_db.xml:tt_content.list_type_pi2', $_EXTKEY.'_pi2'),'list_type');
if (TYPO3_MODE=="BE") $TBE_MODULES_EXT["xMOD_db_new_content_el"]["addElClasses"]["tx_nG6_pi2_wizicon"] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY).'pi2/class.tx_nG6_pi2_wizicon.php';
t3lib_div::loadTCA('tt_content');
//\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_content');
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY.'_pi3']='layout,select_key';
t3lib_extMgm::addPlugin(Array('LLL:EXT:nG6/locallang_db.xml:tt_content.list_type_pi3', $_EXTKEY.'_pi3'),'list_type');
if (TYPO3_MODE=="BE") $TBE_MODULES_EXT["xMOD_db_new_content_el"]["addElClasses"]["tx_nG6_pi3_wizicon"] = t3lib_extMgm::extPath($_EXTKEY).'pi3/class.tx_nG6_pi3_wizicon.php';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(Array('LLL:EXT:nG6/locallang_db.xml:tt_content.list_type_pi3', $_EXTKEY.'_pi3'),'list_type');
if (TYPO3_MODE=="BE") $TBE_MODULES_EXT["xMOD_db_new_content_el"]["addElClasses"]["tx_nG6_pi3_wizicon"] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY).'pi3/class.tx_nG6_pi3_wizicon.php';
t3lib_div::loadTCA('tt_content');
//\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_content');
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY.'_pi4']='layout,select_key';
t3lib_extMgm::addPlugin(Array('LLL:EXT:nG6/locallang_db.xml:tt_content.list_type_pi4', $_EXTKEY.'_pi4'),'list_type');
if (TYPO3_MODE=="BE") $TBE_MODULES_EXT["xMOD_db_new_content_el"]["addElClasses"]["tx_nG6_pi4_wizicon"] = t3lib_extMgm::extPath($_EXTKEY).'pi4/class.tx_nG6_pi4_wizicon.php';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(Array('LLL:EXT:nG6/locallang_db.xml:tt_content.list_type_pi4', $_EXTKEY.'_pi4'),'list_type');
if (TYPO3_MODE=="BE") $TBE_MODULES_EXT["xMOD_db_new_content_el"]["addElClasses"]["tx_nG6_pi4_wizicon"] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY).'pi4/class.tx_nG6_pi4_wizicon.php';
t3lib_div::loadTCA('tt_content');
//\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_content');
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY.'_pi5']='layout,select_key';
t3lib_extMgm::addPlugin(Array('LLL:EXT:nG6/locallang_db.xml:tt_content.list_type_pi5', $_EXTKEY.'_pi5'),'list_type');
if (TYPO3_MODE=="BE") $TBE_MODULES_EXT["xMOD_db_new_content_el"]["addElClasses"]["tx_nG6_pi5_wizicon"] = t3lib_extMgm::extPath($_EXTKEY).'pi5/class.tx_nG6_pi5_wizicon.php';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(Array('LLL:EXT:nG6/locallang_db.xml:tt_content.list_type_pi5', $_EXTKEY.'_pi5'),'list_type');
if (TYPO3_MODE=="BE") $TBE_MODULES_EXT["xMOD_db_new_content_el"]["addElClasses"]["tx_nG6_pi5_wizicon"] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY).'pi5/class.tx_nG6_pi5_wizicon.php';
t3lib_div::loadTCA('tt_content');
//\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_content');
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY.'_pi6']='layout,select_key';
t3lib_extMgm::addPlugin(Array('LLL:EXT:nG6/locallang_db.xml:tt_content.list_type_pi6', $_EXTKEY.'_pi6'),'list_type');
if (TYPO3_MODE=="BE") $TBE_MODULES_EXT["xMOD_db_new_content_el"]["addElClasses"]["tx_nG6_pi6_wizicon"] = t3lib_extMgm::extPath($_EXTKEY).'pi6/class.tx_nG6_pi6_wizicon.php';
?>
\ No newline at end of file
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(Array('LLL:EXT:nG6/locallang_db.xml:tt_content.list_type_pi6', $_EXTKEY.'_pi6'),'list_type');
if (TYPO3_MODE=="BE") $TBE_MODULES_EXT["xMOD_db_new_content_el"]["addElClasses"]["tx_nG6_pi6_wizicon"] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY).'pi6/class.tx_nG6_pi6_wizicon.php';
?>
This diff is collapsed.
......@@ -22,8 +22,7 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
require_once(PATH_tslib.'class.tslib_pibase.php');
require_once(t3lib_extMgm::extPath('nG6').'/lib/class.tx_nG6_db.php');
require_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('nG6').'/lib/class.tx_nG6_db.php');
/**
* Class_nG6_db' for the 'nG6' extension.
......@@ -44,7 +43,7 @@ class tx_nG6_upgrade {
tx_nG6_upgrade::upgrade_1_2();
return "Upgrade successfuly ended to version 1.2!";
} else if($version == '2.0'){
tx_nG6_upgrade::upgrade_2_0($data_storage);
tx_nG6_upgrade::upgrade_2_0($data_storage);
return "Upgrade successfuly ended to version 2.0!";
} else {
return "Upgrading to version " . $version . " not suported!";
......@@ -52,14 +51,14 @@ class tx_nG6_upgrade {
}
/*
* version 2.0
/*
* version 2.0
*------------------------------------------------------------*/
/**
* Main function to upgrade to version 2.0.
*/
function upgrade_2_0($data_storage){
/**
* Main function to upgrade to version 2.0.
*/
function upgrade_2_0($data_storage){
// Update cruser_id of tx_nG6_project
$queryUpdateCruseridProject = "
UPDATE tx_nG6_project p
......@@ -114,16 +113,16 @@ class tx_nG6_upgrade {
ADD is_editable boolean NOT NULL DEFAULT FALSE AFTER params
";
// Alter tx_nG6_analyze and add storage_size
$queryAlterTxNG6AnalayzeSsize = "
ALTER TABLE tx_nG6_analyze
ADD storage_size bigint(20) NOT NULL DEFAULT '0' AFTER is_editable
// Alter tx_nG6_analyze and add storage_size
$queryAlterTxNG6AnalayzeSsize = "
ALTER TABLE tx_nG6_analyze
ADD storage_size bigint(20) NOT NULL DEFAULT '0' AFTER is_editable
";
// Alter tx_nG6_run and add storage_size
$queryAlterTxNG6Run = "
ALTER TABLE tx_nG6_run
ADD storage_size bigint(20) NOT NULL DEFAULT '0' AFTER sequencer
// Alter tx_nG6_run and add storage_size
$queryAlterTxNG6Run = "
ALTER TABLE tx_nG6_run
ADD storage_size bigint(20) NOT NULL DEFAULT '0' AFTER sequencer
";
/*
......@@ -150,47 +149,47 @@ class tx_nG6_upgrade {
function set_storage_size($data_storage) {
// update run storage size
$queryParts = array(
'SELECT' => 'tx_nG6_run.uid as uid, tx_nG6_run.directory as directory',
'FROM' => 'tx_nG6_run ',
'WHERE' => "",
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
$queryParts = array(
'SELECT' => 'tx_nG6_run.uid as uid, tx_nG6_run.directory as directory',
'FROM' => 'tx_nG6_run ',
'WHERE' => "",
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$current_size = 0;
$current_size = 0;
while($res_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$current_size = tx_nG6_upgrade::get_directory_size($data_storage.$res_row['directory']);
$GLOBALS['TYPO3_DB']-> exec_UPDATEquery('tx_nG6_run', 'uid='.$res_row['uid'], array('storage_size' => strval($current_size)));
}
// update analysis storage size
$queryParts = array(
'SELECT' => 'tx_nG6_analyze.uid as uid, tx_nG6_analyze.directory as directory',
'FROM' => 'tx_nG6_analyze ',
'WHERE' => "",
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$current_size = 0;
while($res_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$current_size = tx_nG6_upgrade::get_directory_size($data_storage.$res_row['directory']);
$GLOBALS['TYPO3_DB']-> exec_UPDATEquery('tx_nG6_analyze', 'uid='.$res_row['uid'], array('storage_size' => strval($current_size)));
$queryParts = array(
'SELECT' => 'tx_nG6_analyze.uid as uid, tx_nG6_analyze.directory as directory',
'FROM' => 'tx_nG6_analyze ',
'WHERE' => "",
'GROUPBY' => '',
'ORDERBY' => '',
'LIMIT' => ''
);
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
$current_size = 0;
while($res_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$current_size = tx_nG6_upgrade::get_directory_size($data_storage.$res_row['directory']);
$GLOBALS['TYPO3_DB']-> exec_UPDATEquery('tx_nG6_analyze', 'uid='.$res_row['uid'], array('storage_size' => strval($current_size)));
}
}
function get_directory_size($data_folder) {
$full_size = 0;
foreach(scandir($data_folder) as $file) {
if (is_file($data_folder."/".$file)) {
$full_size += filesize($data_folder."/".$file);
}
}
return $full_size;
function get_directory_size($data_folder) {
$full_size = 0;
foreach(scandir($data_folder) as $file) {
if (is_file($data_folder."/".$file)) {
$full_size += filesize($data_folder."/".$file);
}
}
return $full_size;
}
function add_comment_support(){
......@@ -308,8 +307,8 @@ class tx_nG6_upgrade {
$GLOBALS['TYPO3_DB']->sql_query($queryAlterTxNG6SampleAddColumns);
}
/*
* version 1.2
/*
* version 1.2
*------------------------------------------------------------*/
/**
......@@ -424,7 +423,7 @@ class tx_nG6_upgrade {
$i = 0;
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
if (in_array($group, t3lib_div::intExplode(',',$row['subgroup']))) {
if (in_array($group, \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',',$row['subgroup']))) {
$reslist[$i] = $row['uid'];
$i++;
}
......
......@@ -27,10 +27,7 @@
* @author PF bioinformatique de Toulouse <>
*/
require_once(PATH_t3lib.'class.t3lib_div.php');
require_once(t3lib_extMgm::extPath('saltedpasswords').'/classes/salts/class.tx_saltedpasswords_salts_factory.php');
set_include_path(get_include_path() . '/phpseclib');
include('Net/SSH2.php');
//require_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('saltedpasswords').'/classes/salts/class.tx_saltedpasswords_salts_factory.php');
class tx_nG6_utils {
......@@ -41,7 +38,7 @@ class tx_nG6_utils {
* @param Array $analyzes_map analyze array (for example, result of tx_nG6_db::get_project_analysis(...))
* @return a tree describing the links children-parents of all analyzes
*/
function trace_hierarchy($analyzes_map) {
static function trace_hierarchy($analyzes_map) {
$base_tree = array();
foreach(array_values($analyzes_map) as $id => $analyze) {
......@@ -70,7 +67,7 @@ class tx_nG6_utils {
* @param $sub : the substring that may ends $str
* @return boolean
*/
function ends_with($str, $sub) {
static function ends_with($str, $sub) {
return ( substr( $str, strlen( $str ) - strlen( $sub ) ) == $sub );
}
......@@ -80,7 +77,7 @@ class tx_nG6_utils {
* @param $size : the random key size
* @return string
*/
function create_random_key($size) {
static function create_random_key($size) {
$keyset = "abcdefghijklmABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$randkey = "";
for ($i=0; $i<$size; $i++)
......@@ -96,7 +93,7 @@ class tx_nG6_utils {
* @param string $directory
* @return 0=>everything ok, 1=>user right problem, 2=>wrong authentification, 3=>connection error
*/
function delete_directory($user_login, $user_pwd, $directory) {
static function delete_directory($user_login, $user_pwd, $directory) {
// First try to connect the specified user using ssh
$connection = ssh2_connect('127.0.0.1', 22);
if (!$connection) return 3;
......@@ -121,7 +118,7 @@ class tx_nG6_utils {
* @return 0=>everything ok, 1=>user right problem, 2=>wrong authentification, 3=>connection error
*/
function purge_directory($user_login, $user_pwd, $directory) {
static function purge_directory($user_login, $user_pwd, $directory) {
if ($directory != 'undefined' && $directory != '') {
// And process the directories structure, remove all files except .html ans .png
......@@ -162,7 +159,7 @@ class tx_nG6_utils {
*
* @param string $size
*/
function get_octet_string_representation($size) {
static function get_octet_string_representation($size) {
$octets_link = array("Bytes", "kB", "MB", "GB", "TB", "PB", "EB", "ZB");
$p = (int)(ceil((float)(strlen(strval($size)))/(float)(3) - (float)(1)));
$pow_needed = $p * 10;
......@@ -174,7 +171,7 @@ class tx_nG6_utils {
return $value;
}
function get_purge_mail($project_name, $project_id, $nb_run_purgeable,$nb_analyse_purgeable, $demand_id,
static function get_purge_mail($project_name, $project_id, $nb_run_purgeable,$nb_analyse_purgeable, $demand_id,
$purgeable_size, $project_size, $purge_delay, $url_price, $min_extention_duration,
$min_extention_size, $emails, $runs_list, $analyse_list) {
......@@ -226,11 +223,11 @@ Files impacted of:
* @param string $password
* @return hashed password
*/
function hash_password($password){
static function hash_password($password){
return tx_saltedpasswords_salts_factory::getSaltingInstance()->getHashedPassword($password);
}
function get_ssh_connection($user_login, $user_pwd){
static function get_ssh_connection($user_login, $user_pwd){
$connection = ssh2_connect('127.0.0.1', 22);
if (!$connection) return NULL;
......
......@@ -27,13 +27,12 @@
* @author PF bioinformatique de Toulouse <>
*/
require_once(PATH_tslib.'class.tslib_pibase.php');
require_once(t3lib_extMgm::extPath('nG6').'/lib/class.tx_nG6_db.php');
require_once(t3lib_extMgm::extPath('nG6').'/lib/class.tx_nG6_utils.php');
require_once(t3lib_extMgm::extPath('nG6').'/lib/class.tx_nG6_upgrade.php');
require_once(t3lib_extMgm::extPath('nG6').'/res/smarty/libs/Smarty.class.php');
require_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('nG6').'/lib/class.tx_nG6_db.php');
require_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('nG6').'/lib/class.tx_nG6_utils.php');
require_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('nG6').'/lib/class.tx_nG6_upgrade.php');
require_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('nG6').'/res/smarty/libs/Smarty.class.php');
class tx_nG6_pi1 extends tslib_pibase {
class tx_nG6_pi1 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
var $prefixId = 'tx_nG6_pi1'; // Same as class name
var $scriptRelPath = 'pi1/class.tx_nG6_pi1.php'; // Path to this script relative to the extension dir.
......@@ -47,7 +46,7 @@ class tx_nG6_pi1 extends tslib_pibase {
* @return The content that should be displayed on the website
*/
function main($content,$conf) {
error_log("tx_nG6_pi1 \n", 3, "/work/tmp/mes-erreurs.log");
if (strstr($this->cObj->currentRecord,'tt_content')) {
$conf['pidList'] = $this->cObj->data['pages'];
}
......@@ -62,25 +61,25 @@ class tx_nG6_pi1 extends tslib_pibase {
// Add the ng6 plugins css
$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId] = '
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/jquery.min.js"></script>
<script type="text/javascript" src="'.t3lib_extMgm::siteRelPath($this->extKey).'res/js/jquery.dataTables.min.js"></script>