/**
	 * Log off method for the signon-based phpMyAdmin extension. Called as post processing
	 * hook in t3lib_userauth.php. Deletes the signon cookies
	 *
	 * @param	array		$params: Additional params passed to the method
	 * @param	object		$ref: The parent object (BE User Auth)
	 * @return	void
	 */
	function pmaLogOff($params = array(), $ref = null) {

			// Define the cookie path
		$cookiePath = substr(t3lib_extmgm::extPath('phpmyadmin'), strlen($_SERVER['DOCUMENT_ROOT'])).'res/'.$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['phpmyadmin']['pmaDirname'].'/';

			// Just ensure that the path is starting with a slash
		if (strpos($cookiePath, '/') !== 0) {
			$cookiePath = '/'.$cookiePath;
		}

		setcookie('tx_phpmyadmin', '', time() - 3600);
		setcookie('tx_phpmyadmin', '', time() - 3600, '/');
		setcookie('tx_phpmyadmin', '', time() - 3600, $cookiePath);
		setcookie('phpMyAdmin', '', time() - 3600);
		setcookie('phpMyAdmin', '', time() - 3600, '/');
		setcookie('phpMyAdmin', '', time() - 3600, $cookiePath);

			// Create signon session
		$session_name = 'tx_phpmyadmin';
		session_name($session_name);
		session_start();

			// Try to get the TYPO3 backend uri even if it's installed in a subdirectory
		$path_typo3 = substr(PATH_typo3, strlen($_SERVER['DOCUMENT_ROOT']), strlen(PATH_typo3));
		$path_typo3 = (substr($path_typo3, 0, 1) != '/'  ? '/'.$path_typo3 : $path_typo3);

		$_SESSION['PMA_LogoutURL'] = $path_typo3.'logout.php';
		$_SESSION['PMA_SignonURL'] = $path_typo3.'index.php';
		$_SESSION['PMA_LogoutURL'] = $path_typo3.'logout.php';

		// Close that session
		session_write_close();

	}
Пример #2
0
 /**
  * Constructs a test case with the given name.
  *
  * @param  string $name
  * @param  array  $data
  * @param  string $dataName
  */
 public function __construct($name = NULL, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     if (!class_exists('Tx_Extbase_Utility_ClassLoader')) {
         require t3lib_extmgm::extPath('extbase') . 'Classes/Utility/ClassLoader.php';
     }
     spl_autoload_register(array('Tx_Extbase_Utility_ClassLoader', 'loadClass'));
 }
Пример #3
0
 /**
  * Initializes the autoload mechanism of Extbase. This is supplement to the core autoloader.
  *
  * @return void
  * @see initialize()
  */
 protected function initializeClassLoader()
 {
     if (!class_exists('Tx_Extbase_Utility_ClassLoader', FALSE)) {
         require t3lib_extmgm::extPath('extbase') . 'Classes/Utility/ClassLoader.php';
     }
     $classLoader = new Tx_Extbase_Utility_ClassLoader();
     spl_autoload_register(array($classLoader, 'loadClass'));
 }
 public function userFunc()
 {
     if (!class_exists('Tx_Extbase_Utility_ClassLoader')) {
         require t3lib_extmgm::extPath('extbase') . 'Classes/Utility/ClassLoader.php';
     }
     $classLoader = new Tx_Extbase_Utility_ClassLoader();
     spl_autoload_register(array($classLoader, 'loadClass'));
     return $this->generateDocbook('Tx_Fluid_ViewHelpers');
 }
