public static function mysql2Connect()
 {
     $mysql2Sql = t3lib_div::makeInstance('t3lib_db');
     $mysql2Sql->sql_pconnect("mysql2.hs-esslingen.de", "rzlx33xxtypo3_ro", "Neuhioceid3") or die('Could not connect to Mysql server "mysql2.hs-esslingen.de".');
     $mysql2Sql->sql_select_db("wetterstation") or die('Could not select database "wetterstation".');
     return $mysql2Sql;
 }
 /**
  * Function executed from the Scheduler.
  *
  * @return void
  */
 public function execute()
 {
     $_SERVER['argv'] = array($_SERVER['argv'][0], '0', '-o', $this->mode);
     /* @var $crawlerObj tx_crawler_lib */
     $crawlerObj = t3lib_div::makeInstance('tx_crawler_lib');
     return $crawlerObj->CLI_main_flush();
 }
 /**
  * Constructor
  *
  * @param	tx_solr_SolrService	$solrConnection The Solr connection to use for searching
  */
 public function __construct(tx_solr_SolrService $solrConnection = NULL)
 {
     $this->solr = $solrConnection;
     if (is_null($solrConnection)) {
         $this->solr = t3lib_div::makeInstance('tx_solr_ConnectionManager')->getConnectionByPageId($GLOBALS['TSFE']->id, $GLOBALS['TSFE']->sys_language_uid);
     }
 }
    /**
     * This method is called by the Scheduler task that triggers
     * the autopublication process
     * It searches for workspaces whose publication date is in the past
     * and publishes them
     *
     * @return	void
     */
    public function autoPublishWorkspaces()
    {
        global $TYPO3_CONF_VARS;
        // Temporarily set admin rights
        // FIXME: once workspaces are cleaned up a better solution should be implemented
        $currentAdminStatus = $GLOBALS['BE_USER']->user['admin'];
        $GLOBALS['BE_USER']->user['admin'] = 1;
        // Select all workspaces that needs to be published / unpublished:
        $workspaces = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,swap_modes,publish_time,unpublish_time', 'sys_workspace', 'pid=0
				AND
				((publish_time!=0 AND publish_time<=' . intval($GLOBALS['EXEC_TIME']) . ')
				OR (publish_time=0 AND unpublish_time!=0 AND unpublish_time<=' . intval($GLOBALS['EXEC_TIME']) . '))' . t3lib_BEfunc::deleteClause('sys_workspace'));
        $workspaceService = t3lib_div::makeInstance('tx_Workspaces_Service_Workspaces');
        foreach ($workspaces as $rec) {
            // First, clear start/end time so it doesn't get select once again:
            $fieldArray = $rec['publish_time'] != 0 ? array('publish_time' => 0) : array('unpublish_time' => 0);
            $GLOBALS['TYPO3_DB']->exec_UPDATEquery('sys_workspace', 'uid=' . intval($rec['uid']), $fieldArray);
            // Get CMD array:
            $cmd = $workspaceService->getCmdArrayForPublishWS($rec['uid'], $rec['swap_modes'] == 1);
            // $rec['swap_modes']==1 means that auto-publishing will swap versions, not just publish and empty the workspace.
            // Execute CMD array:
            $tce = t3lib_div::makeInstance('t3lib_TCEmain');
            $tce->stripslashes_values = 0;
            $tce->start(array(), $cmd);
            $tce->process_cmdmap();
        }
        // Restore admin status
        $GLOBALS['BE_USER']->user['admin'] = $currentAdminStatus;
    }
Beispiel #5
0
 /**
  * Generates and prints out a organizers list.
  *
  * @return string the HTML source code to display
  */
 public function show()
 {
     $content = '';
     $pageData = $this->page->getPageData();
     $this->template->setMarker('new_record_button', $this->getNewIcon($pageData['uid']));
     $this->template->setMarker('label_full_name', $GLOBALS['LANG']->getLL('organizerlist.title'));
     /** @var tx_seminars_BagBuilder_Organizer $builder */
     $builder = t3lib_div::makeInstance('tx_seminars_BagBuilder_Organizer');
     $builder->setSourcePages($pageData['uid'], self::RECURSION_DEPTH);
     $organizerBag = $builder->build();
     $tableRows = '';
     /** @var tx_seminars_OldModel_Organizer $organizerBag */
     foreach ($organizerBag as $this->organizer) {
         $this->template->setMarker('icon', $this->organizer->getRecordIcon());
         $this->template->setMarker('full_name', htmlspecialchars($this->organizer->getTitle()));
         $this->template->setMarker('edit_button', $this->getEditIcon($this->organizer->getUid(), $this->organizer->getPageUid()));
         $this->template->setMarker('delete_button', $this->getDeleteIcon($this->organizer->getUid(), $this->organizer->getPageUid()));
         $tableRows .= $this->template->getSubpart('ORGANIZER_ROW');
     }
     $this->template->setSubpart('ORGANIZER_ROW', $tableRows);
     $this->template->setMarker('label_print_button', $GLOBALS['LANG']->getLL('print'));
     $content .= $this->template->getSubpart('SEMINARS_ORGANIZER_LIST');
     $content .= $organizerBag->checkConfiguration();
     return $content;
 }
