Minor changes and code cleanup (see rtehtmlarea ChangeLog and indexed_search ChangeLog)
authorMichael Stucki <michael.stucki@typo3.org>
Tue, 23 Jan 2007 22:43:06 +0000 (22:43 +0000)
committerMichael Stucki <michael.stucki@typo3.org>
Tue, 23 Jan 2007 22:43:06 +0000 (22:43 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1930 709f56b5-9817-0410-a4d7-c38de5d9e867

12 files changed:
t3lib/class.t3lib_db.php
t3lib/class.t3lib_install.php
t3lib/class.t3lib_refindex.php
t3lib/thumbs.php
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/cms/tslib/class.tslib_pibase.php
typo3/sysext/indexed_search/ChangeLog
typo3/sysext/indexed_search/modfunc1/class.tx_indexedsearch_modfunc1.php
typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php
typo3/sysext/install/mod/class.tx_install.php
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/ext_conf_template.txt

index 4422bf9..c137693 100755 (executable)
@@ -901,7 +901,7 @@ class t3lib_DB {
                if (!$this->link) {
                        t3lib_div::sysLog('Could not connect to Mysql server '.$TYPO3_db_host.' with user '.$TYPO3_db_username.'.','Core',4);
                } else {
-                       $setDBinit = t3lib_div::trimExplode(chr(10), $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit'],true);
+                       $setDBinit = t3lib_div::trimExplode(chr(10), $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit'],TRUE);
                        foreach ($setDBinit as $v)      {
                                if (mysql_query($v, $this->link) === FALSE)     {
                                        t3lib_div::sysLog('Could not initialize DB connection with query "'.$v.'": '.mysql_error($this->link),'Core',3);
index 0f16d91..2458808 100755 (executable)
@@ -187,7 +187,7 @@ class t3lib_install {
 
                        // Checking write state of localconf.php:
                if (!$this->allowUpdateLocalConf)       {
-                       die("->allowUpdateLocalConf flag in the install object is not set and therefore 'localconf.php' cannot be altered.");
+                       die('->allowUpdateLocalConf flag in the install object is not set and therefore "localconf.php" cannot be altered.');
                }
                if (!@is_writable($writeToLocalconf_dat['file']))       {
                        die($writeToLocalconf_dat['file'].' is not writable!');
@@ -227,7 +227,7 @@ class t3lib_install {
                                        $success = TRUE;
                                        $msg = 'Configuration written to typo3conf/localconf.php';
                                }
-                               $this->messages[]= $msg;
+                               $this->messages[] = $msg;
 
                                if ($success)   {
                                        return 'continue';
index 8760c51..08be36a 100755 (executable)
@@ -89,7 +89,7 @@ class t3lib_refindex {
 
        var $words_strings = array();
        var $words = array();
-       
+
        var $hashVersion = 1;   // Number which we can increase if a change in the code means we will have to force a re-generation of the index.
 
 
@@ -150,7 +150,7 @@ class t3lib_refindex {
 
                                $result['relations'] = $relations;
                        } else return FALSE;    // Weird mistake I would say...
-                       
+
                                // Words:
                        if (!$testOnly) $this->wordIndexing($table,$uid);
                }
@@ -184,7 +184,7 @@ class t3lib_refindex {
                        list($record) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*',$table,'uid='.intval($uid));
 
                        if (is_array($record))  {
-                               
+
                                        // Initialize:
                                $this->words_strings = array();
                                $this->words = array();
@@ -423,7 +423,7 @@ class t3lib_refindex {
                                if ($conf['type']=='flex')      {
 
                                                // Get current value array:
-                                               // NOTICE: failure to resolve Data Structures can lead to integrity problems with the reference index. Please look up the note in the JavaDoc documentation for the function t3lib_BEfunc::getFlexFormDS() 
+                                               // NOTICE: failure to resolve Data Structures can lead to integrity problems with the reference index. Please look up the note in the JavaDoc documentation for the function t3lib_BEfunc::getFlexFormDS()
                                        $dataStructArray = t3lib_BEfunc::getFlexFormDS($conf, $row, $table,'',$this->WSOL);
                                        $currentValueArray = t3lib_div::xml2array($value);
 
@@ -634,7 +634,7 @@ class t3lib_refindex {
         * @return      string          If a return string, that carries an error message, otherwise false (=OK) (except if $returnDataArray is set!)
         */
        function setReferenceValue($hash,$newValue,$returnDataArray=FALSE)      {
-               
+
                if ($GLOBALS['BE_USER']->workspace===0 && $GLOBALS['BE_USER']->isAdmin())       {
 
                                // Get current index from Database:
@@ -707,10 +707,10 @@ class t3lib_refindex {
                                                                $tce->bypassWorkspaceRestrictions = TRUE;
                                                                $tce->bypassFileHandling = TRUE;
                                                                $tce->bypassAccessCheckForRecords = TRUE;       // Otherwise this cannot update things in deleted records...
-                                                       
+
                                                                $tce->start($dataArray,array());        // check has been done previously that there is a backend user which is Admin and also in live workspace
                                                                $tce->process_datamap();
-       
+
                                                                        // Return errors if any:
                                                                if (count($tce->errorLog))      {
                                                                        return chr(10).'TCEmain:'.implode(chr(10).'TCEmain:',$tce->errorLog);
@@ -849,7 +849,7 @@ class t3lib_refindex {
         * Indexing words
         *
         *******************************/
-       
+
        /**
         *
         */
@@ -875,9 +875,9 @@ class t3lib_refindex {
         */
        function updateWordIndex($words,$table,$uid) {
 
-                       // Submit words to 
+                       // Submit words to
                $this->submitWords($words);
-               
+
                        // Result id and remove relations:
                $rid = t3lib_div::md5int($table.':'.$uid);
                $GLOBALS['TYPO3_DB']->exec_DELETEquery('sys_refindex_rel', 'rid='.intval($rid));
@@ -912,7 +912,7 @@ class t3lib_refindex {
 
                $hashArr = array();
                foreach($wl as $w)      {
-                       $hashArr[] = t3lib_div::md5int($w);     
+                       $hashArr[] = t3lib_div::md5int($w);
                }
                $wl = array_flip($wl);
 
@@ -996,7 +996,7 @@ class t3lib_refindex {
                $recCount=0;
                $tableCount=0;
 
-               $headerContent = $testOnly ? 'Reference Index being TESTED (nothing written)' : 'Reference Index being Updated';
+               $headerContent = $testOnly ? 'Reference Index being TESTED (nothing written, use "-e" to update)' : 'Reference Index being Updated';
                if ($cli_echo) echo
                                                '*******************************************'.chr(10).
                                                $headerContent.chr(10).
index a1e8687..88df0f2 100755 (executable)
@@ -232,7 +232,6 @@ class SC_t3lib_thumbs {
                                        } else {
                                                $colors = ($sizeMax>56)?'-colors 64':'-colors 16';
                                        }
-                                       $path = $TYPO3_CONF_VARS['GFX']['im_path_lzw'] ? $TYPO3_CONF_VARS['GFX']['im_path_lzw'] : $TYPO3_CONF_VARS['GFX']['im_path'];
                                        $parameters = '-sample '.$this->size.' '.$colors.' '.$this->wrapFileName($this->input.'[0]').' '.$this->wrapFileName($this->output);
                                        $cmd = t3lib_div::imageMagickCommand('convert', $parameters);
                                        exec($cmd);
index f1c89e2..ae2d69d 100755 (executable)
@@ -3379,8 +3379,8 @@ if (version == "n3") {
         * @see makeSimulFileName(), publish.php
         */
        function getSimulFileName()     {
-               $url='';
-               $url.=$this->makeSimulFileName($this->page['title'], $this->page['alias']?$this->page['alias']:$this->id, $this->type).'.html';
+               $url = '';
+               $url.= $this->makeSimulFileName($this->page['title'], $this->page['alias']?$this->page['alias']:$this->id, $this->type).'.html';
                return $url;
        }
 
@@ -3412,14 +3412,14 @@ if (version == "n3") {
        function fileNameASCIIPrefix($inTitle,$titleChars,$mergeChar='.')       {
                $out = $this->csConvObj->specCharsToASCII($this->renderCharset, $inTitle);
                        // Get replacement character
-               $replacementChar = &$this->config['config']['simulateStaticDocuments_replacementChar'];
+               $replacementChar = $this->config['config']['simulateStaticDocuments_replacementChar'];
                $replacementChars = '_\-' . ($replacementChar != '_' && $replacementChar != '-' ? $replacementChar : '');
                $out = preg_replace('/[^A-Za-z0-9_-]/', $replacementChar, trim(substr($out, 0, $titleChars)));
                $out = preg_replace('/([' . $replacementChars . ']){2,}/', '\1', $out);
                $out = preg_replace('/[' . $replacementChars . ']?$/', '', $out);
                $out = preg_replace('/^[' . $replacementChars . ']?/', '', $out);
                if (strlen($out)) {
-                       $out .= $mergeChar;
+                       $out.= $mergeChar;
                }
 
                return $out;
index 931caef..c7c4cbd 100755 (executable)
@@ -431,9 +431,7 @@ class tslib_pibase {
         * disabledLinkWrap, inactiveLinkWrap, activeLinkWrap, browseLinksWrap, showResultsWrap, showResultsNumbersWrap, browseBoxWrap.
         *
         * If $wrapArr['showResultsNumbersWrap'] is set, the formatting string is expected to hold template markers (###FROM###, ###TO###, ###OUT_OF###, ###FROM_TO###, ###CURRENT_PAGE###, ###TOTAL_PAGES###)
-        * otherwise the formatting sting is expected to hold sprintf-markers (%s) for from, to, outof (in that sequence)
-        *
-        *                                                                              otherwise wrapping is totally controlled/modified by this array
+        * otherwise the formatting string is expected to hold sprintf-markers (%s) for from, to, outof (in that sequence)
         *
         * @param       integer         determines how the results of the pagerowser will be shown. See description below
         * @param       string          Attributes for the table tag which is wrapped around the table cells containing the browse links
@@ -442,7 +440,7 @@ class tslib_pibase {
         * @param       boolean         enable htmlspecialchars() for the pi_getLL function (set this to FALSE if you want f.e use images instead of text for links like 'previous' and 'next').
         * @return      string          Output HTML-Table, wrapped in <div>-tags with a class attribute (if $wrapArr is not passed,
         */
-       function pi_list_browseresults($showResultCount=1,$tableParams='',$wrapArr=array(), $pointerName = 'pointer', $hscText = TRUE)  {
+       function pi_list_browseresults($showResultCount=1, $tableParams='', $wrapArr=array(), $pointerName='pointer', $hscText=TRUE)    {
 
                // example $wrapArr-array how it could be traversed from an extension
                /* $wrapArr = array(
index c12638a..1597886 100755 (executable)
@@ -1,3 +1,7 @@
+2007-01-23  Michael Stucki  <michael@typo3.org>
+
+       * Rename "cHash" column to "contentHash" in modfunc1 (avoid confusion with real cHash)
+
 2006-11-17  Martin Kutschker  <martin.t.kutschker@blackbox.net>
 
        * Added stdWrap around the search word in the output (tx_indexedsearch_pi[whatis]): tx_indexedsearch_pi.whatis_stdWrap
index 9bb2a7a..b15c999 100755 (executable)
@@ -535,7 +535,7 @@ class tx_indexedsearch_modfunc1 extends t3lib_extobjbase {
                                $lines[] = '<td bgcolor="red">'.$this->printRemoveIndexed('ALL','Clear ALL phash-rows below!').'</td>';
 
                                $lines[] = '<td>pHash</td>';
-                               $lines[] = '<td>cHash</td>';
+                               $lines[] = '<td>contentHash</td>';
                                $lines[] = '<td>&amp;id</td>';
                                $lines[] = '<td>&amp;type</td>';
                                $lines[] = '<td>&amp;L</td>';
index d5c881c..1223677 100755 (executable)
@@ -820,23 +820,23 @@ class tx_indexedsearch extends tslib_pibase {
 
                                // Perform search for word:
                        switch($theType)        {
-                               case '1':
+                               case '1':       // Part of word
                                        $wSel = "IW.baseword LIKE '%".$GLOBALS['TYPO3_DB']->quoteStr($sWord, 'index_words')."%'";
                                        $res = $this->execPHashListQuery($wSel,' AND is_stopword=0');
                                break;
-                               case '2':
+                               case '2':       // First part of word
                                        $wSel = "IW.baseword LIKE '".$GLOBALS['TYPO3_DB']->quoteStr($sWord, 'index_words')."%'";
                                        $res = $this->execPHashListQuery($wSel,' AND is_stopword=0');
                                break;
-                               case '3':
+                               case '3':       // Last part of word
                                        $wSel = "IW.baseword LIKE '%".$GLOBALS['TYPO3_DB']->quoteStr($sWord, 'index_words')."'";
                                        $res = $this->execPHashListQuery($wSel,' AND is_stopword=0');
                                break;
-                               case '10':
+                               case '10':      // Sounds like
                                        $wSel = 'IW.metaphone = '.$this->indexerObj->metaphone($sWord);
                                        $res = $this->execPHashListQuery($wSel,' AND is_stopword=0');
                                break;
-                               case '20':
+                               case '20':      // Sentence
                                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
                                                                'ISEC.phash',
                                                                'index_section ISEC, index_fulltext IFT',
@@ -849,7 +849,7 @@ class tx_indexedsearch extends tslib_pibase {
 
                                        if ($this->piVars['type']==20)  $this->piVars['order'] = 'mtime';               // If there is a fulltext search for a sentence there is a likeliness that sorting cannot be done by the rankings from the rel-table (because no relations will exist for the sentence in the word-table). So therefore mtime is used instaed. It is not required, but otherwise some hits may be left out.
                                break;
-                               default:
+                               default:        // Distinct word
                                        $wSel = 'IW.wid = '.$hash = $this->indexerObj->md5inthash($sWord);
                                        $res = $this->execPHashListQuery($wSel,' AND is_stopword=0');
                                break;
index a987dff..6120dc2 100755 (executable)
@@ -30,7 +30,7 @@
  * $Id$
  *
  * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
- * @author     Ingmar Schlecht <ingmars@web.de>
+ * @author     Ingmar Schlecht <ingmar@typo3.org>
  */
 /**
  * [CLASS/FUNCTION INDEX of SCRIPT]
@@ -155,7 +155,7 @@ require_once (PATH_t3lib.'class.t3lib_stdgraphic.php');
  * Install Tool module
  *
  * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
- * @author     Ingmar Schlecht <ingmars@web.de>
+ * @author     Ingmar Schlecht <ingmar@typo3.org>
  * @package TYPO3
  * @subpackage tx_install
  */
@@ -1320,16 +1320,16 @@ From sub-directory:
                                                $isTextarea = preg_match('/^string \(textarea\)/i',$description) ? TRUE : FALSE;
 
                                                if (!is_array($value) && ($this->checkForBadString($value) || $isTextarea))     {
-                                                       $k2='['.$vk.']';
-                                                       $msg=$description.'<br /><br /><em>'.$ext.$k2.' = '.htmlspecialchars(t3lib_div::fixed_lgd($value,60)).'</em><br />';
+                                                       $k2 = '['.$vk.']';
+                                                       $msg = $description.'<br /><br /><em>'.$ext.$k2.' = '.htmlspecialchars(t3lib_div::fixed_lgd($value,60)).'</em><br />';
 
                                                        if ($isTextarea)        {
-                                                               $form='<textarea name="TYPO3_INSTALL[extConfig]['.$k.']['.$vk.']" cols="60" rows="5" wrap="off">'.htmlspecialchars($value).'</textarea>';
+                                                               $form = '<textarea name="TYPO3_INSTALL[extConfig]['.$k.']['.$vk.']" cols="60" rows="5" wrap="off">'.htmlspecialchars($value).'</textarea>';
                                                        } elseif (preg_match('/^boolean/i',$description)) {
-                                                               $form='<input type="hidden" name="TYPO3_INSTALL[extConfig]['.$k.']['.$vk.']" value="0">';
-                                                               $form.='<input type="checkbox" name="TYPO3_INSTALL[extConfig]['.$k.']['.$vk.']"'.($value?' checked="checked"':'').' value="'.($value&&strcmp($value,'0')?htmlspecialchars($value):1).'">';
+                                                               $form = '<input type="hidden" name="TYPO3_INSTALL[extConfig]['.$k.']['.$vk.']" value="0">';
+                                                               $form.= '<input type="checkbox" name="TYPO3_INSTALL[extConfig]['.$k.']['.$vk.']"'.($value?' checked="checked"':'').' value="'.($value&&strcmp($value,'0')?htmlspecialchars($value):1).'">';
                                                        } else {
-                                                               $form='<input type="text" size="40" name="TYPO3_INSTALL[extConfig]['.$k.']['.$vk.']" value="'.htmlspecialchars($value).'">';
+                                                               $form = '<input type="text" size="40" name="TYPO3_INSTALL[extConfig]['.$k.']['.$vk.']" value="'.htmlspecialchars($value).'">';
                                                        }
                                                        $this->message($ext, $k2,$msg.$form);
                                                }
@@ -2180,13 +2180,14 @@ From sub-directory:
        }
 
        /**
-        * [Describe function...]
+        * Writes or returns lines from localconf.php
         *
-        * @param       [type]          $lines: ...
-        * @param       [type]          $showOutput: ...
-        * @return      [type]          ...
+        * @param       array           Array of lines to write back to localconf.php. Possibly
+        * @param       boolean         If TRUE then print what has been done.
+        * @return      mixed           If $lines is not an array it will return an array with the lines from localconf.php. Otherwise it will return a status string, either "continue" (updated) or "nochange" (not updated)
+        * @see parent::writeToLocalconf_control()
         */
-       function writeToLocalconf_control($lines="", $showOutput=1)     {
+       function writeToLocalconf_control($lines='', $showOutput=TRUE)  {
                $returnVal = parent::writeToLocalconf_control($lines);
 
                if ($showOutput)        {
index 499996a..1883fa0 100644 (file)
@@ -1,3 +1,7 @@
+2007-01-23  Michael Stucki  <michael@typo3.org>
+
+       * Change label of EM setting "AspellDirectory": The value must be a path, not a directory. The description should make this clear now...
+
 2006-12-20  Peter Niederlag  <peter@niederlag.de>
 
        * Version 1.5.1dev
index 4803998..3454f08 100644 (file)
@@ -7,7 +7,7 @@
   # cat=basic; type=string; label=No spell checking languages: The list of languages for which Aspell does not provide spell checking (see http://aspell.net/man-html/Unsupported.html#Unsupported) and for which the htmlArea SpellChecker plugin will therefore be disabled.
 noSpellCheckLanguages = ja,km,ko,lo,th,zh,b5,gb
 
-  # cat=basic; type=string; label=Aspell directory: The server directory in which Aspell is installed.
+  # cat=basic; type=string; label=Aspell path: The server path where Aspell is installed.
 AspellDirectory = /usr/bin/aspell
 
   # cat=basic; type=string; label=Default Aspell dictionary: The default dictionary to be used by the htmlArea SpellChecker plugin. This should be set to the default language of the site.