Пример #5
0
 /**
  * @test
  */
 function mergeLocallangXmlWithXlf()
 {
     $this->markTestSkipped('The support for merging xml files with xlf is postponed.');
     $existingFile = t3lib_extmgm::extPath('extension_builder') . 'Tests/Examples/Tools/existing_locallang.xml';
     $newXlf = "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>\n\t\t\t<xliff version='1.0'>\n\t\t\t\t<file source-language='en' datatype='plaintext' original='messages' date='2012-03-47T19:00:47Z' product-name='test123'>\n\t\t\t\t\t<header/>\n\t\t\t\t\t<body>\n\t\t\t\t\t\t<trans-unit id='tx_test_index1'>\n\t\t\t\t\t\t\t<source>Label 1</source>\n\t\t\t\t\t\t</trans-unit>\n\t\t\t\t\t\t<trans-unit id='tx_test_index3'>\n\t\t\t\t\t\t\t<source>Additional label 3</source>\n\t\t\t\t\t\t</trans-unit>\n\t\t\t\t\t</body>\n\t\t\t\t</file>\n\t\t\t</xliff>";
     $result = Tx_ExtensionBuilder_Utility_Tools::mergeLocallangXml($existingFile, $newXlf, 'xlf');
     $expected = array('tx_test_index1' => 'Label 1 modified', 'tx_test_index3' => 'Additional label 3', 'tx_test_index2' => 'Label 2');
     $this->assertEquals($result, $expected);
 }
 /**
  * Parse a complex class from a file
  * @test
  */
 public function ParseAnotherComplexClass()
 {
     require_once t3lib_extmgm::extPath('extension_builder') . 'Tests/Examples/ClassParser/AnotherComplexClass.php';
     $classObject = $this->parseClass('Tx_ExtensionBuilder_Tests_Examples_ClassParser_AnotherComplexClass');
     /**  here we could include some more tests
     		$p = $classObject->getMethod('methodWithStrangePrecedingBlock')->getPrecedingBlock();
     		$a = $classObject->getAppendedBlock();
     		 */
 }
 /**
  * Hook-function: inject t3editor JavaScript code before the page is compiled
  * called in typo3/template.php:startPage
  *
  * @param array $parameters
  * @param template $pObj
  */
 public function preStartPageHook($parameters, $pObj)
 {
     // enable editor in Template-Modul
     if (preg_match('/sysext\\/tstemplate\\/ts\\/index\\.php/', $_SERVER['SCRIPT_NAME'])) {
         $t3editor = $this->getT3editor();
         // insert javascript code in document header
         $pObj->JScode .= $t3editor->getJavascriptCode($pObj);
         $pObj->loadJavascriptLib(t3lib_extmgm::extRelPath('t3editor') . 'res/jslib/tx_tstemplateinfo/tx_tstemplateinfo.js');
     }
 }
Пример #8
0
 /**
  * Hook-function: inject t3editor JavaScript code before the page is compiled
  * called in typo3/template.php:startPage
  *
  * @param array $parameters
  * @param \TYPO3\CMS\Backend\Template\DocumentTemplate $pObj
  */
 public function preStartPageHook($parameters, $pObj)
 {
     if (preg_match('/typo3\\/file_edit\\.php/', $_SERVER['SCRIPT_NAME'])) {
         $t3editor = $this->getT3editor();
         if (!$t3editor->isEnabled()) {
             return;
         }
         $pObj->JScode .= $t3editor->getJavascriptCode($pObj);
         $pObj->loadJavascriptLib(\t3lib_extmgm::extRelPath('t3editor') . 'res/jslib/fileedit.js');
     }
 }
 function loadContentRepositoryFramework()
 {
     $sExtBasePath = t3lib_extmgm::extPath("extbase");
     require_once $sExtBasePath . "Classes/Utility/Strings.php";
     require_once $sExtBasePath . "Classes/Exception.php";
     require_once $sExtBasePath . "Classes/Persistence/Session.php";
     require_once $sExtBasePath . "Classes/Persistence/ObjectStorage.php";
     require_once $sExtBasePath . "Classes/Persistence/Mapper/DataMap.php";
     require_once $sExtBasePath . "Classes/Persistence/Mapper/ColumnMap.php";
     require_once $sExtBasePath . "Classes/Persistence/Mapper/ObjectRelationalMapper.php";
     require_once $sExtBasePath . "Classes/Persistence/RepositoryInterface.php";
     require_once $sExtBasePath . "Classes/Persistence/Repository.php";
     require_once $sExtBasePath . "Classes/DomainObject/DomainObjectInterface.php";
     require_once $sExtBasePath . "Classes/DomainObject/AbstractDomainObject.php";
 }