Beispiel #6
0
 /**
  * Initializes the Module
  *
  * @return	void
  */
 public function initialize()
 {
     parent::init();
     $this->doc = t3lib_div::makeInstance('template');
     $this->doc->setModuleTemplate(t3lib_extMgm::extPath('recycler') . 'mod1/mod_template.html');
     $this->doc->backPath = $GLOBALS['BACK_PATH'];
     $this->doc->setExtDirectStateProvider();
     $this->pageRenderer = $this->doc->getPageRenderer();
     $this->relativePath = t3lib_extMgm::extRelPath('recycler');
     $this->pageRecord = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);
     $this->isAccessibleForCurrentUser = $this->id && is_array($this->pageRecord) || !$this->id && $this->isCurrentUserAdmin();
     //don't access in workspace
     if ($GLOBALS['BE_USER']->workspace !== 0) {
         $this->isAccessibleForCurrentUser = false;
     }
     //read configuration
     $modTS = $GLOBALS['BE_USER']->getTSConfig('mod.recycler');
     if ($this->isCurrentUserAdmin()) {
         $this->allowDelete = true;
     } else {
         $this->allowDelete = $modTS['properties']['allowDelete'] == '1';
     }
     if (isset($modTS['properties']['recordsPageLimit']) && intval($modTS['properties']['recordsPageLimit']) > 0) {
         $this->recordsPageLimit = intval($modTS['properties']['recordsPageLimit']);
     }
 }
 /**
  * class constructor checks if cache has to be rebuild and initiates the rebuild
  * instantiates the handler class
  *
  * @param boolean $regenerate	with set to false, cache won't be regenerated if needed (useful for feediting)
  * @return void
  */
 function __construct($regenerate = TRUE)
 {
     // we check for existance of our targetDirectory
     if (!is_dir(PATH_site . self::$tempPath)) {
         t3lib_div::mkdir(PATH_site . self::$tempPath);
     }
     // create a fileName, the hash includes all icons and css-styles registered and the extlist
     $this->tempFileName = PATH_site . self::$tempPath . md5(serialize($GLOBALS['TBE_STYLES']['spritemanager']) . md5(serialize($GLOBALS['TBE_STYLES']['spriteIconApi']['coreSpriteImageNames'])) . $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList']) . '.inc';
     // if no cache-file for the current config ist present, regenerate it
     if (!@file_exists($this->tempFileName)) {
         // regenerate if allowed
         if ($regenerate) {
             $handlerClass = $GLOBALS['TYPO3_CONF_VARS']['BE']['spriteIconGenerator_handler'] ? $GLOBALS['TYPO3_CONF_VARS']['BE']['spriteIconGenerator_handler'] : 't3lib_spritemanager_SimpleHandler';
             $this->handler = t3lib_div::makeInstance($handlerClass);
             // check if the handler could be loaded and implements the needed interface
             if (!$this->handler || !$this->handler instanceof t3lib_spritemanager_SpriteIconGenerator) {
                 throw new Exception("class in TYPO3_CONF_VARS[BE][spriteIconGenerator_handler] does not exist,\n\t\t\t\t\t\tor does not implement t3lib_spritemanager_SpriteIconGenerator");
             }
             // all went good? to go for rebuild
             $this->rebuildCache();
         } else {
             // use old file if present
             list($this->tempFileName) = t3lib_div::getFilesInDir(PATH_site . self::$tempPath, 'inc', 1);
         }
     }
 }
 /**
  * Splits the search word input into an array where each word is represented by an array with key "sword" holding the search word and key "oper" holds the SQL operator (eg. AND, OR)
  *
  * Only words with 2 or more characters are accepted
  * Max 200 chars total
  * Space is used to split words, "" can be used search for a whole string (not indexed search then)
  * AND, OR and NOT are prefix words, overruling the default operator
  * +/|/- equals AND, OR and NOT as operators.
  * All search words are converted to lowercase.
  *
  * $defOp is the default operator. 1=OR, 0=AND
  *
  * @param	boolean		If true, the default operator will be OR, not AND
  * @return	array		Returns array with search words if any found
  */
 function getSearchWords($defOp)
 {
     //start OVERWRITE
     $returnArray = array();
     //end OVERWRITE
     // Shorten search-word string to max 200 bytes (does NOT take multibyte charsets into account - but never mind, shortening the string here is only a run-away feature!)
     $inSW = substr($this->piVars['sword'], 0, 200);
     // Convert to UTF-8 + conv. entities (was also converted during indexing!)
     $inSW = $GLOBALS['TSFE']->csConvObj->utf8_encode($inSW, $GLOBALS['TSFE']->metaCharset);
     $inSW = $GLOBALS['TSFE']->csConvObj->entities_to_utf8($inSW, TRUE);
     if ($hookObj =& $this->hookRequest('getSearchWords')) {
         $returnArray = $hookObj->getSearchWords_splitSWords($inSW, $defOp);
     } else {
         if ($this->piVars['type'] == 20) {
             $returnArray = array(array('sword' => trim($inSW), 'oper' => 'AND'));
         } else {
             $search = t3lib_div::makeInstance('tslib_search');
             $search->default_operator = $defOp == 1 ? 'OR' : 'AND';
             $search->operator_translate_table = $this->operator_translate_table;
             $search->register_and_explode_search_string($inSW);
             if (is_array($search->sword_array)) {
                 $returnArray = $this->procSearchWordsByLexer($search->sword_array);
             }
         }
     }
     $this->mapSWtoColor($returnArray);
     return $returnArray;
 }
 /**
  * Convert the values of a SQL update statement to a different encoding than UTF-8.
  *
  * @param string $query Update statement like: UPDATE static_countries SET cn_short_de='XXX' WHERE cn_iso_2='DE';
  * @param string $destEncoding Destination encoding
  * @return string Converted update statement
  */
 function getUpdateEncoded($query, $destEncoding)
 {
     static $csconv;
     if (!($destEncoding == 'utf-8')) {
         if (!is_object($csconv)) {
             $csconv = t3lib_div::makeInstance('t3lib_cs');
         }
         $queryElements = explode('WHERE', $query);
         $where = preg_replace('#;$#', '', trim($queryElements[1]));
         $queryElements = explode('SET', $queryElements[0]);
         $queryFields = $queryElements[1];
         $queryElements = t3lib_div::trimExplode('UPDATE', $queryElements[0], 1);
         $table = $queryElements[0];
         $fields_values = array();
         $queryFields = t3lib_div::trimExplode(',', $queryFields, 1);
         foreach ($queryFields as $fieldsSet) {
             $col = t3lib_div::trimExplode('=', $fieldsSet, 1);
             $value = stripslashes(substr($col[1], 1, strlen($col[1]) - 2));
             $value = $csconv->conv($value, 'utf-8', $destEncoding);
             $fields_values[$col[0]] = $value;
         }
         $query = $GLOBALS['TYPO3_DB']->UPDATEquery($table, $where, $fields_values);
     }
     return $query;
 }
 /**
  * Lädt ein COnfigurations Objekt nach mit der TS aus der Extension
  * Dabei wird alles geholt was in "plugin.tx_$extKey", "lib.$extKey." und
  * "lib.links." liegt
  *
  * @param string $extKey Extension, deren TS Config geladen werden soll
  * @param string $extKeyTS Extension, deren Konfig innerhalb der
  *     TS Config geladen werden soll.
  *     Es kann also zb. das TS von mklib geladen werden aber darin die konfig für
  *     das plugin von mkxyz
  * @param string $sStaticPath pfad zum TS
  * @param array $aConfig zusätzliche Konfig, die die default  überschreibt
  * @param boolean $resolveReferences sollen referenzen die in lib.
  *     und plugin.tx_$extKeyTS stehen aufgelöst werden?
  * @param boolean $forceTsfePreparation
  * @return tx_rnbase_configurations
  */
 public static function loadConfig4BE($extKey, $extKeyTs = null, $sStaticPath = '', $aConfig = array(), $resolveReferences = false, $forceTsfePreparation = false)
 {
     $extKeyTs = is_null($extKeyTs) ? $extKey : $extKeyTs;
     if (!$sStaticPath) {
         $sStaticPath = '/static/ts/setup.txt';
     }
     if (file_exists(t3lib_div::getFileAbsFileName('EXT:' . $extKey . $sStaticPath))) {
         t3lib_extMgm::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $extKey . $sStaticPath . '">');
     }
     tx_rnbase::load('tx_rnbase_configurations');
     tx_rnbase::load('tx_rnbase_util_Misc');
     $tsfePreparationOptions = array();
     if ($forceTsfePreparation) {
         $tsfePreparationOptions['force'] = true;
     }
     // Ist bei Aufruf aus BE notwendig! (@TODO: sicher???)
     tx_rnbase_util_Misc::prepareTSFE($tsfePreparationOptions);
     $GLOBALS['TSFE']->config = array();
     $cObj = t3lib_div::makeInstance('tslib_cObj');
     $pageTsConfig = self::getPagesTSconfig(0);
     $tempConfig = $pageTsConfig['plugin.']['tx_' . $extKeyTs . '.'];
     $tempConfig['lib.'][$extKeyTs . '.'] = $pageTsConfig['lib.'][$extKeyTs . '.'];
     $tempConfig['lib.']['links.'] = $pageTsConfig['lib.']['links.'];
     if ($resolveReferences) {
         $GLOBALS['TSFE']->tmpl->setup['lib.'][$extKeyTs . '.'] = $tempConfig['lib.'][$extKeyTs . '.'];
         $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_' . $extKeyTs . '.'] = $pageTsConfig['plugin.']['tx_' . $extKeyTs . '.'];
     }
     $pageTsConfig = $tempConfig;
     $qualifier = $pageTsConfig['qualifier'] ? $pageTsConfig['qualifier'] : $extKeyTs;
     // möglichkeit die default konfig zu überschreiben
     $pageTsConfig = t3lib_div::array_merge_recursive_overrule($pageTsConfig, $aConfig);
     $configurations = new tx_rnbase_configurations();
     $configurations->init($pageTsConfig, $cObj, $extKeyTs, $qualifier);
     return $configurations;
 }
 /**
  * Returns an URL that switches the sorting indicator according to the
  * given sorting direction
  *
  * @param array $arguments Expects 'asc' or 'desc' as sorting direction in key 0
  * @return string
  * @throws InvalidArgumentException when providing an invalid sorting direction
  */
 public function execute(array $arguments = array())
 {
     $content = '';
     $sortDirection = trim($arguments[0]);
     $configuration = Tx_Solr_Util::getSolrConfiguration();
     $contentObject = t3lib_div::makeInstance('tslib_cObj');
     $defaultImagePrefix = 'EXT:solr/Resources/Images/Indicator';
     switch ($sortDirection) {
         case 'asc':
             $imageConfiguration = $configuration['viewHelpers.']['sortIndicator.']['up.'];
             if (!isset($imageConfiguration['file'])) {
                 $imageConfiguration['file'] = $defaultImagePrefix . 'Up.png';
             }
             $content = $contentObject->IMAGE($imageConfiguration);
             break;
         case 'desc':
             $imageConfiguration = $configuration['viewHelpers.']['sortIndicator.']['down.'];
             if (!isset($imageConfiguration['file'])) {
                 $imageConfiguration['file'] = $defaultImagePrefix . 'Down.png';
             }
             $content = $contentObject->IMAGE($imageConfiguration);
             break;
         case '###SORT.CURRENT_DIRECTION###':
         case '':
             // ignore
             break;
         default:
             throw new InvalidArgumentException('Invalid sorting direction "' . $arguments[0] . '", must be "asc" or "desc".', 1390868460);
     }
     return $content;
 }
 /**
  * constructor for class tx_solr_viewhelper_Relevance
  */
 public function __construct(array $arguments = array())
 {
     if (is_null($this->search)) {
         $this->search = t3lib_div::makeInstance('tx_solr_Search');
         $this->maxScore = $this->search->getMaximumResultScore();
     }
 }
 public function user_rgsg($content, $conf)
 {
     $sysPageObj = t3lib_div::makeInstance('t3lib_pageSelect');
     $rootLine = $sysPageObj->getRootLine($GLOBALS['TSFE']->id);
     $TSObj = t3lib_div::makeInstance('t3lib_tsparser_ext');
     $TSObj->tt_track = 0;
     $TSObj->init();
     $TSObj->runThroughTemplates($rootLine);
     $TSObj->generateConfig();
     $this->conf = $TSObj->setup['plugin.']['tx_rgsmoothgallery_pi1.'];
     $split = strpos($GLOBALS['TSFE']->currentRecord, ':');
     $id = substr($GLOBALS['TSFE']->currentRecord, $split + 1);
     $where = 'uid =' . $id;
     $table = 'tt_content';
     $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('imagewidth,imageheight', $table, $where, $groupBy = '', $orderBy, $limit = '');
     $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
     $css .= $row['imagewidth'] ? 'width:' . $row['imagewidth'] . 'px;' : '';
     $css .= $row['imageheight'] ? 'height:' . $row['imageheight'] . 'px;' : '';
     $GLOBALS['TSFE']->additionalCSS['rgsmoothgallery' . $id] = '#myGallery' . $id . ' {' . $css . '}';
     if (t3lib_extMgm::isLoaded('t3mootools')) {
         require_once t3lib_extMgm::extPath('t3mootools') . 'class.tx_t3mootools.php';
     }
     if (defined('T3MOOTOOLS')) {
         tx_t3mootools::addMooJS();
     } else {
         $header .= $this->getPath($this->conf['pathToMootools']) ? '<script src="' . $this->getPath($this->conf['pathToMootools']) . '" type="text/javascript"></script>' : '';
         $header .= $this->getPath($this->conf['pathToMootoolsMore']) ? '<script src="' . $this->getPath($this->conf['pathToMootoolsMore']) . '" type="text/javascript"></script>' : '';
     }
     // path to js + css
     $GLOBALS['TSFE']->additionalHeaderData['rgsmoothgallery'] = $header . '
     <script src="' . $this->getPath($this->conf['pathToJdgalleryJS']) . '" type="text/javascript"></script>
     <link rel="stylesheet" href="' . $this->getPath($this->conf['pathToJdgalleryCSS']) . '" type="text/css" media="screen" />
   ';
     return $content;
 }
 function checkDataSubmission($feObj)
 {
     // config
     global $TSFE;
     $this->cObj = $TSFE->cObj;
     // cObject
     $this->confArr = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['wt_doorman']);
     // Get backandconfig
     $this->removeXSS = t3lib_div::makeInstance('tx_wtdoorman_RemoveXSS');
     // Create new instance for removeXSS class
     $varsDefinition = $this->string2array($this->confArr['varsDefinition']);
     // get config for doorman
     if ($this->confArr['pidInRootline'] > -1) {
         $pid = t3lib_div::trimExplode(',', $this->confArr['pidInRootline'] . ',' . tslib_cObj::getTreeList($this->confArr['pidInRootline'], 100), 1);
     }
     // array with all allowed pids
     // Let's go
     if ($this->confArr['pidInRootline'] > -1 && (in_array($GLOBALS['TSFE']->id, $pid) || $this->confArr['pidInRootline'] == 0)) {
         // if current page is allowed
         $this->sec = t3lib_div::makeInstance('tx_wtdoorman_security');
         // Create new instance for security class
         $this->sec->secParams = $this->string2array($this->confArr['varsDefinition']);
         // get config for backend definition
         $this->sec->delNotSetVars = $this->confArr['clearNotDefinedVars'];
         // now allowed params should be deleted or not?
         $_GET = $this->sec->sec($_GET);
         // overwrite GET params with vars from doorman class
         $_POST = $this->sec->sec($_POST);
         // overwrite POST params with vars from doorman class
     }
 }
 /**
  * clear cart
  *
  * @return	void
  */
 public function user_wtcart_clearCart($content = '', $conf = array())
 {
     $div = t3lib_div::makeInstance('tx_wtcart_div');
     // Create new instance for div functions
     $div->removeAllProductsFromSession();
     // clear cart now
 }
 /**
  * Main function, returning the HTML content of the module
  *
  * @return	string		HTML
  */
 function main()
 {
     $this->flexObj = t3lib_div::makeInstance('t3lib_flexformtools');
     $this->getContentElements();
     $this->flexform2array();
     // Change tlds configuration from field "tld" to "uid"
     foreach ($this->contentElements as $id => $row) {
         $tlds = explode(',', $row['pi_flexform']['data']['sDEF']['lDEF']['tlds']['vDEF']);
         if (is_array($tlds)) {
             $tlds_new = array();
             foreach ($tlds as $tld) {
                 if (!is_numeric($tld)) {
                     $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'tx_odsdomaincheck_tlds', 'tld=' . $GLOBALS['TYPO3_DB']->fullQuoteStr(trim($tld), 'tx_odsdomaincheck_tlds'));
                     $new = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
                     $tld = $new ? $new['uid'] : 0;
                 }
                 $tlds_new[] = $tld;
             }
             $this->contentElements[$id]['pi_flexform']['data']['sDEF']['lDEF']['tlds']['vDEF'] = implode(',', $tlds_new);
         }
     }
     $this->array2flexform();
     $this->setContentElements();
     return 'Update finished.';
 }
 /**
  * @test
  */
 public function getResultReturnsAllResults()
 {
     $request = t3lib_div::makeInstance('Tx_Solr_IndexQueue_PageIndexerResponse');
     $request->addActionResult('action1', 'result1');
     $request->addActionResult('action2', 'result2');
     $this->assertEquals(array('action1' => 'result1', 'action2' => 'result2'), $request->getActionResult());
 }
 /**
  * Initializes the languages.
  *
  * @static
  * @return void
  */
 public static function initialize()
 {
     /** @var $instance t3lib_l10n_Locales */
     $instance = t3lib_div::makeInstance('t3lib_l10n_Locales');
     $instance->isoMapping = array_flip($instance->isoReverseMapping);
     // Allow user-defined locales
     if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user'] as $locale => $name) {
             if (!isset($instance->languages[$locale])) {
                 $instance->languages[$locale] = $name;
             }
         }
     }
     // Initializes the locale dependencies with TYPO3 supported locales
     $instance->localeDependencies = array();
     foreach ($instance->languages as $locale => $name) {
         if (strlen($locale) == 5) {
             $instance->localeDependencies[$locale] = array(substr($locale, 0, 2));
         }
     }
     // Merge user-provided locale dependencies
     if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['dependencies']) && is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['dependencies'])) {
         $instance->localeDependencies = t3lib_div::array_merge_recursive_overrule($instance->localeDependencies, $GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['dependencies']);
     }
     /**
      * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8
      */
     $instance->locales = array_keys($instance->languages);
     /**
      * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8
      */
     define('TYPO3_languages', implode('|', $instance->getLocales()));
 }
 function _render($conf)
 {
     require_once PATH_formidable . "api/class.tx_ameosformidable.php";
     $this->oForm = t3lib_div::makeInstance("tx_ameosformidable");
     $this->oForm->initFromTs($this, $conf);
     return $this->oForm->render();
 }
 /**
  * MAIN function for page information display (including hit statistics)
  *
  * @return	string		Output HTML for the module.
  */
 function main()
 {
     global $BACK_PATH, $LANG, $SOBE;
     $dblist = t3lib_div::makeInstance('tx_cms_layout');
     $dblist->descrTable = '_MOD_' . $GLOBALS['MCONF']['name'];
     $dblist->backPath = $BACK_PATH;
     $dblist->thumbs = 0;
     $dblist->script = 'index.php';
     $dblist->showIcon = 0;
     $dblist->setLMargin = 0;
     $dblist->agePrefixes = $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears');
     $dblist->pI_showUser = 1;
     $dblist->pI_showStat = 0;
     // PAGES:
     $this->pObj->MOD_SETTINGS['pages_levels'] = $this->pObj->MOD_SETTINGS['depth'];
     // ONLY for the sake of dblist module which uses this value.
     $h_func = t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth'], 'index.php');
     if ($this->pObj->MOD_SETTINGS['function'] == 'tx_cms_webinfo_hits') {
         $h_func .= t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[stat_type]', $this->pObj->MOD_SETTINGS['stat_type'], $this->pObj->MOD_MENU['stat_type'], 'index.php');
         if ($this->pObj->MOD_SETTINGS['stat_type'] == 1) {
             $dblist->stat_select_field = 'rl0';
         }
         if ($this->pObj->MOD_SETTINGS['stat_type'] == 2) {
             $dblist->stat_select_field = 'rl1';
         }
         // Timespan
         for ($a = 0; $a < 30; $a++) {
             $dblist->stat_codes[] = 'HITS_days:' . -$a;
         }
         $timespan_b = mktime(0, 0, 0);
         $timespan_e = mktime(0, 0, 0) - (30 - 1) * 3600 * 24 + 1;
         $header = '<br />' . sprintf($LANG->getLL('stat_period'), t3lib_BEfunc::date($timespan_b), t3lib_BEfunc::date($timespan_e)) . '<br />';
         //
         $dblist->start($this->pObj->id, 'pages', 0);
         $dblist->pages_noEditColumns = 1;
         $dblist->generateList();
         $theOutput .= $this->pObj->doc->section($LANG->getLL('hits_title'), t3lib_BEfunc::cshItem($dblist->descrTable, 'stat', $GLOBALS['BACK_PATH'], '|<br />') . $h_func . $header . $dblist->HTMLcode, 0, 1);
     } else {
         $h_func .= t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[pages]', $this->pObj->MOD_SETTINGS['pages'], $this->pObj->MOD_MENU['pages'], 'index.php');
         $dblist->start($this->pObj->id, 'pages', 0);
         $dblist->generateList();
         // CSH
         $theOutput .= $this->pObj->doc->section($LANG->getLL('page_title'), t3lib_BEfunc::cshItem($dblist->descrTable, 'pagetree_overview', $GLOBALS['BACK_PATH'], '|<br />') . $h_func . $dblist->HTMLcode, 0, 1);
         // SYS_NOTES:
         if (t3lib_extMgm::isLoaded('sys_note')) {
             $dblist->start($this->pObj->id, 'sys_note', 0);
             $dblist->generateList();
             if ($dblist->HTMLcode) {
                 $theOutput .= $this->pObj->doc->spacer(10);
                 $theOutput .= $this->pObj->doc->section($LANG->getLL('page_sysnote'), $dblist->HTMLcode, 0, 1);
             }
         }
         // PAGE INFORMATION
         if ($this->pObj->pageinfo['uid']) {
             $theOutput .= $this->pObj->doc->spacer(10);
             $theOutput .= $this->pObj->doc->section($LANG->getLL('pageInformation'), $dblist->getPageInfoBox($this->pObj->pageinfo, $this->pObj->CALC_PERMS & 2), 0, 1);
         }
     }
     return $theOutput;
 }
 /**
  * Error handling if no news entry is found
  *
  * @param string $configuration configuration what will be done
  * @throws InvalidArgumentException
  * @return void
  */
 protected function handleNoNewsFoundError($configuration)
 {
     if (empty($configuration)) {
         return;
     }
     $configuration = t3lib_div::trimExplode(',', $configuration, TRUE);
     switch ($configuration[0]) {
         case 'redirectToListView':
             $this->redirect('list');
             break;
         case 'redirectToPage':
             if (count($configuration) === 1 || count($configuration) > 3) {
                 $msg = sprintf('If error handling "%s" is used, either 2 or 3 arguments, splitted by "," must be used', $configuration[0]);
                 throw new InvalidArgumentException($msg);
             }
             /** @var $cObj tslib_cObj */
             $cObj = t3lib_div::makeInstance('tslib_cObj');
             $url = $cObj->typoLink_URL(array('parameter' => $configuration[1]));
             if (isset($configuration[2])) {
                 $header = 'HTTP_STATUS_' . $configuration[2];
                 t3lib_utility_Http::redirect($url, $header);
             } else {
                 t3lib_utility_Http::redirect($url);
             }
             break;
         case 'pageNotFoundHandler':
             $GLOBALS['TSFE']->pageNotFoundAndExit('No news entry found.');
             break;
         default:
             // Do nothing, it might be handled in the view.
     }
 }
    /**
     * Compiles a collection of schema version checks against each configured
     * Solr server. Only adds an entry if a schema other than the
     * recommended one was found.
     *
     * @see typo3/sysext/reports/interfaces/tx_reports_StatusProvider::getStatus()
     */
    public function getStatus()
    {
        $reports = array();
        $solrConnections = t3lib_div::makeInstance('tx_solr_ConnectionManager')->getAllConnections();
        foreach ($solrConnections as $solrConnection) {
            if ($solrConnection->ping() && $solrConnection->getSchemaName() != self::RECOMMENDED_SCHEMA_VERSION) {
                $message = '<p style="margin-bottom: 10px;">A schema different
					from the one provided with the extension was detected.</p>
					<p style="margin-bottom: 10px;">It is recommended to use the
					schema.xml file shipping with the Apache Solr for TYPO3
					extension as it provides an optimized field setup for the
					use of Solr with TYPO3. A difference can occur when you
					update the TYPO3 extension, but forget to update the
					schema.xml file on the Solr server. The schema sometimes
					changes to accommodate changes or new features in Apache
					Solr. Also make sure to restart the Tomcat server after
					updating the schema.xml file.</p>
					<p style="margin-bottom: 10px;">Your Solr server is
					currently using a schema named <strong>' . $solrConnection->getSchemaName() . '</strong>, the
					recommended schema is called <strong>' . self::RECOMMENDED_SCHEMA_VERSION . '</strong>. You can
					find the recommended schema.xml file in the extension\'s
					resources folder: EXT:solr/resources/solr/schema.xml. While
					you\'re at it, please check whether you\'re using the
					current solrconfig.xml file, too.</p>';
                $message .= '<p>Affected Solr server:</p>
					<ul>' . '<li>Host: ' . $solrConnection->getHost() . '</li>' . '<li>Port: ' . $solrConnection->getPort() . '</li>' . '<li>Path: ' . $solrConnection->getPath() . '</li>
					</ul>';
                $status = t3lib_div::makeInstance('tx_reports_reports_status_Status', 'Schema Version', 'Unsupported Schema', $message, tx_reports_reports_status_Status::WARNING);
                $reports[] = $status;
            }
        }
        return $reports;
    }
 /**
  * Constructor for Tx_Solr_IndexQueue_PageIndexerRequestHandler.
  *
  * Initializes request, response, and dispatcher.
  *
  */
 public function __construct()
 {
     $this->dispatcher = t3lib_div::makeInstance('Tx_Solr_IndexQueue_FrontendHelper_Dispatcher');
     $this->request = t3lib_div::makeInstance('Tx_Solr_IndexQueue_PageIndexerRequest', $_SERVER['HTTP_X_TX_SOLR_IQ']);
     $this->response = t3lib_div::makeInstance('Tx_Solr_IndexQueue_PageIndexerResponse');
     $this->response->setRequestId($this->request->getRequestId());
 }
 /**
  * The main method of the PlugIn
  *
  * @access	public
  *
  * @param	string		$content: The PlugIn content
  * @param	array		$conf: The PlugIn configuration
  *
  * @return	string		The content that is displayed on the website
  */
 public function main($content, $conf)
 {
     $this->init($conf);
     // Quit without doing anything if required variable is not set.
     if (empty($this->piVars['id'])) {
         return $content;
     }
     // Load template file.
     if (!empty($this->conf['templateFile'])) {
         $this->template = $this->cObj->getSubpart($this->cObj->fileResource($this->conf['templateFile']), '###TEMPLATE###');
     } else {
         $this->template = $this->cObj->getSubpart($this->cObj->fileResource('EXT:dlf/plugins/toolbox/template.tmpl'), '###TEMPLATE###');
     }
     // Build data array.
     $data = array('conf' => $this->conf, 'piVars' => $this->piVars);
     // Get template subpart for tools.
     $subpart = $this->cObj->getSubpart($this->template, '###TOOLS###');
     $tools = explode(',', $this->conf['tools']);
     // Add the tools to the toolbox.
     foreach ($tools as $tool) {
         $tool = trim($tool);
         $cObj = t3lib_div::makeInstance('tslib_cObj');
         $cObj->data = $data;
         $content .= $this->cObj->substituteMarkerArray($subpart, array('###TOOL###' => $cObj->cObjGetSingle($GLOBALS['TSFE']->tmpl->setup['plugin.'][$tool], $GLOBALS['TSFE']->tmpl->setup['plugin.'][$tool . '.'])));
     }
     return $this->pi_wrapInBaseClass($this->cObj->substituteSubpart($this->template, '###TOOLS###', $content, TRUE));
 }
