Commit 5680eb5f authored by Ingmar Schlecht's avatar Ingmar Schlecht
Browse files

* Changed the way how the EM and the Kickstarter interact (see ChangeLog 22/08/2004)


git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@438 709f56b5-9817-0410-a4d7-c38de5d9e867
parent f460d462
2004-08-22 Ingmar Schlecht <ingmars@web.de>
* Changed the way how the EM and the Kickstarter interact
-> Removed all hardcoded references to the Kickstarter from the index.php of the EM and changed it to be extendable using the "Integrate into existing modules" functionality.
-> Removed the file typo3/mod/tools/em/class.kickstarter.php
The new version of the Kickstarter that uses these new ways of interaction has the new extension key 'kickstarter' and is already available from typo3xdev CVS.
The old version of the Kickstarter having the key 'extrep_wizard' is not used anymore.
2004-08-21 Kasper Skårhøj,,, <kasper@typo3.com>
* Added support for backend initialization in PHP shell scripts. Interesting for deamons, cronjobs etc where you want a PHP script to run from shell but with a full backend environment. Documented in next version of Inside TYPO3.
......
<?php
/***************************************************************
* Copyright notice
*
* (c) 1999-2004 Kasper Skaarhoj (kasper@typo3.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project 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 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script 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.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Wrapped for Kickstarter extension used with extension repository...
*
* $Id$
* Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj
*
* @author Kasper Skaarhoj <kasper@typo3.com>
*/
require_once(t3lib_extMgm::extPath('extrep_wizard').'pi/class.tx_extrepwizard.php');
/**
* Wrapped for Kickstarter extension used with extension repository...
* (Originally the Kickstarter was designed to run from the frontend of the typo3.org website rather than from the backend of TYPO3! This is why we have to wrap the frontend plugin class in this way to fit it into the backend!)
*
* @author Kasper Skaarhoj <kasper@typo3.com>
* @package TYPO3
* @subpackage core
*/
class em_kickstarter extends tx_extrepwizard {
/**
* Setting internal PI input data.
*
* @return void
*/
function getPIdata() {
$this->piData = t3lib_div::_GP($this->varPrefix);
}
/**
* Getting link to this page + extra parameters, we have specified
*
* @param array Additional parameters specified.
* @return string The URL
*/
function linkThisCmd($uPA=array()) {
$url = t3lib_div::linkThisScript($uPA);
return $url;
}
/**
* Font wrap function; Wrapping input string in a <span> tag with font family and font size set
*
* @param string Input value
* @return string Wrapped input value.
*/
function fw($str) {
return '<span style="font-family:verdana,arial,sans-serif; font-size:10px;">'.$str.'</span>';
}
/**
* [Not active... - do not use]
*
* @return void
*/
function makeRepositoryUpdateArray() {
debug('not active in EM');
}
/**
* Returns value from the fe_users field (faking that data...)
*
* @param string Field name
* @return string The faked field value
*/
function userField($fN) {
switch($fN) {
case 'name':
return $GLOBALS['BE_USER']->user['realName'];
break;
case 'email':
return $GLOBALS['BE_USER']->user['email'];
break;
case 'username':
return $GLOBALS['BE_USER']->user['username'];
break;
}
}
}
// Include extension?
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/tools/em/class.kickstarter.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/tools/em/class.kickstarter.php']);
}
?>
......@@ -52,7 +52,6 @@
* 608: function extensionList_loaded()
* 643: function extensionList_installed()
* 715: function extensionList_import()
* 868: function kickstarter()
* 885: function alterSettings()
*
* SECTION: Command Applications (triggered by GET var)
......@@ -66,7 +65,6 @@
* 1575: function getFileListOfExtension($extKey,$conf)
* 1626: function extDelete($extKey,$extInfo)
* 1658: function extUpdateEMCONF($extKey,$extInfo)
* 1678: function extMakeNewFromFramework($extKey,$extInfo)
* 1699: function extBackup($extKey,$extInfo)
* 1767: function extBackup_dumpDataTablesLine($tablesArray,$extKey)
* 1795: function extInformationArray($extKey,$extInfo,$remote=0)
......@@ -178,11 +176,7 @@ $BE_USER->modAccess($MCONF,1);
require_once(PATH_t3lib.'class.t3lib_tcemain.php');
require_once(PATH_t3lib.'class.t3lib_install.php');
require_once(PATH_t3lib.'class.t3lib_tsstyleconfig.php');
// Include kickstarter wrapped class if extension "extrep_wizard" turns out to be loaded!
if (t3lib_extMgm::isLoaded('extrep_wizard')) {
require('./class.kickstarter.php');
}
require_once(PATH_t3lib.'class.t3lib_scbase.php');
......@@ -197,7 +191,7 @@ if (t3lib_extMgm::isLoaded('extrep_wizard')) {
* @package TYPO3
* @subpackage core
*/
class SC_mod_tools_em_index {
class SC_mod_tools_em_index extends t3lib_SCbase {
// Internal, static:
var $versionDiffFactor = 1000; // This means that version difference testing for import is detected for sub-versions only, not dev-versions. Default: 1000
......@@ -405,6 +399,24 @@ class SC_mod_tools_em_index {
$this->fe_user['username'] = $this->MOD_SETTINGS['fe_u'];
$this->fe_user['password'] = $this->MOD_SETTINGS['fe_p'];
$this->fe_user['uploadPass'] = $this->MOD_SETTINGS['fe_up'];
parent::init();
$this->handleExternalFunctionValue('singleDetails');
}
/**
* This function is a copy of the same function in t3lib_SCbase with one modification:
* In contrast to t3lib_SCbase::handleExternalFunctionValue() this function merges the $this->extClassConf array
* instead of overwriting it. That was necessary for including the Kickstarter as a submodule into the 'singleDetails'
* selectorbox as well as in the main 'function' selectorbox.
*
* @see t3lib_SCbase::handleExternalFunctionValue()
*/
function handleExternalFunctionValue($MM_key='function', $MS_value=NULL) {
$MS_value = is_null($MS_value) ? $this->MOD_SETTINGS[$MM_key] : $MS_value;
$this->extClassConf = array_merge($this->getExternalItemConfig($this->MCONF['name'],$MM_key,$MS_value),$this->extClassConf);
if (is_array($this->extClassConf) && $this->extClassConf['path']) {
$this->include_once[]=$this->extClassConf['path'];
}
}
/**
......@@ -421,7 +433,6 @@ class SC_mod_tools_em_index {
0 => 'Loaded extensions',
1 => 'Available extensions to install',
2 => 'Import extensions from online repository',
4 => 'Make new extension',
3 => 'Settings',
),
'listOrder' => array(
......@@ -455,7 +466,9 @@ class SC_mod_tools_em_index {
'fe_p' => '',
'fe_up' => '',
);
$this->MOD_MENU['singleDetails'] = $this->mergeExternalItems($this->MCONF['name'],'singleDetails',$this->MOD_MENU['singleDetails']);
// page/be_user TSconfig settings and blinding of menu-items
if (!$BE_USER->getTSConfigVal('mod.'.$this->MCONF['name'].'.allowTVlisting')) {
unset($this->MOD_MENU['display_details'][3]);
......@@ -463,11 +476,6 @@ class SC_mod_tools_em_index {
unset($this->MOD_MENU['display_details'][5]);
}
// Remove kickstarter if extension is not loaded:
if (!t3lib_extMgm::isLoaded('extrep_wizard')) {
unset($this->MOD_MENU['function'][4]);
}
// CLEANSE SETTINGS
$this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']);
......@@ -480,6 +488,7 @@ class SC_mod_tools_em_index {
unset($this->MOD_MENU['display_details'][5]);
$this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']);
}
parent::menuConfig();
}
/**
......@@ -525,25 +534,25 @@ class SC_mod_tools_em_index {
$this->content.=$this->doc->section('','<span class="nobr">'.$menu.'</span>');
$this->content.=$this->doc->spacer(10);
switch($this->MOD_SETTINGS['function']) {
case 0:
switch((string)$this->MOD_SETTINGS['function']) {
case '0':
// Lists loaded (installed) extensions
$this->extensionList_loaded();
break;
case 1:
case '1':
// Lists the installed (available) extensions
$this->extensionList_installed();
break;
case 2:
case '2':
// Lists the extensions available from online rep.
$this->extensionList_import();
break;
case 3:
case '3':
// Lists the extensions available from online rep.
$this->alterSettings();
break;
case 4:
$this->kickstarter();
default:
$this->extObjContent();
break;
}
}
......@@ -850,25 +859,6 @@ EXTENSION KEYS:
$this->content.=$this->doc->section('Upload extension file directly (.t3x):',$content,0,1);
}
/**
* Making of new extensions with the kickstarter
*
* @return void
*/
function kickstarter() {
$kickstarter = t3lib_div::makeInstance('em_kickstarter');
$kickstarter->getPIdata();
$kickstarter->color = array($this->doc->bgColor5,$this->doc->bgColor4,$this->doc->bgColor);
$kickstarter->siteBackPath = $this->doc->backPath.'../';
$kickstarter->pObj = &$this;
$kickstarter->EMmode = 1;
$content = $kickstarter->mgm_wizard();
$this->content.='</form>'.
t3lib_BEfunc::cshItem('_MOD_tools_em', 'makenew', $GLOBALS['BACK_PATH'],'|<br/>').
$this->doc->section('Kickstarter wizard',$content,0,1).'<form>';
}
/**
* Allows changing of settings
*
......@@ -1435,9 +1425,6 @@ EXTENSION KEYS:
$content = $this->extUpdateEMCONF($extKey,$list[$extKey]);
$this->content.=$this->doc->section('Update EM_CONF',$content,0,1);
$content = $this->extMakeNewFromFramework($extKey,$list[$extKey]);
if ($content) $this->content.=$this->doc->section('Make new extension',$content,0,1);
break;
case 'dump':
$this->extDumpTables($extKey,$list[$extKey]);
......@@ -1452,6 +1439,9 @@ EXTENSION KEYS:
case 'updateModule':
$this->content.=$this->doc->section('Update:',$updateObj->main(),0,1);
break;
default:
$this->extObjContent();
break;
}
}
}
......@@ -1676,27 +1666,6 @@ EXTENSION KEYS:
}
}
/**
* Reload in Kickstarter Wizard
*
* @param string Extension key
* @param array Extension information array
* @return string HTML content
*/
function extMakeNewFromFramework($extKey,$extInfo) {
$absPath = $this->getExtPath($extKey,$extInfo['type']);
if (isset($this->MOD_MENU['function'][4]) && @is_file($absPath.'doc/wizard_form.dat')) {
$content = "The file '".substr($absPath."doc/wizard_form.dat",strlen(PATH_site))."' contains the data which this extension was originally made from with the 'Kickstarter' wizard.<br />Pressing this button will allow you to create another extension based on the that framework.<br /><br />";
$content.= '</form>
<form action="index.php?SET[function]=4" method="post">
<input type="submit" value="Start new" />
<input type="hidden" name="tx_extrep[wizArray_ser]" value="'.base64_encode(t3lib_div::getUrl($absPath.'doc/wizard_form.dat')).'" />
</form>
<form>';
return $content;
}
}
/**
* Download extension as file / make backup
*
......@@ -4365,6 +4334,10 @@ if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/mod/t
// Make instance:
$SOBE = t3lib_div::makeInstance('SC_mod_tools_em_index');
$SOBE->init();
foreach($SOBE->include_once as $INC_FILE) {
include_once($INC_FILE);
}
$SOBE->checkExtObj();
$SOBE->main();
$SOBE->printContent();
?>
Supports Markdown
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