Пример #10
0
 private function includeFluid()
 {
     # no autoinclude for the moment
     $this->sExtbasePath = t3lib_extmgm::extPath("extbase");
     $this->sFluidPath = t3lib_extmgm::extPath("fluid");
     require_once $this->sExtbasePath . "Classes/MVC/View/ViewInterface.php";
     require_once $this->sExtbasePath . "Classes/MVC/View/AbstractView.php";
     require_once $this->sExtbasePath . "Classes/MVC/View/Helper/URIHelper.php";
     require_once $this->sExtbasePath . "Classes/Reflection/DocCommentParser.php";
     require_once $this->sExtbasePath . "Classes/Reflection/ClassReflection.php";
     require_once $this->sExtbasePath . "Classes/Reflection/ParameterReflection.php";
     require_once $this->sExtbasePath . "Classes/Reflection/MethodReflection.php";
     require_once $this->sExtbasePath . "Classes/Reflection/Service.php";
     require_once $this->sFluidPath . "Classes/Fluid.php";
     require_once $this->sFluidPath . "Classes/Exception.php";
     require_once $this->sFluidPath . "Classes/Core/VariableContainer.php";
     require_once $this->sFluidPath . "Classes/Core/ParsedTemplateInterface.php";
     require_once $this->sFluidPath . "Classes/Core/ParsingState.php";
     require_once $this->sFluidPath . "Classes/Core/TemplateParser.php";
     require_once $this->sFluidPath . "Classes/Core/ArgumentDefinition.php";
     require_once $this->sFluidPath . "Classes/Core/ViewHelperInterface.php";
     require_once $this->sFluidPath . "Classes/Core/AbstractViewHelper.php";
     require_once $this->sFluidPath . "Classes/Core/ViewHelperArguments.php";
     require_once $this->sFluidPath . "Classes/Core/Exception.php";
     require_once $this->sFluidPath . "Classes/Core/RuntimeException.php";
     require_once $this->sFluidPath . "Classes/Core/ParsingException.php";
     require_once $this->sFluidPath . "Classes/Core/TagBasedViewHelper.php";
     require_once $this->sFluidPath . "Classes/Core/SyntaxTree/AbstractNode.php";
     require_once $this->sFluidPath . "Classes/Core/SyntaxTree/RootNode.php";
     require_once $this->sFluidPath . "Classes/Core/SyntaxTree/ViewHelperNode.php";
     require_once $this->sFluidPath . "Classes/Core/SyntaxTree/ObjectAccessorNode.php";
     require_once $this->sFluidPath . "Classes/Core/SyntaxTree/TextNode.php";
     require_once $this->sFluidPath . "Classes/Core/SyntaxTree/ArrayNode.php";
     require_once $this->sFluidPath . "Classes/Compatibility/ObjectFactory.php";
     require_once $this->sFluidPath . "Classes/Compatibility/TemplateParserBuilder.php";
     require_once $this->sFluidPath . "Classes/Compatibility/Validation/ValidatorResolver.php";
     require_once $this->sFluidPath . "Classes/Compatibility/Validation/DummyValidator.php";
     require_once $this->sFluidPath . "Classes/Compatibility/Validation/Errors.php";
     require_once $this->sFluidPath . "Classes/View/TemplateView.php";
     require_once $this->sFluidPath . "Classes/ViewHelpers/ForViewHelper.php";
     require_once $this->sFluidPath . "Classes/ViewHelpers/TypolinkViewHelper.php";
 }
Пример #11
0
    /**
     * Renders a single service's row.
     *
     * @param string $serviceKey The service key to access the service.
     * @param array $serviceInformation registration information of the service.
     * @return string HTML row for the service.
     */
    protected function renderServiceRow($serviceKey, $serviceInformation)
    {
        $serviceDescription = '
			<p class="service-header">
				<span class="service-title">' . $serviceInformation['title'] . '</span> (' . $serviceInformation['extKey'] . ': ' . $serviceKey . ')
			</p>';
        if (!empty($serviceInformation['description'])) {
            $serviceDescription .= '<p class="service-description">' . $serviceInformation['description'] . '</p>';
        }
        $serviceSubtypes = empty($serviceInformation['serviceSubTypes']) ? '-' : implode(', ', $serviceInformation['serviceSubTypes']);
        $serviceOperatingSystem = empty($serviceInformation['os']) ? $GLOBALS['LANG']->getLL('any') : $serviceInformation['os'];
        $serviceRequiredExecutables = empty($serviceInformation['exec']) ? '-' : $serviceInformation['exec'];
        $serviceAvailabilityClass = 'typo3-message message-error';
        $serviceAvailable = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:no');
        try {
            $serviceDetails = \t3lib_extmgm::findServiceByKey($serviceKey);
            if ($serviceDetails['available']) {
                $serviceAvailabilityClass = 'typo3-message message-ok';
                $serviceAvailable = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes');
            }
        } catch (\TYPO3\CMS\Core\Exception $e) {
        }
        $serviceRow = '
		<tr class="service">
			<td class="first-cell ' . $serviceAvailabilityClass . '">' . $serviceDescription . '</td>
			<td class="cell ' . $serviceAvailabilityClass . '">' . $serviceInformation['priority'] . '</td>
			<td class="cell ' . $serviceAvailabilityClass . '">' . $serviceInformation['quality'] . '</td>
			<td class="cell ' . $serviceAvailabilityClass . '">' . $serviceSubtypes . '</td>
			<td class="cell ' . $serviceAvailabilityClass . '">' . $serviceOperatingSystem . '</td>
			<td class="cell ' . $serviceAvailabilityClass . '">' . $serviceRequiredExecutables . '</td>
			<td class="last-cell ' . $serviceAvailabilityClass . '">' . $serviceAvailable . '</td>
		</tr>';
        return $serviceRow;
    }
 /**
  * tx_dam::file_relativeSitePath()
  */
 public function test_file_relativeSitePath()
 {
     $GLOBALS['T3_VAR']['ext']['dam']['pathInfoCache'] = array();
     $filepath = $this->getFixtureFilename();
     $filename = tx_dam::file_basename($filepath);
     $testpath = tx_dam::file_dirname($filepath);
     $relPath = t3lib_extmgm::siteRelPath('dam') . 'tests/fixtures/' . $filename;
     $path = tx_dam::path_makeClean($testpath);
     $path = tx_dam::path_makeRelative($path);
     $path = tx_dam::file_relativeSitePath($path . $filename);
     self::assertEquals($path, $relPath, 'File path differs: ' . $path . ' (' . $relPath . ')');
     $filepath = $this->getFixtureFilename();
     $fileinfo = tx_dam::file_compileInfo($filepath, $ignoreExistence = false);
     $path = tx_dam::file_relativeSitePath($fileinfo);
     self::assertEquals($path, $relPath, 'File path differs: ' . $path . ' (' . $relPath . ')');
 }