Beispiel #25
0
 /**
  * constructor for class Tx_Solr_ViewHelper_Date
  */
 public function __construct(array $arguments = array())
 {
     if (is_null($this->dateFormat) || is_null($this->contentObject)) {
         $this->dateFormat = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['general.']['dateFormat.'];
         $this->contentObject = t3lib_div::makeInstance('tslib_cObj');
     }
 }
 /**
  * Creates a new public/private key pair using PHP OpenSSL extension.
  *
  * @return tx_rsaauth_keypair	A new key pair or null in case of error
  * @see tx_rsaauth_abstract_backend::createNewKeyPair()
  */
 public function createNewKeyPair()
 {
     $result = null;
     $privateKey = @openssl_pkey_new();
     if ($privateKey) {
         // Create private key as string
         $privateKeyStr = '';
         openssl_pkey_export($privateKey, $privateKeyStr);
         // Prepare public key information
         $exportedData = '';
         $csr = openssl_csr_new(array(), $privateKey);
         openssl_csr_export($csr, $exportedData, false);
         // Get public key (in fact modulus) and exponent
         $publicKey = $this->extractPublicKeyModulus($exportedData);
         $exponent = $this->extractExponent($exportedData);
         // Create result object
         $result = t3lib_div::makeInstance('tx_rsaauth_keypair');
         /* @var $result tx_rsaauth_keypair */
         $result->setExponent($exponent);
         $result->setPrivateKey($privateKeyStr);
         $result->setPublicKey($publicKey);
         // Clean up all resources
         openssl_free_key($privateKey);
     }
     return $result;
 }
Beispiel #27
0
 /**
  * constructor
  * 
  * @param Tx_CzSimpleCal_Domain_Repository_EventRepository $eventRepository
  * @param Tx_CzSimpleCal_Domain_Repository_EventIndexRepository $eventIndexRepository
  * @param Tx_Extbase_Persistence_ManagerInterface $persistenceManager
  */
 public function __construct(Tx_CzSimpleCal_Domain_Repository_EventRepository $eventRepository, Tx_CzSimpleCal_Domain_Repository_EventIndexRepository $eventIndexRepository, Tx_Extbase_Persistence_ManagerInterface $persistenceManager)
 {
     t3lib_div::makeInstance('Tx_Extbase_Dispatcher');
     $this->eventRepository = $eventRepository;
     $this->eventIndexRepository = $eventIndexRepository;
     $this->persistenceManager = $persistenceManager;
 }
    /**
     * Sets up this testcase
     *
     * @return void
     * @author Ingo Renner <*****@*****.**>
     */
    public function setUp()
    {
        $this->testingCacheTable = 'test_cache_dbbackend';
        $this->testingTagsTable = 'test_cache_dbbackend_tags';
        $GLOBALS['TYPO3_DB']->sql_query('CREATE TABLE ' . $this->testingCacheTable . ' (
			id int(11) unsigned NOT NULL auto_increment,
			identifier varchar(128) DEFAULT \'\' NOT NULL,
			crdate int(11) unsigned DEFAULT \'0\' NOT NULL,
			content mediumtext,
			lifetime int(11) unsigned DEFAULT \'0\' NOT NULL,
			PRIMARY KEY (id),
			KEY cache_id (identifier)
		) ENGINE=InnoDB;
		');
        $GLOBALS['TYPO3_DB']->sql_query('CREATE TABLE ' . $this->testingTagsTable . ' (
			id int(11) unsigned NOT NULL auto_increment,
			identifier varchar(128) DEFAULT \'\' NOT NULL,
			tag varchar(128) DEFAULT \'\' NOT NULL,
			PRIMARY KEY (id),
			KEY cache_id (identifier),
			KEY cache_tag (tag)
		) ENGINE=InnoDB;
		');
        $this->backend = t3lib_div::makeInstance('t3lib_cache_backend_DbBackend', array('cacheTable' => $this->testingCacheTable, 'tagsTable' => $this->testingTagsTable));
    }
 public function __construct(Tx_Formhandler_Component_Manager $componentManager, Tx_Formhandler_Configuration $configuration)
 {
     parent::__construct($componentManager, $configuration);
     require_once t3lib_extMgm::extPath('formhandler') . 'Resources/PHP/class.formhandler_htmlmail.php';
     $this->emailObj = t3lib_div::makeInstance('formhandler_htmlmail');
     $this->emailObj->start();
 }
Beispiel #30
0
 protected function tearDown()
 {
     // Get any surplus instances added via t3lib_div::addInstance.
     t3lib_div::makeInstance('t3lib_mail_Message');
     $this->subject->cleanUp();
     $GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog'] = $this->deprecationLogEnabledBackup;
 }