<?php

require_once t3lib_extmgm::extPath('fluid') . 'Tests/Unit/ViewHelpers/ViewHelperBaseTestcase.php';
/**
 * testing the features of the Condition_OneNotEmptyViewHelper
 * 
 * @author Christian Zenker <*****@*****.**>
 */
class Condition_OneNotEmptyViewHelperTest extends Tx_Fluid_ViewHelpers_ViewHelperBaseTestcase
{
    protected $viewHelper = null;
    protected $viewHelperVariableContainer = null;
    protected $viewHelperNode = null;
    public function setUp()
    {
        parent::setUp();
        $this->initViewHelper();
    }
    protected function initViewHelper()
    {
        $this->viewHelper = new Tx_CzSimpleCal_ViewHelpers_Condition_OneNotEmptyViewHelper();
    }
    public function testEmptyValues()
    {
        self::assertSame(false, $this->viewHelper->render(array()), 'nothing at all');
        self::assertSame(false, $this->viewHelper->render(array('')), 'empty string');
        self::assertSame(false, $this->viewHelper->render(array(0)), '0');
        self::assertSame(false, $this->viewHelper->render(array(false)), 'boolean false');
        self::assertSame(false, $this->viewHelper->render(array('0')), 'string with a 0');
        self::assertSame(false, $this->viewHelper->render(array(array())), 'empty array');
    }
Пример #14
0
<?php

/*                                                                        *
 * This script is part of the TypoGento project 						  *
 *                                                                        *
 * TypoGento is free software; you can redistribute it and/or modify it   *
 * under the terms of the GNU General Public License version 2 as         *
 * published by the Free Software Foundation.                             *
 *                                                                        *
 * This script is distributed in the hope that it will be useful, but     *
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
 * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
 * Public License for more details.                                       *
 *                                                                        */
require_once t3lib_extmgm::extPath('fb_magento') . 'lib/class.tx_fbmagento_tools.php';
/**
 * TypoGento Cache
 *
 * @version $Id: class.tx_fbmagento_interface.php 25 2009-01-21 16:43:16Z vinai $
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
 */
class tx_fbmagento_cache
{
    /**
     * Cache Handler
     *
     * @var ArrayObject
     */
    protected $_handler = null;
    /**
     * Singleton instance
Пример #15
0
 *  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.
 *
 *  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!
 ***************************************************************/
require_once t3lib_extmgm::extPath('php_parser_api') . 'Tests/BaseTest.php';
class Tx_PhpParser_Tests_Unit_ParserTest extends Tx_PhpParser_Tests_BaseTest
{
    /**
     * @var Tx_PhpParser_Service_Parser
     */
    protected $parser;
    /**
     * @test
     */
    function parseSimpleProperty()
    {
        $classFileObject = $this->parseFile('SimpleProperty.php');
        $this->assertEquals(count($classFileObject->getClasses()), 1);
        $classObject = $classFileObject->getFirstClass();
        $this->assertEquals(count($classObject->getMethods()), 0);
Пример #16
0
 /**
  * Determine the correct parser js file for given mode
  *
  * @param string $mode
  * @return string Parser file name
  */
 protected function getParserfileByMode($mode)
 {
     switch ($mode) {
         case self::MODE_TYPOSCRIPT:
             $relPath = ($GLOBALS['BACK_PATH'] ? $GLOBALS['BACK_PATH'] : '../../../') . \t3lib_extmgm::extRelPath('t3editor') . 'res/jslib/parse_typoscript/';
             $parserfile = '["' . $relPath . 'tokenizetyposcript.js", "' . $relPath . 'parsetyposcript.js"]';
             break;
         case self::MODE_JAVASCRIPT:
             $parserfile = '["tokenizejavascript.js", "parsejavascript.js"]';
             break;
         case self::MODE_CSS:
             $parserfile = '"parsecss.js"';
             break;
         case self::MODE_XML:
             $parserfile = '"parsexml.js"';
             break;
         case self::MODE_SPARQL:
             $parserfile = '"parsesparql.js"';
             break;
         case self::MODE_HTML:
             $parserfile = '["tokenizejavascript.js", "parsejavascript.js", "parsecss.js", "parsexml.js", "parsehtmlmixed.js"]';
             break;
         case self::MODE_PHP:
         case self::MODE_MIXED:
             $parserfile = '[' . '"tokenizejavascript.js", ' . '"parsejavascript.js", ' . '"parsecss.js", ' . '"parsexml.js", ' . '"../contrib/php/js/tokenizephp.js", ' . '"../contrib/php/js/parsephp.js", ' . '"../contrib/php/js/parsephphtmlmixed.js"' . ']';
             break;
     }
     return $parserfile;
 }
 /**
  * searches extensions in a given path
  *
  * Modes for $state:
  * 0 - loaded and unloaded
  * 1 - only loaded
  * 2 - only unloaded
  *
  * @throws Exception raised, if the given path cant be opened for reading
  * @param string path
  * @param integer optional: extension state to ignore (see above)
  * @param string optional: directories to ignore (regular expression; pcre with slashes)
  * @return array result of the search
  */
 public static function searchExtensions($path, $state = 0, $extIgnoreRegExp = '')
 {
     if (!@($fhd = opendir($path))) {
         throw new Exception('cant open "' . $path . '"');
     }
     while ($extDir = readdir($fhd)) {
         $extDirPath = $path . '/' . $extDir;
         // ignore all unless the file is a directory and no point dir
         if (!is_dir($extDirPath) || preg_match('/^\\.{1,2}$/', $extDir)) {
             continue;
         }
         // check, if the directory/extension should be saved
         if (preg_match($extIgnoreRegExp, $extDir)) {
             continue;
         }
         // state filter
         if ($state) {
             $extState = intval(t3lib_extmgm::isLoaded($extDir));
             if ($extState && $state == 2 || !$extState && $state == 1) {
                 continue;
             }
         }
         $extArray[] = $extDirPath;
     }
     closedir($fhd);
     return $extArray;
 }
Пример #18
0
    function _includeFormidablePath()
    {
        $sPath = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . t3lib_extmgm::siteRelPath("ameos_formidable");
        $sScript = <<<JAVASCRIPT

\tFormidable.initialize({path: '{$sPath}'});

JAVASCRIPT;
        $this->oForm->attachInitTask($sScript, "Framework Formidable.path initialization");
    }
Пример #19
0
 public function formatValue($mValue)
 {
     if (t3lib_extmgm::isLoaded("dam")) {
         if (is_numeric($mValue)) {
             $oMedia = tx_dam::media_getByUid($mValue);
             return $oMedia->meta['file_name'];
         }
     }
     return $mValue;
 }
Пример #20
0
 /**
  * @test
  */
 function addMethodFromTemplateToNewClass()
 {
     $templateClassFileObject = $this->parser->parseFile(t3lib_extmgm::extPath('php_parser_api') . 'Resources/Private/Templates/MethodTemplates.php');
     $getPropertyMethod = $templateClassFileObject->getFirstClass()->getMethod('getPropertyName');
     $newClassFileObject = new Tx_PhpParser_Domain_Model_File();
     $newClassName = 'Tx_PhpParser_Test_NewClassWithTemplateMethod';
     $newClass = new Tx_PhpParser_Domain_Model_Class($newClassName);
     $newClass->addMethod($getPropertyMethod);
     $newClassFileObject->addClass($newClass);
     $newClassFilePath = $this->testDir . 'NewClassWithTemplateMethod.php';
     t3lib_div::writeFile($newClassFilePath, "<?php\n\n" . $this->printer->renderFileObject($newClassFileObject) . "\n?>");
     $this->assertTrue(file_exists($newClassFilePath));
     require_once $newClassFilePath;
     $this->assertTrue(class_exists($newClassName));
     $this->compareClasses($newClassFileObject, $newClassFilePath);
 }
<?php

require_once t3lib_extmgm::extPath('fluid') . 'Tests/Unit/ViewHelpers/ViewHelperBaseTestcase.php';
require_once t3lib_extmgm::extPath('cz_simple_cal') . 'Tests/Mocks/ViewHelpers/Format/TimespanToWordsViewHelper.php';
/**
 * testing the features of the Format_TimespanToWordsViewHelper
 * 
 * @author Christian Zenker <*****@*****.**>
 */
class Format_TimespanToWordsViewHelperTest extends Tx_Fluid_ViewHelpers_ViewHelperBaseTestcase
{
    protected $viewHelper = null;
    public function setUp()
    {
        parent::setUp();
        $this->viewHelper = new Tx_CzSimpleCalTests_Mock_ViewHelpers_Format_TimespanToWordsViewHelper();
    }
    public function testOnOneDay()
    {
        self::assertEquals('on February 13, 2009', $this->viewHelper->render(new Tx_CzSimpleCal_Utility_DateTime('2009-02-13'), new Tx_CzSimpleCal_Utility_DateTime('2009-02-13')));
    }
    public function testOnOneMonth()
    {
        self::assertEquals('from February 13 to 15, 2009', $this->viewHelper->render(new Tx_CzSimpleCal_Utility_DateTime('2009-02-13'), new Tx_CzSimpleCal_Utility_DateTime('2009-02-15')));
    }
    public function testOnOneYear()
    {
        self::assertEquals('from February 13 to March 15, 2009', $this->viewHelper->render(new Tx_CzSimpleCal_Utility_DateTime('2009-02-13'), new Tx_CzSimpleCal_Utility_DateTime('2009-03-15')));
    }
    public function testElse()
    {
<?php

/*                                                                        *
 * This script is part of the TypoGento project 						  *
 *                                                                        *
 * TypoGento is free software; you can redistribute it and/or modify it   *
 * under the terms of the GNU General Public License version 2 as         *
 * published by the Free Software Foundation.                             *
 *                                                                        *
 * This script is distributed in the hope that it will be useful, but     *
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
 * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General      *
 * Public License for more details.                                       *
 *                                                                        */
require_once t3lib_extmgm::extPath('fb_magento') . 'lib/class.tx_fbmagento_tools.php';
require_once t3lib_extmgm::extPath('fb_magento') . 'lib/class.tx_fbmagento_interface.php';
#
/**
 * TypoGento hookobserver
 *
 * @version $Id: class.tx_fbmagento_interface.php 25 2009-01-21 16:43:16Z vinai $
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
 */
class tx_fbmagento_hookobserver
{
    /**
     * logoff Hook
     * 
     * @param array $params
     * @param t3lib_userAuth $pObj
     */
    /**
     * including of all nessecary core files (gzip or seperate, additional language files, callbackJS)
     * 
     * @param	array		config to use
     * @return	array		code incl. script tags
     */
    function getCoreScript($config)
    {
        $code = '';
        $loaded = t3lib_extmgm::isLoaded($config['languagesExtension']) ? 1 : 0;
        if ($config['gzip']) {
            $code .= '
				<script type="text/javascript" src="' . $config['tiny_mceGzipPath'] . '"></script>
				<script type="text/javascript">
				tinyMCE_GZ.init({
					plugins : "' . $config['init.']['plugins'] . '",
					themes : "advanced",
					languages : "' . $config['init.']['language'] . '",
					disk_cache : ' . $config['gzipFileCache'] . ',
					langExt : "' . $config['languagesExtension'] . '",
					langExtLoaded : ' . $loaded . ',
					debug : false
				});
				</script>
			';
        } else {
            $code .= '<script type="text/javascript" src="' . $config['tiny_mcePath'] . '"></script>';
            if (t3lib_extmgm::isLoaded($config['languagesExtension']) && $config['init.']['language'] != 'en' && $config['init.']['language'] != 'de') {
                $code .= '<script type="text/javascript">';
                $code .= $this->loadLanguageExtension($config['init.']['language'], $config['init.']['plugins'], $this->getPath('EXT:' . $config['languagesExtension'] . '/tiny_mce/'));
                $code .= '</script>';
            }
        }
        return $code;
    }
Пример #24
0
    private $arrayProperty2 = array('test' => 3, 'b' => 'q');
    static $constProperty = testConstant;
    /**
     * @static
     * @param $param1
     * @param $param2
     * @param string $param3
     * @param array $param4
     * @return int
     */
    static function methodWithVariousParameter($param1, &$param2, $param3 = 'default', array $param4 = array('test' => array(1, 2, 3)))
    {
        /**
         * test test
         */
        $test = 234;
        return 5;
        // test test
    }
    const another_Constant = "r5r_8";
    // single line comment
    var $testProperty4 = 123;
}
/**
 *  dfg dfg dfg dfg
 */
require_once t3lib_extmgm::extPath('extension_builder') . 'Tests/Examples/ClassParser/BasicClass.php';
include_once t3lib_extmgm::extPath('extension_builder') . 'Tests/Examples/ComplexClass.php';
// test
include_once t3lib_extmgm::extPath('extension_builder') . 'Tests/Examples/ClassParser/ComplexClass.php';
// test
Пример #25
0
 /**
  * Retrieves path and filename of the not-found-template
  *
  * @return string path and filename of the not-found-template
  * @author Bastian Waidelich <*****@*****.**>
  */
 protected function getTemplatePathAndFilename()
 {
     return t3lib_extmgm::extPath('extbase') . 'Resources/Private/MVC/NotFoundView_Template.html';
 }
Пример #26
0
t3lib_div::loadTCA("fe_users");
t3lib_extMgm::addTCAcolumns("fe_users", $tempColumns, 1);
t3lib_extMgm::addToAllTCAtypes("fe_users", "firstname;;;;1-1-1");
t3lib_extMgm::addToAllTCAtypes("fe_users", "tx_fbmagento_id;;;;1-1-1");
// add store mapping
$tempColumns = array("tx_fbmagento_store" => array("exclude" => 0, "label" => "LLL:EXT:fb_magento/locallang_db.xml:sys_language.tx_fbmagento_store", "config" => array("type" => "select", "itemsProcFunc" => "EXT:fb_magento/lib/class.tx_fbmagento_tcafields.php:tx_fbmagento_tcafields->itemsProcFunc_languages", "maxitems" => 1)));
t3lib_div::loadTCA("sys_language");
t3lib_extMgm::addTCAcolumns("sys_language", $tempColumns, 1);
t3lib_extMgm::addToAllTCAtypes("sys_language", "tx_fbmagento_store;;;;1-1-1");
// add group mapping
$tempColumns = array("tx_fbmagento_group" => array("exclude" => 0, "label" => "LLL:EXT:fb_magento/locallang_db.xml:be_users.tx_fbmagento_group", "config" => array("type" => "select", "items" => array(array('LLL:EXT:fb_magento/locallang_db.xml:be_users.tx_fbmagento_group.0', '')), "itemsProcFunc" => "EXT:fb_magento/lib/class.tx_fbmagento_tcafields.php:tx_fbmagento_tcafields->itemsProcFunc_usergroups", "maxitems" => 1)));
t3lib_div::loadTCA("be_users");
t3lib_extMgm::addTCAcolumns("be_users", $tempColumns, 1);
t3lib_extMgm::addToAllTCAtypes("be_users", "tx_fbmagento_group;;;;1-1-1");
if (TYPO3_MODE == "BE") {
    // add module after 'Web'
    if (!isset($TBE_MODULES['txfbmagentoMgroup'])) {
        $temp_TBE_MODULES = array();
        foreach ($TBE_MODULES as $key => $val) {
            $temp_TBE_MODULES[$key] = $val;
            if ($key == 'web') {
                $temp_TBE_MODULES['txfbmagentoMgroup'] = $val;
            }
        }
        $TBE_MODULES = $temp_TBE_MODULES;
    }
    // add group module
    t3lib_extMgm::addModule('txfbmagentoMgroup', '', '', t3lib_extmgm::extPath($_EXTKEY) . 'mod_group/');
    // add admin module
    t3lib_extMgm::addModule('txfbmagentoMgroup', 'txfbmagentoMadmin', '', t3lib_extmgm::extPath($_EXTKEY) . 'mod_admin/');
}
Пример #27
0
 protected function parseFile($fileName)
 {
     $classFilePath = t3lib_extmgm::extPath('php_parser_api') . 'Tests/Fixtures/' . $fileName;
     $classFileObject = $this->parser->parseFile($classFilePath);
     return $classFileObject;
 }
Пример #28
0
 /**
  * Returns the localized labels from an extension's language file.
  *
  * @param string $extensionName
  *        the extension name to get the localized labels from file for,
  *        must not be empty, the corresponding extension must be loaded
  *
  * @return string[] the localized labels from an extension's language file, will be empty if there are none
  */
 private function getLocalizedLabelsFromFile($extensionName)
 {
     if ($extensionName === '') {
         throw new InvalidArgumentException('The parameter $extensionName must not be empty.', 1331489618);
     }
     $languageFile = t3lib_extmgm::extPath($extensionName) . self::LANGUAGE_FILE_PATH;
     $localizedLabels = t3lib_div::readLLfile($languageFile, $this->languageKey, $this->renderCharset);
     if ($this->alternativeLanguageKey !== '') {
         $alternativeLocalizedLabels = t3lib_div::readLLfile($languageFile, $this->alternativeLanguageKey, $this->renderCharset);
         $localizedLabels = array_merge($alternativeLocalizedLabels, is_array($localizedLabels) ? $localizedLabels : array());
     }
     return $localizedLabels;
 }
 /**
  * Retrieves JavaScript code (header part) for editor
  *
  * @param 	template	$doc
  * @return	string		JavaScript code
  */
 public function getJavascriptCode($doc)
 {
     $content = '';
     if ($this->isEnabled()) {
         $path_t3e = t3lib_extmgm::extRelPath('t3editor');
         // include needed javascript-frameworks
         /** @var $pageRenderer t3lib_PageRenderer */
         $pageRenderer = $doc->getPageRenderer();
         $pageRenderer->loadPrototype();
         $pageRenderer->loadScriptaculous();
         // include editor-css
         $content .= '<link href="' . t3lib_div::createVersionNumberedFilename($GLOBALS['BACK_PATH'] . t3lib_extmgm::extRelPath('t3editor') . 'res/css/t3editor.css') . '" type="text/css" rel="stylesheet" />';
         // include editor-js-lib
         $doc->loadJavascriptLib($path_t3e . 'res/jslib/codemirror/codemirror.js');
         $doc->loadJavascriptLib($path_t3e . 'res/jslib/t3editor.js');
         if ($this->mode == self::MODE_TYPOSCRIPT) {
             $doc->loadJavascriptLib($path_t3e . 'res/jslib/ts_codecompletion/tsref.js');
             $doc->loadJavascriptLib($path_t3e . 'res/jslib/ts_codecompletion/completionresult.js');
             $doc->loadJavascriptLib($path_t3e . 'res/jslib/ts_codecompletion/tsparser.js');
             $doc->loadJavascriptLib($path_t3e . 'res/jslib/ts_codecompletion/tscodecompletion.js');
         }
         $content .= t3lib_div::wrapJS('T3editor = T3editor || {};' . 'T3editor.lang = ' . json_encode($this->getJavaScriptLabels()) . ';' . LF . 'T3editor.PATH_t3e = "' . $GLOBALS['BACK_PATH'] . t3lib_extmgm::extRelPath('t3editor') . '"; ' . LF . 'T3editor.URL_typo3 = "' . htmlspecialchars(t3lib_div::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir) . '"; ' . LF . 'T3editor.template = ' . $this->getPreparedTemplate() . ';' . LF . 'T3editor.parserfile = ' . $this->getParserfileByMode($this->mode) . ';' . LF . 'T3editor.stylesheet = ' . $this->getStylesheetByMode($this->mode) . ';');
     }
     return $content;
 }
 /**
  * Prints a row with data for the various service listings
  *
  * @param	string		$type: ...
  * @param	string		$eKey: ...
  * @param	string		$eConf: ... unused
  * @param	array		$info: ...
  * @param	array		$cells: ...
  * @param	string		$bgColor: ...
  * @param	array		$inst_list: ...
  * @param	boolean		$import: ...
  * @param	string		$altLinkUrl: ...
  * @return	string HTML content
  */
 function serviceListRow($type, $eKey, $eConf, $info, $cells, $bgColor = "", $inst_list = array(), $import = 0, $altLinkUrl = '')
 {
     $svKey = $info['sv']['serviceKey'];
     $imgInfo = @getImageSize($this->getExtPath($eKey, $info) . '/ext_icon.gif');
     if (is_array($imgInfo)) {
         $extIcon = '<td valign="top"><img src="' . $GLOBALS['BACK_PATH'] . $this->typeRelPaths[$info['type']] . $eKey . '/ext_icon.gif' . '" ' . $imgInfo[3] . '></td>';
     } elseif ($info['_ICON']) {
         $extIcon = '<td valign="top">' . $info['_ICON'] . '</td>';
     } else {
         $extIcon = '<td><img src="clear.gif" width=1 height=1></td>';
     }
     $bgColor = t3lib_div::modifyHTMLcolor($this->pObj->doc->bgColor4, 20, 20, 20);
     if ($type === 'typeList') {
         $bgColor = '#F6CA96';
         $cells[] = $extIcon;
         $title = '<strong>' . $info['sv']['serviceType'] . ' (Service Type)</strong>';
         $cells[] = '<td valign="top">' . $title . '<br />' . htmlspecialchars(t3lib_div::fixed_lgd_cs($this->svDef[$info['sv']['serviceType']]['desc'], 400)) . '</td>';
         $cells[] = '<td nowrap="nowrap" valign="top"></td>';
         $cells[] = '<td nowrap="nowrap" valign="top"></td>';
         $cells[] = '<td nowrap="nowrap" valign="top"></td>';
         $icon = '';
     } else {
         $cells[] = '<td><img src="clear.gif" width=1 height=1></td>';
         $title = '<strong>' . $info['sv']['title'] . '</strong><br />[' . $info['sv']['serviceKey'] . ']';
         $cells[] = '<td valign="top">' . $title . '<div style="margin-top:6px;">' . htmlspecialchars(t3lib_div::fixed_lgd_cs($info['sv']['description'], 400)) . '<div></td>';
         $cells[] = '<td valign="top">' . implode($info['sv']['serviceSubTypes'], ', ') . '</td>';
         $cells[] = '<td nowrap="nowrap" valign="top">' . $info['sv']['os'] . '</td>';
         $cells[] = '<td nowrap="nowrap" valign="top">' . $info['sv']['exec'] . '</td>';
         if (t3lib_extmgm::findService($svKey, '*')) {
             $icon = '<img ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/icon_ok.gif') . ' vspace="4" />';
         } else {
             $icon = '<img ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/icon_fatalerror.gif') . ' vspace="4" />';
             $bgColor = t3lib_div::modifyHTMLcolor($this->pObj->doc->bgColor2, 30, 30, 30);
         }
     }
     $cells[] = '<td nowrap="nowrap" valign="top" align="center">' . $icon . '</td>';
     $bgColor = ' bgColor="' . ($bgColor ? $bgColor : $this->pObj->doc->bgColor4) . '"';
     return '<tr' . $bgColor . '>' . implode('', $cells) . '</tr>';
 }